Bio.PopGen.GenePop.EasyController module

Control GenePop through an easier interface.

This interface is less efficient than the standard GenePopControler

class Bio.PopGen.GenePop.EasyController.EasyController(fname, genepop_dir=None)

Bases: object

Define a class for an easier interface with the GenePop program.

__init__(fname, genepop_dir=None)

Initialize the controller.

genepop_dir is the directory where GenePop is.

The binary should be called Genepop (capital G)

get_basic_info()

Obtain the population list and loci list from the file.

test_hw_pop(pop_pos, test_type='probability')

Perform Hardy-Weinberg test on the given position.

test_hw_global(test_type='deficiency', enum_test=True, dememorization=10000, batches=20, iterations=5000)

Perform Hardy-Weinberg global Heterozygote test.

test_ld_all_pair(locus1, locus2, dememorization=10000, batches=20, iterations=5000)

Test for linkage disequilibrium for each pair of loci in each population.

estimate_nm()

Estimate Nm. Just a simple bridge.

get_heterozygosity_info(pop_pos, locus_name)

Return the heterozygosity info for a certain locus on a population.

Returns (Expected homozygotes, observed homozygotes, Expected heterozygotes, observed heterozygotes)

get_genotype_count(pop_pos, locus_name)

Return the genotype counts for a certain population and locus.

get_fis(pop_pos, locus_name)

Return the Fis for a certain population and locus.

Below CW means Cockerham and Weir and RH means Robertson and Hill.

Returns a pair:

  • dictionary [allele] = (repetition count, frequency, Fis CW ) with information for each allele

  • a triple with total number of alleles, Fis CW, Fis RH

get_alleles(pop_pos, locus_name)

Return the alleles for a certain population and locus.

get_alleles_all_pops(locus_name)

Return the alleles for a certain population and locus.

get_allele_frequency(pop_pos, locus_name)

Calculate the allele frequency for a certain locus on a population.

get_multilocus_f_stats()

Return the multilocus F stats.

Explain averaging. Returns Fis(CW), Fst, Fit

get_f_stats(locus_name)

Return F stats for a locus.

Returns Fis(CW), Fst, Fit, Qintra, Qinter

get_avg_fis()

Calculate identity-base average Fis.

get_avg_fst_pair()

Calculate Allele size-base average Fis for all population pairs.

get_avg_fst_pair_locus(locus)

Calculate Allele size-base average Fis for all population pairs of the given locus.

calc_ibd(is_diplo=True, stat='a', scale='Log', min_dist=0.00001)

Calculate isolation by distance statistics for Diploid or Haploid.