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__(self, 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(self)¶
Obtain the population list and loci list from the file.
- test_hw_pop(self, pop_pos, test_type='probability')¶
Perform Hardy-Weinberg test on the given position.
- test_hw_global(self, test_type='deficiency', enum_test=True, dememorization=10000, batches=20, iterations=5000)¶
Perform Hardy-Weinberg global Heterozygote test.
- test_ld_all_pair(self, locus1, locus2, dememorization=10000, batches=20, iterations=5000)¶
Test for linkage disequilibrium for each pair of loci in each population.
- estimate_nm(self)¶
Estimate Nm. Just a simple bridge.
- get_heterozygosity_info(self, 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(self, pop_pos, locus_name)¶
Return the genotype counts for a certain population and locus.
- get_fis(self, 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(self, pop_pos, locus_name)¶
Return the alleles for a certain population and locus.
- get_alleles_all_pops(self, locus_name)¶
Return the alleles for a certain population and locus.
- get_allele_frequency(self, pop_pos, locus_name)¶
Calculate the allele frequency for a certain locus on a population.
- get_multilocus_f_stats(self)¶
Return the multilocus F stats.
Explain averaging. Returns Fis(CW), Fst, Fit
- get_f_stats(self, locus_name)¶
Return F stats for a locus.
Returns Fis(CW), Fst, Fit, Qintra, Qinter
- get_avg_fis(self)¶
Calculate identity-base average Fis.
- get_avg_fst_pair(self)¶
Calculate Allele size-base average Fis for all population pairs.
- get_avg_fst_pair_locus(self, locus)¶
Calculate Allele size-base average Fis for all population pairs of the given locus.
- calc_ibd(self, is_diplo=True, stat='a', scale='Log', min_dist=1e-05)¶
Calculate isolation by distance statistics for Diploid or Haploid.