bpp-popgen3
3.0.0
|
The MultilocusGenotypeStatistics class. More...
#include <Bpp/PopGen/MultilocusGenotypeStatistics.h>
Classes | |
struct | Fstats |
struct | PermResults |
struct | VarComp |
Static Public Member Functions | |
static std::vector< size_t > | getAllelesIdsForGroups (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Get the alleles' id at one locus for a set of groups. More... | |
static size_t | countGametesForGroups (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Count the number of allele (gametes) at a locus for a set of groups. More... | |
static std::map< size_t, size_t > | getAllelesMapForGroups (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Get a map of allele count for a set of groups. More... | |
static std::map< size_t, double > | getAllelesFrqForGroups (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Get the alleles frequencies at one locus for a set of groups. More... | |
static size_t | countNonMissingForGroups (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Count the number of non-missing data at a given locus for a set of groups. More... | |
static size_t | countBiAllelicForGroups (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Counr the number of bi-allelic MonolocusGenotype at a given locus for a set of groups. More... | |
static std::map< size_t, size_t > | countHeterozygousForGroups (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Count how many times each allele is found in an heterozygous MonolocusGenotype in a set of groups. More... | |
static std::map< size_t, double > | getHeterozygousFrqForGroups (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Get the heterozygous frequencies for each allele at a locus in a set of groups. More... | |
static double | getHobsForGroups (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Compute the observed heterozygosity for one locus. More... | |
static double | getHexpForGroups (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Compute the expected heterozygosity for one locus. More... | |
static double | getHnbForGroups (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Compute the expected non biased heterozygosity for one locus. More... | |
static double | getDnei72 (const PolymorphismMultiGContainer &pmgc, std::vector< size_t > locusPositions, size_t grp1, size_t grp2) |
Compute the Nei distance between two groups at one locus. More... | |
static double | getDnei78 (const PolymorphismMultiGContainer &pmgc, std::vector< size_t > locusPositions, size_t grp1, size_t grp2) |
Compute the Nei unbiased distance between two groups at a given number of loci. More... | |
static std::map< size_t, Fstats > | getAllelesFstats (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Compute the three F statistics of Weir and Cockerham for each allele of a given locus. More... | |
static std::map< size_t, double > | getAllelesFit (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Compute the Weir and Cockerham Fit on a set of groups for each allele of a given locus. More... | |
static std::map< size_t, double > | getAllelesFst (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Compute the Weir and Cockerham on a set of groups for each allele of a given locus. More... | |
static std::map< size_t, double > | getAllelesFis (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Compute the Weir and Cockerham Fis on a set of groups for each allele of a given locus. More... | |
static std::map< size_t, VarComp > | getVarianceComponents (const PolymorphismMultiGContainer &pmgc, size_t locusPosition, const std::set< size_t > &groups) |
Get the variance components a, b and c (Weir and Cockerham, 1983). More... | |
static double | getWCMultilocusFst (const PolymorphismMultiGContainer &pmgc, std::vector< size_t > locusPositions, const std::set< size_t > &groups) |
Compute the Weir and Cockerham on a set of groups for a given set of loci. The variance components for each allele are calculated and then combined over loci using Weir and Cockerham weighting. More... | |
static double | getWCMultilocusFis (const PolymorphismMultiGContainer &pmgc, std::vector< size_t > locusPositions, const std::set< size_t > &groups) |
Compute the Weir and Cockerham Fis on a set of groups for a given set of loci. The variance components for each allele are calculated and then combined over loci using Weir and Cockerham weighting. More... | |
static PermResults | getWCMultilocusFstAndPerm (const PolymorphismMultiGContainer &pmgc, std::vector< size_t > locusPositions, std::set< size_t > groups, unsigned int nb_perm) |
Compute the Weir and Cockerham on a set of groups for a given set of loci and make a permutation test. Multilocus is calculated as in getWCMultilocusFst on the original data set and on nb_perm data sets obtained after a permutation of individuals between the different groups. Return values are theta, % of values > theta and % of values < theta. More... | |
static PermResults | getWCMultilocusFisAndPerm (const PolymorphismMultiGContainer &pmgc, std::vector< size_t > locusPositions, std::set< size_t > groups, unsigned int nbPerm) |
Compute the Weir and Cockerham Fis on a set of groups for a given set of loci and make a permutation test. Multilocus Fis is calculated as in getWCMultilocusFis on the original data set and on nb_perm data sets obtained after a permutation of alleles between individual of each group. Return values are Fis, % of values > Fis and % of values < Fis. More... | |
static double | getRHMultilocusFst (const PolymorphismMultiGContainer &pmgc, std::vector< size_t > locusPositions, const std::set< size_t > &groups) |
Compute the on a set of groups for a given set of loci. The variance components for each allele are calculated and then combined over loci using RH weighting with alleles frequency. More... | |
static std::unique_ptr< DistanceMatrix > | getDistanceMatrix (const PolymorphismMultiGContainer &pmgc, std::vector< size_t > locusPositions, const std::set< size_t > &groups, std::string distance_method) |
Compute pairwise distances on a set of groups for a given set of loci. distance is either Nei72, Nei78, Fst W&C or Fst Robertson & Hill, Nm, D=-ln(1-Fst) of Reynolds et al. 1983, Rousset 1997 Fst/(1-Fst) More... | |
The MultilocusGenotypeStatistics class.
This class is a set of static method for PolymorphismMultiGContainer.
Definition at line 34 of file MultilocusGenotypeStatistics.h.
|
static |
Counr the number of bi-allelic MonolocusGenotype at a given locus for a set of groups.
IndexOutOfBoundsException | if locusPosition exceeds the number of loci of one MultilocusGenotype. |
Definition at line 133 of file MultilocusGenotypeStatistics.cpp.
References bpp::MonolocusGenotypeInterface::getAlleleIndex(), bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), bpp::PolymorphismMultiGContainer::getGroupId(), bpp::MultilocusGenotype::isMonolocusGenotypeMissing(), bpp::MultilocusGenotype::monolocusGenotype(), bpp::PolymorphismMultiGContainer::multilocusGenotype(), and bpp::PolymorphismMultiGContainer::size().
|
static |
Count the number of allele (gametes) at a locus for a set of groups.
IndexOutOfBoundsException | if locusPosition exceeds the number of loci of one MultilocusGenotype. |
Definition at line 42 of file MultilocusGenotypeStatistics.cpp.
References bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), and bpp::MapTools::getValues().
|
static |
Count how many times each allele is found in an heterozygous MonolocusGenotype in a set of groups.
IndexOutOfBoundsException | if locusPosition exceeds the number of loci of one MultilocusGenotype. |
Definition at line 153 of file MultilocusGenotypeStatistics.cpp.
References bpp::MonolocusGenotypeInterface::getAlleleIndex(), bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), bpp::PolymorphismMultiGContainer::getGroupId(), bpp::MultilocusGenotype::isMonolocusGenotypeMissing(), bpp::MultilocusGenotype::monolocusGenotype(), bpp::PolymorphismMultiGContainer::multilocusGenotype(), and bpp::PolymorphismMultiGContainer::size().
|
static |
Count the number of non-missing data at a given locus for a set of groups.
IndexOutOfBoundsException | if locusPosition exceeds the number of loci of one MultilocusGenotype. |
Definition at line 114 of file MultilocusGenotypeStatistics.cpp.
References bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), bpp::PolymorphismMultiGContainer::getGroupId(), bpp::MultilocusGenotype::isMonolocusGenotypeMissing(), bpp::PolymorphismMultiGContainer::multilocusGenotype(), and bpp::PolymorphismMultiGContainer::size().
|
static |
Compute the Weir and Cockerham Fis on a set of groups for each allele of a given locus.
Definition at line 443 of file MultilocusGenotypeStatistics.cpp.
|
static |
Compute the Weir and Cockerham Fit on a set of groups for each allele of a given locus.
Definition at line 413 of file MultilocusGenotypeStatistics.cpp.
|
static |
Get the alleles frequencies at one locus for a set of groups.
IndexOutOfBoundsException | if locusPosition exceeds the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 87 of file MultilocusGenotypeStatistics.cpp.
References bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), and bpp::MapTools::getValues().
Referenced by getRHMultilocusFst().
|
static |
Compute the Weir and Cockerham on a set of groups for each allele of a given locus.
Definition at line 427 of file MultilocusGenotypeStatistics.cpp.
|
static |
Compute the three F statistics of Weir and Cockerham for each allele of a given locus.
Definition at line 387 of file MultilocusGenotypeStatistics.cpp.
|
static |
Get the alleles' id at one locus for a set of groups.
IndexOutOfBoundsException | if locusPosition exceeds the number of loci of one MultilocusGenotype. |
Definition at line 28 of file MultilocusGenotypeStatistics.cpp.
References bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), and bpp::MapTools::getKeys().
|
static |
Get a map of allele count for a set of groups.
IndexOutOfBoundsException | if locusPosition exceeds the number of loci of one MultilocusGenotype. |
Definition at line 62 of file MultilocusGenotypeStatistics.cpp.
References bpp::MonolocusGenotypeInterface::getAlleleIndex(), bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), bpp::PolymorphismMultiGContainer::getGroupId(), bpp::MultilocusGenotype::isMonolocusGenotypeMissing(), bpp::MultilocusGenotype::monolocusGenotype(), bpp::PolymorphismMultiGContainer::multilocusGenotype(), and bpp::PolymorphismMultiGContainer::size().
|
static |
Compute pairwise distances on a set of groups for a given set of loci. distance is either Nei72, Nei78, Fst W&C or Fst Robertson & Hill, Nm, D=-ln(1-Fst) of Reynolds et al. 1983, Rousset 1997 Fst/(1-Fst)
Definition at line 718 of file MultilocusGenotypeStatistics.cpp.
References bpp::PolymorphismMultiGContainer::getAllGroupsNames(), getDnei72(), getDnei78(), getRHMultilocusFst(), and getWCMultilocusFst().
|
static |
Compute the Nei distance between two groups at one locus.
Nei 1972
where and are respectively the ith allele's frequency of the first and second group and the total number of alleles of both groups.
IndexOutOfBoundsException | if locusPosition exceeds the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 289 of file MultilocusGenotypeStatistics.cpp.
Referenced by getDistanceMatrix().
|
static |
Compute the Nei unbiased distance between two groups at a given number of loci.
Nei 1978
where and are respectively the ith allele's frequency of the first and second group, the total number of alleles of both groups, and the number of alleles in the first and second group and
IndexOutOfBoundsException | if locusPosition exceeds the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 334 of file MultilocusGenotypeStatistics.cpp.
Referenced by getDistanceMatrix().
|
static |
Get the heterozygous frequencies for each allele at a locus in a set of groups.
IndexOutOfBoundsException | if locusPosition exceeds the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 184 of file MultilocusGenotypeStatistics.cpp.
References bpp::MonolocusGenotypeInterface::getAlleleIndex(), bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), bpp::PolymorphismMultiGContainer::getGroupId(), bpp::MultilocusGenotype::isMonolocusGenotypeMissing(), bpp::MultilocusGenotype::monolocusGenotype(), bpp::PolymorphismMultiGContainer::multilocusGenotype(), and bpp::PolymorphismMultiGContainer::size().
|
static |
Compute the expected heterozygosity for one locus.
Nei 1977
where is the frequency of the ith allele and the number of alleles.
IndexOutOfBoundsException | if locusPosition exceeds the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 246 of file MultilocusGenotypeStatistics.cpp.
References bpp::IndexOutOfBoundsException::getBadIndex(), and bpp::IndexOutOfBoundsException::getBounds().
|
static |
Compute the expected non biased heterozygosity for one locus.
Nei 1978
where is the frequency of the ith allele and the number of alleles.
IndexOutOfBoundsException | if locusPosition exceeds the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 269 of file MultilocusGenotypeStatistics.cpp.
References bpp::IndexOutOfBoundsException::getBadIndex(), and bpp::IndexOutOfBoundsException::getBounds().
|
static |
Compute the observed heterozygosity for one locus.
This is the mean value of the getHeterozygousFrqForGroups map.
IndexOutOfBoundsException | if locusPosition exceeds the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 223 of file MultilocusGenotypeStatistics.cpp.
References bpp::IndexOutOfBoundsException::getBadIndex(), and bpp::IndexOutOfBoundsException::getBounds().
|
static |
Compute the on a set of groups for a given set of loci. The variance components for each allele are calculated and then combined over loci using RH weighting with alleles frequency.
Definition at line 677 of file MultilocusGenotypeStatistics.cpp.
References getAllelesFrqForGroups().
Referenced by getDistanceMatrix().
|
static |
Get the variance components a, b and c (Weir and Cockerham, 1983).
Definition at line 457 of file MultilocusGenotypeStatistics.cpp.
References bpp::PolymorphismMultiGContainer::getLocusGroupSize().
|
static |
Compute the Weir and Cockerham Fis on a set of groups for a given set of loci. The variance components for each allele are calculated and then combined over loci using Weir and Cockerham weighting.
Definition at line 579 of file MultilocusGenotypeStatistics.cpp.
References bpp::PolymorphismMultiGContainer::getLocusGroupSize().
|
static |
Compute the Weir and Cockerham Fis on a set of groups for a given set of loci and make a permutation test. Multilocus Fis is calculated as in getWCMultilocusFis on the original data set and on nb_perm data sets obtained after a permutation of alleles between individual of each group. Return values are Fis, % of values > Fis and % of values < Fis.
Definition at line 643 of file MultilocusGenotypeStatistics.cpp.
References bpp::PolymorphismMultiGContainerTools::extractGroups(), bpp::MultilocusGenotypeStatistics::PermResults::percentInf, bpp::MultilocusGenotypeStatistics::PermResults::percentSup, bpp::PolymorphismMultiGContainerTools::permuteIntraGroupAlleles(), and bpp::MultilocusGenotypeStatistics::PermResults::statistic.
|
static |
Compute the Weir and Cockerham on a set of groups for a given set of loci. The variance components for each allele are calculated and then combined over loci using Weir and Cockerham weighting.
Definition at line 548 of file MultilocusGenotypeStatistics.cpp.
References bpp::PolymorphismMultiGContainer::getLocusGroupSize().
Referenced by getDistanceMatrix().
|
static |
Compute the Weir and Cockerham on a set of groups for a given set of loci and make a permutation test. Multilocus is calculated as in getWCMultilocusFst on the original data set and on nb_perm data sets obtained after a permutation of individuals between the different groups. Return values are theta, % of values > theta and % of values < theta.
Definition at line 609 of file MultilocusGenotypeStatistics.cpp.
References bpp::PolymorphismMultiGContainerTools::extractGroups(), bpp::MultilocusGenotypeStatistics::PermResults::percentInf, bpp::MultilocusGenotypeStatistics::PermResults::percentSup, bpp::PolymorphismMultiGContainerTools::permuteMultiG(), and bpp::MultilocusGenotypeStatistics::PermResults::statistic.