Public API: geovar package

Classes

Classes used to prepare the graph inputs and run the geovar method.

GeoVar([bins])

GeoVar object that performs binning of allele frequencies.

GeoVarPlot()

Class for a GeoVar plot.

Submodules

geovar.utils

Utilities for file conversions for GeoVar.

Utilities for file conversions for GeoVar.

geovar.utils.read_pop_panel(pop_panel_file)[source]

Read in a population panel file.

Parameters:

( (pop_panel_files) – obj: string): list of population

geovar.utils.sep_freq_mat_pops(af_df, known_cols=['CHR', 'SNP', 'A1', 'A2', 'MAC', 'MAF'])[source]

Convert an allele frequency data frame to a frequency array.

Parameters:
  • af_df (pandas.DataFrame) – allele frequency data frame.

  • known_cols (list) – list of columns to exclude from being a population.

geovar.utils.vcf_to_freq_table(vcf_file, pop_df, outfile=None, minor_allele=True, **kwargs)[source]

Convert a VCF File to a frequency table to be used as input to a GeoVar object.

Parameters:
  • vcf_file (string) – filepath to VCF file (can be bgzipped).

  • pop_df (pandas.DataFrame) – population data frame in pandas format.

  • outfile (string) – file to write output allele frequency table to.

  • minor_allele (bool) – flag to indicate if we want to polarize to the minor allele.

geovar.utils.verify_sample_indices(pop_df, samples)[source]

Generate the sample indices from a list of sample IDs stratified by population.

Parameters:
  • pop_df (pandas.DataFrame) – population data frame in pandas format.Must have pop and sample columns available.

  • samples (list) – list of sample IDs (strings) that are ready to be indexed.