bpp-popgen
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 locus_position, 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 locus_position, 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 locus_position, 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 locus_position, 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 locus_position, 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 locus_position, 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 locus_position, 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 locus_position, 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 locus_position, const std::set< size_t > &groups) |
Compute the observed heterozygosity for one locus. More... | |
static double | getHexpForGroups (const PolymorphismMultiGContainer &pmgc, size_t locus_position, const std::set< size_t > &groups) |
Compute the expected heterozygosity for one locus. More... | |
static double | getHnbForGroups (const PolymorphismMultiGContainer &pmgc, size_t locus_position, 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 > locus_positions, 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 > locus_positions, 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 locus_position, 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 locus_position, 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 locus_position, 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 locus_position, 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 locus_position, 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 > locus_positions, const std::set< size_t > &groups) |
Compute the Weir and Cockerham on a set of groups for a given set of loci. The variance componenets 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 > locus_positions, 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 componenets 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 > locus_positions, std::set< size_t > groups, 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 > locus_positions, std::set< size_t > groups, int nb_perm) |
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 > locus_positions, const std::set< size_t > &groups) |
Compute the on a set of groups for a given set of loci. The variance componenets 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 > locus_positions, 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 70 of file MultilocusGenotypeStatistics.h.
|
static |
Counr the number of bi-allelic MonolocusGenotype at a given locus for a set of groups.
IndexOutOfBoundsException | if locus_position excedes the number of loci of one MultilocusGenotype. |
Definition at line 161 of file MultilocusGenotypeStatistics.cpp.
References bpp::MonolocusGenotype::getAlleleIndex(), bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), bpp::PolymorphismMultiGContainer::getGroupId(), bpp::MultilocusGenotype::getMonolocusGenotype(), bpp::PolymorphismMultiGContainer::getMultilocusGenotype(), bpp::MultilocusGenotype::isMonolocusGenotypeMissing(), and bpp::PolymorphismMultiGContainer::size().
|
static |
Count the number of allele (gametes) at a locus for a set of groups.
IndexOutOfBoundsException | if locus_position excedes the number of loci of one MultilocusGenotype. |
Definition at line 70 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 locus_position excedes the number of loci of one MultilocusGenotype. |
Definition at line 181 of file MultilocusGenotypeStatistics.cpp.
References bpp::MonolocusGenotype::getAlleleIndex(), bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), bpp::PolymorphismMultiGContainer::getGroupId(), bpp::MultilocusGenotype::getMonolocusGenotype(), bpp::PolymorphismMultiGContainer::getMultilocusGenotype(), bpp::MultilocusGenotype::isMonolocusGenotypeMissing(), and bpp::PolymorphismMultiGContainer::size().
|
static |
Count the number of non-missing data at a given locus for a set of groups.
IndexOutOfBoundsException | if locus_position excedes the number of loci of one MultilocusGenotype. |
Definition at line 142 of file MultilocusGenotypeStatistics.cpp.
References bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), bpp::PolymorphismMultiGContainer::getGroupId(), bpp::PolymorphismMultiGContainer::getMultilocusGenotype(), bpp::MultilocusGenotype::isMonolocusGenotypeMissing(), 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 471 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 441 of file MultilocusGenotypeStatistics.cpp.
|
static |
Get the alleles frequencies at one locus for a set of groups.
IndexOutOfBoundsException | if locus_position excedes the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 115 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 455 of file MultilocusGenotypeStatistics.cpp.
|
static |
Compute the three F statistics of Weir and Cockerham for each allele of a given locus.
Definition at line 415 of file MultilocusGenotypeStatistics.cpp.
|
static |
Get the alleles' id at one locus for a set of groups.
IndexOutOfBoundsException | if locus_position excedes the number of loci of one MultilocusGenotype. |
Definition at line 56 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 locus_position excedes the number of loci of one MultilocusGenotype. |
Definition at line 90 of file MultilocusGenotypeStatistics.cpp.
References bpp::MonolocusGenotype::getAlleleIndex(), bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), bpp::PolymorphismMultiGContainer::getGroupId(), bpp::MultilocusGenotype::getMonolocusGenotype(), bpp::PolymorphismMultiGContainer::getMultilocusGenotype(), bpp::MultilocusGenotype::isMonolocusGenotypeMissing(), 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 735 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 locus_position excedes the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 317 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 locus_position excedes the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 362 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 locus_position excedes the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 212 of file MultilocusGenotypeStatistics.cpp.
References bpp::MonolocusGenotype::getAlleleIndex(), bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), bpp::PolymorphismMultiGContainer::getGroupId(), bpp::MultilocusGenotype::getMonolocusGenotype(), bpp::PolymorphismMultiGContainer::getMultilocusGenotype(), bpp::MultilocusGenotype::isMonolocusGenotypeMissing(), 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 locus_position excedes the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 274 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 locus_position excedes the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 297 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 locus_position excedes the number of loci of one MultilocusGenotype. |
ZeroDivisionException | if the number of considered alleles = 0. |
Definition at line 251 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 componenets for each allele are calculated and then combined over loci using RH weighting with alleles frequency.
Definition at line 697 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 485 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 componenets for each allele are calculated and then combined over loci using Weir and Cockerham weighting.
Definition at line 607 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 667 of file MultilocusGenotypeStatistics.cpp.
References bpp::PolymorphismMultiGContainerTools::extractGroups(), bpp::MultilocusGenotypeStatistics::PermResults::Percent_inf, bpp::MultilocusGenotypeStatistics::PermResults::Percent_sup, bpp::PolymorphismMultiGContainerTools::permutIntraGroupAlleles(), and bpp::MultilocusGenotypeStatistics::PermResults::Statistic.
|
static |
Compute the Weir and Cockerham on a set of groups for a given set of loci. The variance componenets for each allele are calculated and then combined over loci using Weir and Cockerham weighting.
Definition at line 576 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 637 of file MultilocusGenotypeStatistics.cpp.
References bpp::PolymorphismMultiGContainerTools::extractGroups(), bpp::MultilocusGenotypeStatistics::PermResults::Percent_inf, bpp::MultilocusGenotypeStatistics::PermResults::Percent_sup, bpp::PolymorphismMultiGContainerTools::permutMultiG(), and bpp::MultilocusGenotypeStatistics::PermResults::Statistic.