|
bpp-popgen
2.1.0
|
Static class providing methods to compute statistics on sequences data. More...
#include <Bpp/PopGen/SequenceStatistics.h>
Public Member Functions | |
| double | FstHudson92 (const PolymorphismSequenceContainer &psc, size_t id1, size_t id2) |
Static Public Member Functions | |
| static size_t | polymorphicSiteNumber (const PolymorphismSequenceContainer &psc, bool gapflag=true, bool ignoreUnknown=true) |
| Compute the number of polymorphic site in an alignment. | |
| static size_t | parsimonyInformativeSiteNumber (const PolymorphismSequenceContainer &psc, bool gapflag=true) |
| Compute the number of parsimony informative sites in an alignment. | |
| static size_t | countSingleton (const PolymorphismSequenceContainer &psc, bool gapflag=true) |
| Count the number of singleton nucleotides in an alignment. | |
| static size_t | totNumberMutations (const PolymorphismSequenceContainer &psc, bool gapflag=true) |
| Count the total number of mutations in an alignment. | |
| static size_t | totMutationsExternalBranchs (const PolymorphismSequenceContainer &ing, const PolymorphismSequenceContainer &outg) throw (Exception) |
| Count the total number of mutations in external branchs. | |
| static size_t | tripletNumber (const PolymorphismSequenceContainer &psc, bool gapflag=true) |
| Compute the number of triplet in an alignment. | |
| static double | heterozygosity (const PolymorphismSequenceContainer &psc, bool gapflag=true) |
| Compute the sum of per site heterozygosity in an alignment. | |
| static double | squaredHeterozygosity (const PolymorphismSequenceContainer &psc, bool gapflag=true) |
| Compute the sum of per site squared heterozygosity in an alignment. | |
| static double | gcContent (const PolymorphismSequenceContainer &psc) |
| Compute the mean GC content in an alignment. | |
| static std::vector< size_t > | gcPolymorphism (const PolymorphismSequenceContainer &psc, bool gapflag=true) |
| Return the number of GC alleles and the total number of alleles at polymorphic sites only. | |
| static double | watterson75 (const PolymorphismSequenceContainer &psc, bool gapflag=true, bool ignoreUnknown=true) |
| Compute diversity estimator Theta of Watterson (1975, Theor Popul Biol, 7 pp256-276) | |
| static double | tajima83 (const PolymorphismSequenceContainer &psc, bool gapflag=true) |
| Compute diversity estimator Theta of Tajima (1983, Genetics, 105 pp437-460) | |
| static double | FayWu2000 (const PolymorphismSequenceContainer &psc, const Sequence &ancestralSites) |
| Compute diversity estimator Theta H (eq. 3) of Fay and Wu (2000, Genetics, 155: 1405-1413) | |
| static size_t | DVK (const PolymorphismSequenceContainer &psc, bool gapflag=true) |
| Return the number of haplotype in the sample. Depaulis and Veuille (1998, Mol Biol Evol, 12 pp1788-1790) | |
| static double | DVH (const PolymorphismSequenceContainer &psc, bool gapflag=true) |
| Return the haplotype diversity of a sample. Depaulis and Veuille (1998, Mol Biol Evol, 12 pp1788-1790) | |
| static size_t | getNumberOfTransitions (const PolymorphismSequenceContainer &psc) |
| Return the number of transitions. | |
| static size_t | getNumberOfTransversions (const PolymorphismSequenceContainer &psc) |
| Return the number of transversions. | |
| static double | getTransitionsTransversionsRatio (const PolymorphismSequenceContainer &psc) throw (Exception) |
| Return the ratio of transitions/transversions. | |
| static size_t | stopCodonSiteNumber (const PolymorphismSequenceContainer &psc, const GeneticCode &gCode, bool gapflag=true) |
| Compute the number of codon sites with stop codon. | |
| static size_t | monoSitePolymorphicCodonNumber (const PolymorphismSequenceContainer &psc, bool stopflag=true, bool gapflag=true) |
| Compute the number of polymorphic codon with only one mutated site. | |
| static size_t | synonymousPolymorphicCodonNumber (const PolymorphismSequenceContainer &psc, const GeneticCode &gc) |
| Compute the number of synonymous polymorphic codon sites. | |
| static double | watterson75Synonymous (const PolymorphismSequenceContainer &psc, const GeneticCode &gc) |
| Compute the Watterson(1975,Theor Popul Biol, 7 pp256-276) estimator for synonymous positions. | |
| static double | watterson75NonSynonymous (const PolymorphismSequenceContainer &psc, const GeneticCode &gc) |
| Compute the Watterson(1975, Theor Popul Biol, 7 pp256-276) estimator for non synonymous positions. | |
| static double | piSynonymous (const PolymorphismSequenceContainer &psc, const GeneticCode &gc, bool minchange=false) |
| Compute the synonymous nucleotide diversity, pi. | |
| static double | piNonSynonymous (const PolymorphismSequenceContainer &psc, const GeneticCode &gc, bool minchange=false) |
| Compute the non-synonymous nucleotide diversity, pi. | |
| static double | meanSynonymousSitesNumber (const PolymorphismSequenceContainer &psc, const GeneticCode &gc, double ratio=1.) |
| compute the mean number of synonymous site in an alignment | |
| static double | meanNonSynonymousSitesNumber (const PolymorphismSequenceContainer &psc, const GeneticCode &gc, double ratio=1.) |
| compute the mean number of non-synonymous site in an alignment | |
| static size_t | synonymousSubstitutionsNumber (const PolymorphismSequenceContainer &psc, const GeneticCode &gc, double freqmin=0.) |
| compute the number of synonymous subsitutions in an alignment | |
| static size_t | nonSynonymousSubstitutionsNumber (const PolymorphismSequenceContainer &psc, const GeneticCode &gc, double freqmin=0.) |
| compute the number of non synonymous subsitutions in an alignment | |
| static std::vector< size_t > | fixedDifferences (const PolymorphismSequenceContainer &pscin, const PolymorphismSequenceContainer &pscout, PolymorphismSequenceContainer &psccons, const GeneticCode &gc) |
| compute the number of fixed differences between two alignements | |
| static std::vector< size_t > | MKtable (const PolymorphismSequenceContainer &ingroup, const PolymorphismSequenceContainer &outgroup, const GeneticCode &gc, double freqmin=0.) |
| return a vector containing Pa, Ps, Da, Ds | |
| static double | neutralityIndex (const PolymorphismSequenceContainer &ingroup, const PolymorphismSequenceContainer &outgroup, const GeneticCode &gc, double freqmin=0.) |
| return the neutrality index NI = (Pa/Ps)/(Da/Ds) (Rand & Kann 1996, Mol. Biol. Evol. 13 pp735-748) | |
| static double | tajimaDSS (const PolymorphismSequenceContainer &psc, bool gapflag=true) throw (ZeroDivisionException) |
| Return the Tajima's D test (Tajima 1989, Genetics 123 pp 585-595). | |
| static double | tajimaDTNM (const PolymorphismSequenceContainer &psc, bool gapflag=true) throw (ZeroDivisionException) |
| Return the Tajima's D test (Tajima 1989, Genetics 123 pp 585-595). | |
| static double | fuliD (const PolymorphismSequenceContainer &ingroup, const PolymorphismSequenceContainer &outgroup, bool original=true) throw (ZeroDivisionException) |
| Return the Fu and Li D test (Fu & Li 1993, Genetics, 133 pp693-709). | |
| static double | fuliDstar (const PolymorphismSequenceContainer &group) throw (ZeroDivisionException) |
| Return the Fu and Li D* test (Fu & Li 1993, Genetics, 133 pp693-709). | |
| static double | fuliF (const PolymorphismSequenceContainer &ingroup, const PolymorphismSequenceContainer &outgroup, bool original=true) throw (ZeroDivisionException) |
| Return the Fu and Li F test (Fu & Li 1993, Genetics, 133 pp693-709). | |
| static double | fuliFstar (const PolymorphismSequenceContainer &group) throw (ZeroDivisionException) |
| Return the Fu and Li F* test (Fu & Li 1993, Genetics, 133 pp693-709). | |
| static PolymorphismSequenceContainer * | generateLDContainer (const PolymorphismSequenceContainer &psc, bool keepsingleton=true, double freqmin=0.) |
| generate a special PolymorphismSequenceContainer for linkage disequilbrium analysis | |
| static Vdouble | pairwiseDistances1 (const PolymorphismSequenceContainer &psc, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give the vector of the pairwise distances between site positions corresponding to a LD SequencePolymorphismContainer | |
| static Vdouble | pairwiseDistances2 (const PolymorphismSequenceContainer &psc, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give the vector of all mean pairwise distance between two sites to a LD SequencePolymorphismContainer | |
| static Vdouble | pairwiseD (const PolymorphismSequenceContainer &psc, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give the vector of all mean pairwise D value between two sites (Lewontin & Kojima 1964, Evolution 14 pp458-472) | |
| static Vdouble | pairwiseDprime (const PolymorphismSequenceContainer &psc, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give the vector of all mean pairwise D' value between two sites (Lewontin 1964, Genetics 49 pp49-67)) | |
| static Vdouble | pairwiseR2 (const PolymorphismSequenceContainer &psc, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give the vector of all mean pairwise R² value between two sites (Hill & Robertson 1968, Theor. Appl. Genet., 38 pp226-231) | |
| static double | meanD (const PolymorphismSequenceContainer &psc, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give mean D over all pairwise comparisons | |
| static double | meanDprime (const PolymorphismSequenceContainer &psc, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give mean D' over all pairwise comparisons | |
| static double | meanR2 (const PolymorphismSequenceContainer &psc, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give mean R² over all pairwise comparisons | |
| static double | meanDistance1 (const PolymorphismSequenceContainer &psc, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give mean pairwise distances between sites / method 1: differences between sequences are not taken into account | |
| static double | meanDistance2 (const PolymorphismSequenceContainer &psc, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give mean pairwise distances between sites / method 2: differences between sequences are taken into account | |
| static double | originRegressionD (const PolymorphismSequenceContainer &psc, bool distance1=false, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give the slope of the regression |D| = 1+a*distance | |
| static double | originRegressionDprime (const PolymorphismSequenceContainer &psc, bool distance1=false, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give the slope of the regression |D'| = 1+a*distance | |
| static double | originRegressionR2 (const PolymorphismSequenceContainer &psc, bool distance1=false, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give the slope of the regression R² = 1+a*distance | |
| static Vdouble | linearRegressionD (const PolymorphismSequenceContainer &psc, bool distance1=false, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give the slope and the origin of the regression |D| = a*distance+b | |
| static Vdouble | linearRegressionDprime (const PolymorphismSequenceContainer &psc, bool distance1=false, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give the slope and the origin of the regression |D'| = a*distance+b | |
| static Vdouble | linearRegressionR2 (const PolymorphismSequenceContainer &psc, bool distance1=false, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give the slope and the origin of the regression R² = a*distance+b | |
| static double | inverseRegressionR2 (const PolymorphismSequenceContainer &psc, bool distance1=false, bool keepsingleton=true, double freqmin=0.) throw (DimensionException) |
| give the slope of the regression R² = 1/(1+a*distance) | |
| static double | hudson87 (const PolymorphismSequenceContainer &psc, double precision=0.000001, double cinf=0.001, double csup=10000.) |
| give estimate of C=4Nr using Hudson method (Hudson 1987, Genet. Res., 50 pp245-250) | |
| static void | testUsefullValues (std::ostream &s, size_t n) |
| Test usefull values. | |
Static Private Member Functions | |
| static size_t | getMutationNumber_ (const Site &site) |
| Count the number of mutation for a site. | |
| static size_t | getSingletonNumber_ (const Site &site) |
| Count the number of singleton for a site. | |
| static size_t | getDerivedSingletonNumber_ (const Site &site_in, const Site &site_out) |
| Count the number of singleton for a site. | |
| static std::map< std::string, double > | getUsefullValues_ (size_t n) |
| Get usefull values for theta estimators. | |
| static double | getVD_ (size_t n, double a1, double a2, double cn) |
| Get the vD value of equation (32) in Fu & Li 1993, Genetics, 133 pp693-709) | |
| static double | getUD_ (double a1, double vD) |
| Get the uD value of equation (32) in Fu & Li 1993, Genetics, 133 pp693-709) | |
| static double | getVDstar_ (size_t n, double a1, double a2, double dn) |
| Get the vD* value of D* equation in Fu & Li 1993, Genetics, 133 pp693-709) | |
| static double | getUDstar_ (size_t n, double a1, double vDs) |
| Get the uD* value of D* equation in Fu & Li 1993, Genetics, 133 pp693-709) | |
| static double | leftHandHudson_ (const PolymorphismSequenceContainer &psc) |
| give the left hand term of equation (4) in Hudson (Hudson 1987, Genet. Res., 50 pp245-250) This term is used in hudson87 | |
| static double | rightHandHudson_ (double c, size_t n) |
| give the right hand term of equation (4) in Hudson (Hudson 1987, Genet. Res., 50 pp245-250) This term is used in hudson87 | |
Static class providing methods to compute statistics on sequences data.
Definition at line 69 of file SequenceStatistics.h.
| size_t SequenceStatistics::countSingleton | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true |
||
| ) | [static] |
Count the number of singleton nucleotides in an alignment.
| psc | a PolymorphismSequenceContainer |
| gapflag | a boolean set by default to true if you don't want to take gap into account |
Definition at line 114 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| double SequenceStatistics::DVH | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true |
||
| ) | [static] |
Return the haplotype diversity of a sample. Depaulis and Veuille (1998, Mol Biol Evol, 12 pp1788-1790)
| psc | a PolymorphismSequenceContainer |
| gapflag | flag set by default to true if you don't want to take gaps into account |
Definition at line 426 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences(), bpp::PolymorphismSequenceContainer::getSequenceCount(), and bpp::VectorSiteContainer::toString().
| size_t SequenceStatistics::DVK | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true |
||
| ) | [static] |
Return the number of haplotype in the sample. Depaulis and Veuille (1998, Mol Biol Evol, 12 pp1788-1790)
| psc | a PolymorphismSequenceContainer |
| gapflag | flag set by default to true if you don't want to take gap into account |
Definition at line 387 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences(), and bpp::VectorSiteContainer::toString().
| double SequenceStatistics::FayWu2000 | ( | const PolymorphismSequenceContainer & | psc, |
| const Sequence & | ancestralSites | ||
| ) | [static] |
Compute diversity estimator Theta H (eq. 3) of Fay and Wu (2000, Genetics, 155: 1405-1413)
| psc | a PolymorphismSequenceContainer |
| ancestralSites | a Sequence containing the ancestral states (reconstructed independently) to fold the mutation in the psc SequenceContainer. |
Definition at line 340 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getAlphabet(), bpp::Sequence::getChar(), bpp::VectorSiteContainer::getNumberOfSites(), bpp::VectorSiteContainer::getSequence(), bpp::VectorSiteContainer::getSite(), bpp::Sequence::getValue(), and bpp::Sequence::size().
| vector< size_t > SequenceStatistics::fixedDifferences | ( | const PolymorphismSequenceContainer & | pscin, |
| const PolymorphismSequenceContainer & | pscout, | ||
| PolymorphismSequenceContainer & | psccons, | ||
| const GeneticCode & | gc | ||
| ) | [static] |
compute the number of fixed differences between two alignements
Gaps and unresolved sites are automatically excluded
In case of complex codon, the path that gives the minimum number of non-synonymous changes is chosen. The argument minchange=true is sent to numberOfSynonymousDifferences used in this method. Otherwise, a non-integer number could be return.
| pscin | a PolymorphismSequenceContainer |
| pscout | a PolymorphismSequenceContainer |
| psccons | a PolymorphismSequenceContainer |
| gc | a GeneticCode |
Definition at line 751 of file SequenceStatistics.cpp.
References bpp::Site::getValue(), bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| double SequenceStatistics::FstHudson92 | ( | const PolymorphismSequenceContainer & | psc, |
| size_t | id1, | ||
| size_t | id2 | ||
| ) |
Fst of Hudson, Slatkin and Maddison
Taken from eq. 3 of Hudson, Slatkin and Maddison 1992 Genetics 132:153
where
is mean number of differences between different sequences sampled from the same subpopulation, and
is the mean number of differences between sequences sampled from the two different subpopulations sampled.
| psc | a PolymorphismSequenceContainer will at least two populations |
| id1 | is the id of the population 1 |
| id2 | is the id of the population 2 |
Definition at line 944 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences(), bpp::VectorSiteContainer::getNumberOfSites(), and bpp::VectorSiteContainer::getSequence().
| double SequenceStatistics::fuliD | ( | const PolymorphismSequenceContainer & | ingroup, |
| const PolymorphismSequenceContainer & | outgroup, | ||
| bool | original = true |
||
| ) | throw (ZeroDivisionException) [static] |
Return the Fu and Li D test (Fu & Li 1993, Genetics, 133 pp693-709).
| ingroup | a PolymorphismSequenceContainer |
| outgroup | a PolymorphismSequenceContainer |
| original | true: use the Fu & Li methode, false: use mutations in external branch. |
| ZeroDivisionException | if eta == 0 |
If one set original=false then the number of mutations will be used. If the outgroup contains more than one sequence the sites with more than one variant will not be considered for external branch mutations!
Definition at line 864 of file SequenceStatistics.cpp.
| double SequenceStatistics::fuliDstar | ( | const PolymorphismSequenceContainer & | group | ) | throw (ZeroDivisionException) [static] |
Return the Fu and Li D* test (Fu & Li 1993, Genetics, 133 pp693-709).
| group | a PolymorphismSequenceContainer |
Definition at line 881 of file SequenceStatistics.cpp.
| double SequenceStatistics::fuliF | ( | const PolymorphismSequenceContainer & | ingroup, |
| const PolymorphismSequenceContainer & | outgroup, | ||
| bool | original = true |
||
| ) | throw (ZeroDivisionException) [static] |
Return the Fu and Li F test (Fu & Li 1993, Genetics, 133 pp693-709).
| ingroup | a PolymorphismSequenceContainer |
| outgroup | a PolymorphismSequenceContainer |
| original | true: use the Fu & Li methode, false: use mutations in external branch. |
If one set original=false then the number of mutations will be used. If the outgroup contains more than one sequence the sites with more than one variant will not be considered for external branch mutations!
Definition at line 903 of file SequenceStatistics.cpp.
| double SequenceStatistics::fuliFstar | ( | const PolymorphismSequenceContainer & | group | ) | throw (ZeroDivisionException) [static] |
Return the Fu and Li F* test (Fu & Li 1993, Genetics, 133 pp693-709).
| group | a PolymorphismSequenceContainer |
Definition at line 922 of file SequenceStatistics.cpp.
| double SequenceStatistics::gcContent | ( | const PolymorphismSequenceContainer & | psc | ) | [static] |
Compute the mean GC content in an alignment.
| psc | a PolymorphismSequenceContainer |
Definition at line 239 of file SequenceStatistics.cpp.
References bpp::Alphabet::charToInt(), and bpp::VectorSiteContainer::getAlphabet().
| std::vector< size_t > SequenceStatistics::gcPolymorphism | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true |
||
| ) | [static] |
Return the number of GC alleles and the total number of alleles at polymorphic sites only.
G vs C and A vs T polymorphism are not taken into account
| psc | a PolymorphismSequenceContainer |
| gapflag | a boolean set by default to true if you don't want to take gap into account |
Definition at line 247 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences(), bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| PolymorphismSequenceContainer * SequenceStatistics::generateLDContainer | ( | const PolymorphismSequenceContainer & | psc, |
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | [static] |
generate a special PolymorphismSequenceContainer for linkage disequilbrium analysis
Create a PolymorphismSequenceContainer with only polymorphic site : The value 1 is assigned to the most frequent allele, and 0 to the least frequent. This psc is needed to compute Linkage Disequilibrium Statistics. Should be used before excluding gaps, but sites with gaps are not counted as polymorphic sites. Singleton can be excluded. Polymorphic site with the lowest frequency < threshold can be excluded. Only polymorphic sites with 2 alleles are kept.
| psc | a PolymorphismSequenceContainer |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
Definition at line 987 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::addSite(), bpp::SiteContainer::getNumberOfSequences(), bpp::SiteContainer::getNumberOfSites(), bpp::VectorSiteContainer::getNumberOfSites(), bpp::SiteContainer::getSite(), bpp::VectorSiteContainer::getSite(), bpp::Site::getValue(), and bpp::Site::setElement().
| size_t SequenceStatistics::getDerivedSingletonNumber_ | ( | const Site & | site_in, |
| const Site & | site_out | ||
| ) | [static, private] |
Count the number of singleton for a site.
will count singletons that are not in site_out (a site in outgroup) site_in is a site from an ingroup
Definition at line 1608 of file SequenceStatistics.cpp.
| size_t SequenceStatistics::getMutationNumber_ | ( | const Site & | site | ) | [static, private] |
Count the number of mutation for a site.
Definition at line 1579 of file SequenceStatistics.cpp.
| size_t SequenceStatistics::getNumberOfTransitions | ( | const PolymorphismSequenceContainer & | psc | ) | [static] |
Return the number of transitions.
| psc | a PolymorphismSequenceContainer |
Definition at line 474 of file SequenceStatistics.cpp.
References bpp::Site::getContent(), bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| size_t SequenceStatistics::getNumberOfTransversions | ( | const PolymorphismSequenceContainer & | psc | ) | [static] |
Return the number of transversions.
| psc | a PolymorphismSequenceContainer |
Definition at line 506 of file SequenceStatistics.cpp.
References bpp::Site::getContent(), bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| size_t SequenceStatistics::getSingletonNumber_ | ( | const Site & | site | ) | [static, private] |
Count the number of singleton for a site.
Definition at line 1595 of file SequenceStatistics.cpp.
| double SequenceStatistics::getTransitionsTransversionsRatio | ( | const PolymorphismSequenceContainer & | psc | ) | throw (Exception) [static] |
Return the ratio of transitions/transversions.
| psc | a PolymorphismSequenceContainer |
Definition at line 538 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| double SequenceStatistics::getUD_ | ( | double | a1, |
| double | vD | ||
| ) | [static, private] |
Get the uD value of equation (32) in Fu & Li 1993, Genetics, 133 pp693-709)
| a1 | as describe in getUsefullValues |
| vD | as provided by getVD_ |
Definition at line 1686 of file SequenceStatistics.cpp.
| double SequenceStatistics::getUDstar_ | ( | size_t | n, |
| double | a1, | ||
| double | vDs | ||
| ) | [static, private] |
Get the uD* value of D* equation in Fu & Li 1993, Genetics, 133 pp693-709)
| n | the number of observed sequences |
| a1 | as describe in getUsefullValues |
| vDs | as provided by getVDstar_ |
Definition at line 1719 of file SequenceStatistics.cpp.
| std::map< std::string, double > SequenceStatistics::getUsefullValues_ | ( | size_t | n | ) | [static, private] |
Get usefull values for theta estimators.
| n | the number of observed sequences |
is the number of observed sequences.Definition at line 1630 of file SequenceStatistics.cpp.
| double SequenceStatistics::getVD_ | ( | size_t | n, |
| double | a1, | ||
| double | a2, | ||
| double | cn | ||
| ) | [static, private] |
Get the vD value of equation (32) in Fu & Li 1993, Genetics, 133 pp693-709)
| n | the number of observed sequences |
| a1 | as describe in getUsefullValues |
| a2 | as describe in getUsefullValues |
| cn | as describe in getUsefullValues |
Definition at line 1677 of file SequenceStatistics.cpp.
| double SequenceStatistics::getVDstar_ | ( | size_t | n, |
| double | a1, | ||
| double | a2, | ||
| double | dn | ||
| ) | [static, private] |
Get the vD* value of D* equation in Fu & Li 1993, Genetics, 133 pp693-709)
| n | the number of observed sequences |
| a1 | as describe in getUsefullValues |
| a2 | as describe in getUsefullValues |
| dn | as describe in getUsefullValues |
Definition at line 1691 of file SequenceStatistics.cpp.
| double SequenceStatistics::heterozygosity | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true |
||
| ) | [static] |
Compute the sum of per site heterozygosity in an alignment.
| psc | a PolymorphismSequenceContainer |
| gapflag | a boolean set by default to true if you don't want to take gap into account |
Definition at line 198 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| double SequenceStatistics::hudson87 | ( | const PolymorphismSequenceContainer & | psc, |
| double | precision = 0.000001, |
||
| double | cinf = 0.001, |
||
| double | csup = 10000. |
||
| ) | [static] |
give estimate of C=4Nr using Hudson method (Hudson 1987, Genet. Res., 50 pp245-250)
| psc | a PolymorphismSequenceContainer |
| precision | default value = 0.000001 |
| cinf | initial value, by default cinf=0.001 |
| csup | initial value, by default csup = 10000 |
Definition at line 1521 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences().
| double SequenceStatistics::inverseRegressionR2 | ( | const PolymorphismSequenceContainer & | psc, |
| bool | distance1 = false, |
||
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give the slope of the regression R² = 1/(1+a*distance)
To fit the theoretical prediction R² = 1/(1+4Nr) The slope is given in R² per kb
| psc | a PolymorphismSequenceContainer |
| distance1 | a boolean (true to use distance1, false to use distance2, false by default) |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites or the number of sequences is lower than 2 |
Definition at line 1497 of file SequenceStatistics.cpp.
| double SequenceStatistics::leftHandHudson_ | ( | const PolymorphismSequenceContainer & | psc | ) | [static, private] |
give the left hand term of equation (4) in Hudson (Hudson 1987, Genet. Res., 50 pp245-250) This term is used in hudson87
| psc | a PolymorphismSequenceContainer |
Definition at line 1734 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences().
| Vdouble SequenceStatistics::linearRegressionD | ( | const PolymorphismSequenceContainer & | psc, |
| bool | distance1 = false, |
||
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give the slope and the origin of the regression |D| = a*distance+b
The slope is given in |D| per kb
| psc | a PolymorphismSequenceContainer |
| distance1 | a boolean (true to use distance1, false to use distance2, false by default) |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites or the number of sequences is lower than 2 |
Definition at line 1434 of file SequenceStatistics.cpp.
| Vdouble SequenceStatistics::linearRegressionDprime | ( | const PolymorphismSequenceContainer & | psc, |
| bool | distance1 = false, |
||
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give the slope and the origin of the regression |D'| = a*distance+b
The slope is given in |D'| per kb
| psc | a PolymorphismSequenceContainer |
| distance1 | a boolean (true to use distance1, false to use distance2, false by default) |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites or the number of sequences is lower than 2 |
Definition at line 1455 of file SequenceStatistics.cpp.
| Vdouble SequenceStatistics::linearRegressionR2 | ( | const PolymorphismSequenceContainer & | psc, |
| bool | distance1 = false, |
||
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give the slope and the origin of the regression R² = a*distance+b
The slope is given in R² per kb
| psc | a PolymorphismSequenceContainer |
| distance1 | a boolean (true to use distance1, false to use distance2, false by default) |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites or the number of sequences is lower than 2 |
Definition at line 1476 of file SequenceStatistics.cpp.
| double SequenceStatistics::meanD | ( | const PolymorphismSequenceContainer & | psc, |
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give mean D over all pairwise comparisons
| psc | a PolymorphismSequenceContainer |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites or the number of sequences is lower than 2 |
Definition at line 1318 of file SequenceStatistics.cpp.
| double SequenceStatistics::meanDistance1 | ( | const PolymorphismSequenceContainer & | psc, |
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give mean pairwise distances between sites / method 1: differences between sequences are not taken into account
| psc | a PolymorphismSequenceContainer |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites is lower than 2 |
Definition at line 1350 of file SequenceStatistics.cpp.
| double SequenceStatistics::meanDistance2 | ( | const PolymorphismSequenceContainer & | psc, |
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give mean pairwise distances between sites / method 2: differences between sequences are taken into account
| psc | a PolymorphismSequenceContainer |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites is lower than 2 |
Definition at line 1363 of file SequenceStatistics.cpp.
| double SequenceStatistics::meanDprime | ( | const PolymorphismSequenceContainer & | psc, |
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give mean D' over all pairwise comparisons
| psc | a PolymorphismSequenceContainer |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites or the number of sequences is lower than 2 |
Definition at line 1324 of file SequenceStatistics.cpp.
| double SequenceStatistics::meanNonSynonymousSitesNumber | ( | const PolymorphismSequenceContainer & | psc, |
| const GeneticCode & | gc, | ||
| double | ratio = 1. |
||
| ) | [static] |
compute the mean number of non-synonymous site in an alignment
A site is x% synonymous if x% of possible mutations are synonymous The transition/transversion can be taken into account (use the variable ratio). Gaps are automatically excluded
| psc | a PolymorphismSequenceContainer |
| gc | a GeneticCode |
| ratio | a double |
Definition at line 706 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| double SequenceStatistics::meanR2 | ( | const PolymorphismSequenceContainer & | psc, |
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give mean R² over all pairwise comparisons
| psc | a PolymorphismSequenceContainer |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites or the number of sequences is lower than 2 |
Definition at line 1337 of file SequenceStatistics.cpp.
| double SequenceStatistics::meanSynonymousSitesNumber | ( | const PolymorphismSequenceContainer & | psc, |
| const GeneticCode & | gc, | ||
| double | ratio = 1. |
||
| ) | [static] |
compute the mean number of synonymous site in an alignment
A site is x% synonymous if x% of possible mutations are synonymous. The transition/transversion can be taken into account (use the variable ratio). Gaps and unresolved sites are automatically excluded.
| psc | a PolymorphismSequenceContainer |
| gc | a GeneticCode |
| ratio | a double |
Definition at line 692 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| vector< size_t > SequenceStatistics::MKtable | ( | const PolymorphismSequenceContainer & | ingroup, |
| const PolymorphismSequenceContainer & | outgroup, | ||
| const GeneticCode & | gc, | ||
| double | freqmin = 0. |
||
| ) | [static] |
return a vector containing Pa, Ps, Da, Ds
Gaps and unresolved sites are automatically excluded
| ingroup | a PolymorphismSequenceContainer |
| outgroup | a PolymorphismSequenceContainer |
| gc | a GeneticCode |
| freqmin | a double, to exclude snp in frequency strictly lower than freqmin |
Definition at line 779 of file SequenceStatistics.cpp.
References bpp::PolymorphismSequenceContainer::addSequence(), bpp::VectorSiteContainer::getAlphabet(), bpp::VectorSiteContainer::getNumberOfSequences(), bpp::VectorSiteContainer::getSequence(), and bpp::PolymorphismSequenceContainer::setAsOutgroupMember().
| size_t SequenceStatistics::monoSitePolymorphicCodonNumber | ( | const PolymorphismSequenceContainer & | psc, |
| bool | stopflag = true, |
||
| bool | gapflag = true |
||
| ) | [static] |
Compute the number of polymorphic codon with only one mutated site.
| psc | a PolymorphismSequenceContainer |
| stopflag | a boolean set by default to true if you don't want to take stop codon neither undefined sites into account |
| gapflag | a boolean set by default to true if you don't want to take gaps into account |
Definition at line 605 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| double SequenceStatistics::neutralityIndex | ( | const PolymorphismSequenceContainer & | ingroup, |
| const PolymorphismSequenceContainer & | outgroup, | ||
| const GeneticCode & | gc, | ||
| double | freqmin = 0. |
||
| ) | [static] |
return the neutrality index NI = (Pa/Ps)/(Da/Ds) (Rand & Kann 1996, Mol. Biol. Evol. 13 pp735-748)
Return -1 if Ps or Da are zero Gaps and unresolved sites are automatically excluded
| ingroup | a PolymorphismSequenceContainer |
| outgroup | a PolymorphismSequenceContainer |
| gc | a GeneticCode |
| freqmin | a double, to exclude snp in frequency strictly lower than freqmin |
Definition at line 825 of file SequenceStatistics.cpp.
| size_t SequenceStatistics::nonSynonymousSubstitutionsNumber | ( | const PolymorphismSequenceContainer & | psc, |
| const GeneticCode & | gc, | ||
| double | freqmin = 0. |
||
| ) | [static] |
compute the number of non synonymous subsitutions in an alignment
Gaps and unresolved sites are automatically excluded
In case of complex codon, the path that gives the minimum number of non-synonymous changes is chosen. The argument minchange=true is sent to numberOfSynonymousDifferences used in this method. Otherwise, a non-integer number could be return.
| psc | a PolymorphismSequenceContainer |
| gc | a GeneticCode |
| freqmin | a double, to exclude snp in frequency strictly lower than freqmin |
Definition at line 737 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| double SequenceStatistics::originRegressionD | ( | const PolymorphismSequenceContainer & | psc, |
| bool | distance1 = false, |
||
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give the slope of the regression |D| = 1+a*distance
The slope is given in |D| per kb
| psc | a PolymorphismSequenceContainer |
| distance1 | a boolean (true to use distance1, false to use distance2, false by default) |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites or the number of sequences is lower than 2 |
Definition at line 1380 of file SequenceStatistics.cpp.
| double SequenceStatistics::originRegressionDprime | ( | const PolymorphismSequenceContainer & | psc, |
| bool | distance1 = false, |
||
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give the slope of the regression |D'| = 1+a*distance
The slope is given in |D'| per kb
| psc | a PolymorphismSequenceContainer |
| distance1 | a boolean (true to use distance1, false to use distance2, false by default) |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites or the number of sequences is lower than 2 |
Definition at line 1398 of file SequenceStatistics.cpp.
| double SequenceStatistics::originRegressionR2 | ( | const PolymorphismSequenceContainer & | psc, |
| bool | distance1 = false, |
||
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give the slope of the regression R² = 1+a*distance
The slope is given in R² per kb
| psc | a PolymorphismSequenceContainer |
| distance1 | a boolean (true to use distance1, false to use distance2, false by default) |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites or the number of sequences is lower than 2 |
Definition at line 1416 of file SequenceStatistics.cpp.
| Vdouble SequenceStatistics::pairwiseD | ( | const PolymorphismSequenceContainer & | psc, |
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give the vector of all mean pairwise D value between two sites (Lewontin & Kojima 1964, Evolution 14 pp458-472)
| psc | a PolymorphismSequenceContainer |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites or the number of sequences is lower than 2 |
Definition at line 1191 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences(), bpp::VectorSiteContainer::getNumberOfSites(), bpp::VectorSiteContainer::getSite(), and bpp::Site::getValue().
| Vdouble SequenceStatistics::pairwiseDistances1 | ( | const PolymorphismSequenceContainer & | psc, |
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give the vector of the pairwise distances between site positions corresponding to a LD SequencePolymorphismContainer
Assume that all sequences have the same length
| psc | a PolymorphismSequenceContainer |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites is lower than 2 |
Definition at line 1057 of file SequenceStatistics.cpp.
References bpp::Site::getAlphabet(), and bpp::Alphabet::getSize().
| Vdouble SequenceStatistics::pairwiseDistances2 | ( | const PolymorphismSequenceContainer & | psc, |
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give the vector of all mean pairwise distance between two sites to a LD SequencePolymorphismContainer
pairwise distances are computed for each sequence separately, excluding gaps. Then the mean is taken over all the sequences.
| psc | a PolymorphismSequenceContainer |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites is lower than 2 |
Definition at line 1113 of file SequenceStatistics.cpp.
References bpp::Site::getAlphabet(), bpp::Alphabet::getSize(), and bpp::Sequence::getValue().
| Vdouble SequenceStatistics::pairwiseDprime | ( | const PolymorphismSequenceContainer & | psc, |
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give the vector of all mean pairwise D' value between two sites (Lewontin 1964, Genetics 49 pp49-67))
| psc | a PolymorphismSequenceContainer |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites or the number of sequences is lower than 2 |
Definition at line 1224 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences(), bpp::VectorSiteContainer::getNumberOfSites(), bpp::VectorSiteContainer::getSite(), and bpp::Site::getValue().
| Vdouble SequenceStatistics::pairwiseR2 | ( | const PolymorphismSequenceContainer & | psc, |
| bool | keepsingleton = true, |
||
| double | freqmin = 0. |
||
| ) | throw (DimensionException) [static] |
give the vector of all mean pairwise R² value between two sites (Hill & Robertson 1968, Theor. Appl. Genet., 38 pp226-231)
| psc | a PolymorphismSequenceContainer |
| keepsingleton | a boolean (true by default, false to exclude singleton) |
| freqmin | a float (to exlude site with the lowest allele frequency less than the threshold given by freqmin, 0 by default) |
| DimensionException | if the number of sites or the number of sequences is lower than 2 |
Definition at line 1280 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences(), bpp::VectorSiteContainer::getNumberOfSites(), bpp::VectorSiteContainer::getSite(), and bpp::Site::getValue().
| size_t SequenceStatistics::parsimonyInformativeSiteNumber | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true |
||
| ) | [static] |
Compute the number of parsimony informative sites in an alignment.
| psc | a PolymorphicSequenceContainer |
| gapflag | a boolean set by default to true if you don't want to take gap into account |
Definition at line 93 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| double SequenceStatistics::piNonSynonymous | ( | const PolymorphismSequenceContainer & | psc, |
| const GeneticCode & | gc, | ||
| bool | minchange = false |
||
| ) | [static] |
Compute the non-synonymous nucleotide diversity, pi.
Gaps and unresolved sites are automatically excluded If minchange = false (default option) the different paths are equally weighted. If minchange = true the path with the minimum number of non-synonymous change is chosen.
| psc | a PolymorphismSequenceContainer |
| gc | a GeneticCode |
| minchange | a boolean set by default to false |
Definition at line 678 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| double SequenceStatistics::piSynonymous | ( | const PolymorphismSequenceContainer & | psc, |
| const GeneticCode & | gc, | ||
| bool | minchange = false |
||
| ) | [static] |
Compute the synonymous nucleotide diversity, pi.
Gaps and unresolved sites are automatically excluded If minchange = false (default option) the different paths are equally weighted. If minchange = true the path with the minimum number of non-synonymous change is chosen.
| psc | a PolymorphismSequenceContainer |
| gc | a GeneticCode |
| minchange | a boolean set to false |
Definition at line 664 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| size_t SequenceStatistics::polymorphicSiteNumber | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true, |
||
| bool | ignoreUnknown = true |
||
| ) | [static] |
Compute the number of polymorphic site in an alignment.
The number of polymorphic site is also known as the number of segregating site
.
Gaps are consider as mutations so if you want number of polymorphic site without gap, set the gapflag parameter to true.
| psc | a PolymorphismSequenceContainer |
| gapflag | a boolean set by default to true if you don't want to take gap into account |
| ignoreUnknown | a boolean set by default to true to ignore unknown states |
Definition at line 72 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| double SequenceStatistics::rightHandHudson_ | ( | double | c, |
| size_t | n | ||
| ) | [static, private] |
give the right hand term of equation (4) in Hudson (Hudson 1987, Genet. Res., 50 pp245-250) This term is used in hudson87
Definition at line 1760 of file SequenceStatistics.cpp.
| double SequenceStatistics::squaredHeterozygosity | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true |
||
| ) | [static] |
Compute the sum of per site squared heterozygosity in an alignment.
| psc | a PolymorphismSequenceContainer |
| gapflag | a boolean set by default to true if you don't want to take gap into account |
Definition at line 216 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| size_t SequenceStatistics::stopCodonSiteNumber | ( | const PolymorphismSequenceContainer & | psc, |
| const GeneticCode & | gCode, | ||
| bool | gapflag = true |
||
| ) | [static] |
Compute the number of codon sites with stop codon.
| psc | a PolymorphismSequenceContainer |
| gCode | the genetic code to use |
| gapflag | a boolean set by default to true if you don't want to take gaps into account |
Definition at line 579 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getAlphabet().
| size_t SequenceStatistics::synonymousPolymorphicCodonNumber | ( | const PolymorphismSequenceContainer & | psc, |
| const GeneticCode & | gc | ||
| ) | [static] |
Compute the number of synonymous polymorphic codon sites.
Gaps and unresolved sites are automatically excluded
| psc | a PolymorphismSequenceContainer |
| gc | a GeneticCode |
Definition at line 629 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| size_t SequenceStatistics::synonymousSubstitutionsNumber | ( | const PolymorphismSequenceContainer & | psc, |
| const GeneticCode & | gc, | ||
| double | freqmin = 0. |
||
| ) | [static] |
compute the number of synonymous subsitutions in an alignment
Gaps and unresolved sites are automatically excluded
In case of complex codon, the path that gives the minimum number of non-synonymous changes is chosen. The argument minchange=true is sent to numberOfSynonymousDifferences used in this method. Otherwise, a non-integer number could be return.
| psc | a PolymorphismSequenceContainer |
| gc | a GeneticCode |
| freqmin | a double, to exclude snp in frequency strictly lower than freqmin |
Definition at line 722 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| double SequenceStatistics::tajima83 | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true |
||
| ) | [static] |
Compute diversity estimator Theta of Tajima (1983, Genetics, 105 pp437-460)
where
is the count of the jth state at the ith site,
the number of nucleotides and
the number of polymorphic sites.
| psc | a PolymorphismSequenceContainer |
| gapflag | flag set by default to true if you don't want to take gap into account |
Definition at line 299 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getAlphabet(), bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| double SequenceStatistics::tajimaDSS | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true |
||
| ) | throw (ZeroDivisionException) [static] |
Return the Tajima's D test (Tajima 1989, Genetics 123 pp 585-595).
Calculation using the number of polymorphic (segregating) sites.
| psc | a PolymorphismSequenceContainer |
| gapflag | flag set by default to true if you don't want to take gap into account |
| ZeroDivisionException | if S == 0 |
Definition at line 838 of file SequenceStatistics.cpp.
| double SequenceStatistics::tajimaDTNM | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true |
||
| ) | throw (ZeroDivisionException) [static] |
Return the Tajima's D test (Tajima 1989, Genetics 123 pp 585-595).
Calculation using the total number of mutation.
| psc | a PolymorphismSequenceContainer |
| gapflag | flag set by default to true if you don't want to take gap into account |
| ZeroDivisionException | if eta == 0 |
Definition at line 852 of file SequenceStatistics.cpp.
| void SequenceStatistics::testUsefullValues | ( | std::ostream & | s, |
| size_t | n | ||
| ) | [static] |
Test usefull values.
| s | a ostream where write the values |
| n | then number of observed sequences |
Definition at line 1549 of file SequenceStatistics.cpp.
| size_t SequenceStatistics::totMutationsExternalBranchs | ( | const PolymorphismSequenceContainer & | ing, |
| const PolymorphismSequenceContainer & | outg | ||
| ) | throw (Exception) [static] |
Count the total number of mutations in external branchs.
This is counted as the number of distinct singleton nucleotide in the ingroup that are not shared with the outgroup. A site is ignored if it contains more than one variant in the outgroup. A site is ignored if it contains unresolved variants or gaps.
| ing | a PolymorphismSequenceContainer the ingroup alignement |
| outg | a PolymorphismSequenceContainer the outgroup alignement |
| Exception | if ing and outg are not of the same size (site number) |
Definition at line 172 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| size_t SequenceStatistics::totNumberMutations | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true |
||
| ) | [static] |
Count the total number of mutations in an alignment.
This count is assumed to be under an infinite site model.
| psc | a PolymorphismSequenceContainer |
| gapflag | a boolean set by default to true if you don't want to take gap into account |
Definition at line 154 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| size_t SequenceStatistics::tripletNumber | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true |
||
| ) | [static] |
Compute the number of triplet in an alignment.
| psc | a PolymorphismSequenceContainer |
| gapflag | a boolean set by default to true if you don't want to take gap into account |
Definition at line 132 of file SequenceStatistics.cpp.
References bpp::ConstSiteIterator::hasMoreSites(), and bpp::ConstSiteIterator::nextSite().
| double SequenceStatistics::watterson75 | ( | const PolymorphismSequenceContainer & | psc, |
| bool | gapflag = true, |
||
| bool | ignoreUnknown = true |
||
| ) | [static] |
Compute diversity estimator Theta of Watterson (1975, Theor Popul Biol, 7 pp256-276)
where
is the number of polymorphic sites and
is describe in SequenceStatistics::_getUsefullValues().
| psc | a PolymorphismSequenceContainer |
| gapflag | flag set by default to true if you don't want to take gap into account |
| ignoreUnknown | a boolean set by default to true to ignore unknown states |
Definition at line 289 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences().
| double SequenceStatistics::watterson75NonSynonymous | ( | const PolymorphismSequenceContainer & | psc, |
| const GeneticCode & | gc | ||
| ) | [static] |
Compute the Watterson(1975, Theor Popul Biol, 7 pp256-276) estimator for non synonymous positions.
Gaps and unresolved sites are automatically excluded
In case of complex codon, the path that gives the minimum number of non-synonymous changes is chosen. The argument minchange=true is sent to numberOfSynonymousDifferences used in this method. Otherwise, a non-integer number could be return.
| psc | a PolymorphismSequenceContainer |
| gc | a GeneticCode |
Definition at line 654 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences().
| double SequenceStatistics::watterson75Synonymous | ( | const PolymorphismSequenceContainer & | psc, |
| const GeneticCode & | gc | ||
| ) | [static] |
Compute the Watterson(1975,Theor Popul Biol, 7 pp256-276) estimator for synonymous positions.
Gaps and unresolved sites are automatically excluded
In case of complex codon, the path that gives the minimum number of non-synonymous changes* is chosen. The argument minchange=true is sent to numberOfSynonymousDifferences used in this method. Otherwise, a non-integer number could be return.
| psc | a PolymorphismSequenceContainer |
| gc | a GeneticCode |
Definition at line 644 of file SequenceStatistics.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences().