bpp-phyl
2.2.0
|
the Frequencies in codons are the product of the frequencies for a unique FrequenciesSet in letters, with the frequencies of stop codons set to zero. More...
#include <Bpp/Phyl/Model/FrequenciesSet/CodonFrequenciesSet.h>
Public Member Functions | |
CodonFromUniqueFrequenciesSet (const GeneticCode *gCode, FrequenciesSet *pfreq, const std::string &name="Codon", const std::string &mgmtStopFreq="quadratic") | |
Constructor from a CodonAlphabet* and a FrequenciesSet* repeated three times. More... | |
CodonFromUniqueFrequenciesSet (const CodonFromUniqueFrequenciesSet &iwfs) | |
virtual | ~CodonFromUniqueFrequenciesSet () |
CodonFromUniqueFrequenciesSet & | operator= (const CodonFromUniqueFrequenciesSet &iwfs) |
CodonFromUniqueFrequenciesSet * | clone () const |
const CodonAlphabet * | getAlphabet () const |
const GeneticCode * | getGeneticCode () const |
void | updateFrequencies () |
Update the frequencies given the parameters. More... | |
virtual const StateMap & | getStateMap () const =0 |
virtual const std::vector< double > | getFrequencies () const =0 |
virtual const std::map< int, double > | getAlphabetStatesFrequencies () const =0 |
virtual void | setFrequencies (const std::vector< double > &frequencies)=0 |
Set the parameters in order to match a given set of frequencies. More... | |
virtual void | setFrequenciesFromAlphabetStatesFrequencies (const std::map< int, double > &frequencies)=0 |
Set the Frequencies from the one of the map which keys match with a letter of the Alphabet. The frequencies are normalized so that the matching values sum 1. More... | |
virtual std::string | getName () const =0 |
virtual size_t | getNumberOfFrequencies () const =0 |
virtual void | fireParameterChanged (const ParameterList &pl) |
virtual void | setFrequencies (const std::vector< double > &frequencies) |
const FrequenciesSet & | getFrequenciesSetForLetter (size_t i) const |
size_t | getLength () const |
void | setNamespace (const std::string &prefix) |
std::string | getDescription () const |
const StateMap & | getStateMap () const |
const std::vector< double > | getFrequencies () const |
const std::map< int, double > | getAlphabetStatesFrequencies () const |
void | setFrequenciesFromAlphabetStatesFrequencies (const std::map< int, double > &frequencies) |
Set the Frequencies from the one of the map which keys match with a letter of the Alphabet. The frequencies are normalized so that the matching values sum 1. More... | |
std::string | getName () const |
size_t | getNumberOfFrequencies () const |
void | normalize () |
Static Public Member Functions | |
static FrequenciesSet * | getFrequenciesSetForCodons (short option, const GeneticCode *gCode, const std::string &mgmtStopFreq="quadratic", unsigned short method=1) |
A helper function that provide frequencies set for codon models according to PAML option. More... | |
Static Public Attributes | |
static const short | F0 = 0 |
static const short | F1X4 = 1 |
static const short | F3X4 = 2 |
static const short | F61 = 3 |
static IntervalConstraint | FREQUENCE_CONSTRAINT_SMALL |
static IntervalConstraint | FREQUENCE_CONSTRAINT_MILLI |
Protected Member Functions | |
size_t | getSizeFromVector (const std::vector< FrequenciesSet *> &freqVector) |
std::vector< double > & | getFrequencies_ () |
double & | getFreq_ (size_t i) |
const double & | getFreq_ (size_t i) const |
void | setFrequencies_ (const std::vector< double > &frequencies) |
Protected Attributes | |
FrequenciesSet * | pFreq_ |
std::string | NestedPrefix_ |
size_t | length_ |
Private Attributes | |
std::map< int, Vint > | mStopNeigh_ |
unsigned short | mgmtStopFreq_ |
const GeneticCode * | pgc_ |
the Frequencies in codons are the product of the frequencies for a unique FrequenciesSet in letters, with the frequencies of stop codons set to zero.
Definition at line 399 of file CodonFrequenciesSet.h.
CodonFromUniqueFrequenciesSet::CodonFromUniqueFrequenciesSet | ( | const GeneticCode * | gCode, |
FrequenciesSet * | pfreq, | ||
const std::string & | name = "Codon" , |
||
const std::string & | mgmtStopFreq = "quadratic" |
||
) |
Constructor from a CodonAlphabet* and a FrequenciesSet* repeated three times.
gCode | a pointer to a genetic code. |
pfreq | a pointer to the nucleotidic FrequenciesSet |
name | the optional name of the FrequenciesSet (default codon) |
mgmtStopFreq | the optional way the frequencies assigned to the stop codons are redistributed to the other codons. The available values are:
|
Definition at line 500 of file CodonFrequenciesSet.cpp.
References getAlphabet(), mgmtStopFreq_, mStopNeigh_, pgc_, and updateFrequencies().
Referenced by clone().
CodonFromUniqueFrequenciesSet::CodonFromUniqueFrequenciesSet | ( | const CodonFromUniqueFrequenciesSet & | iwfs | ) |
Definition at line 544 of file CodonFrequenciesSet.cpp.
References updateFrequencies().
|
inlinevirtual |
Definition at line 438 of file CodonFrequenciesSet.h.
|
inlinevirtual |
Implements bpp::CodonFrequenciesSet.
Definition at line 442 of file CodonFrequenciesSet.h.
References CodonFromUniqueFrequenciesSet().
|
virtualinherited |
Definition at line 306 of file WordFrequenciesSet.cpp.
References bpp::WordFromUniqueFrequenciesSet::pFreq_, and bpp::WordFromUniqueFrequenciesSet::updateFrequencies().
|
virtual |
Implements bpp::CodonFrequenciesSet.
Definition at line 538 of file CodonFrequenciesSet.cpp.
References bpp::AbstractWordFrequenciesSet::getAlphabet().
Referenced by CodonFromUniqueFrequenciesSet(), and updateFrequencies().
|
pure virtualinherited |
Implemented in bpp::AbstractFrequenciesSet.
Referenced by bpp::CodonDistanceFitnessPhaseFrequenciesSubstitutionModel::setFreq().
|
virtualinherited |
Implements bpp::FrequenciesSet.
Definition at line 79 of file FrequenciesSet.cpp.
|
inherited |
Definition at line 390 of file WordFrequenciesSet.cpp.
References bpp::FrequenciesSet::getName(), bpp::AbstractFrequenciesSet::getName(), bpp::WordFromUniqueFrequenciesSet::length_, and bpp::WordFromUniqueFrequenciesSet::pFreq_.
|
inlineprotectedinherited |
Definition at line 203 of file FrequenciesSet.h.
References bpp::AbstractFrequenciesSet::freq_.
Referenced by bpp::GCFrequenciesSet::fireParameterChanged(), bpp::FullNucleotideFrequenciesSet::fireParameterChanged(), bpp::FixedCodonFrequenciesSet::FixedCodonFrequenciesSet(), bpp::FixedFrequenciesSet::FixedFrequenciesSet(), bpp::FullNucleotideFrequenciesSet::FullNucleotideFrequenciesSet(), bpp::GCFrequenciesSet::GCFrequenciesSet(), bpp::GCFrequenciesSet::setFrequencies(), bpp::FixedCodonFrequenciesSet::setFrequencies(), bpp::FullCodonFrequenciesSet::updateFreq_(), bpp::FullFrequenciesSet::updateFreq_(), bpp::MvaFrequenciesSet::updateFrequencies(), bpp::WordFromIndependentFrequenciesSet::updateFrequencies(), bpp::WordFromUniqueFrequenciesSet::updateFrequencies(), bpp::FullPerAACodonFrequenciesSet::updateFrequencies(), bpp::CodonFromIndependentFrequenciesSet::updateFrequencies(), and updateFrequencies().
|
inlineprotectedinherited |
Definition at line 204 of file FrequenciesSet.h.
References bpp::AbstractFrequenciesSet::freq_.
|
pure virtualinherited |
Implemented in bpp::AbstractFrequenciesSet.
Referenced by bpp::AbstractCodonPhaseFrequenciesSubstitutionModel::AbstractCodonPhaseFrequenciesSubstitutionModel(), bpp::DSO78::DSO78(), bpp::LG08::fireParameterChanged(), bpp::DSO78::fireParameterChanged(), bpp::JTT92::fireParameterChanged(), bpp::WAG01::fireParameterChanged(), bpp::UserProteinSubstitutionModel::fireParameterChanged(), bpp::JCprot::fireParameterChanged(), bpp::MarkovModulatedFrequenciesSet::fireParameterChanged(), bpp::AbstractCodonFitnessSubstitutionModel::getCodonsMulRate(), bpp::AbstractCodonFrequenciesSubstitutionModel::getCodonsMulRate(), bpp::AbstractCodonPhaseFrequenciesSubstitutionModel::getCodonsMulRate(), bpp::JCprot::JCprot(), bpp::JTT92::JTT92(), bpp::LG08::LG08(), bpp::MarkovModulatedFrequenciesSet::MarkovModulatedFrequenciesSet(), bpp::WordFromUniqueFrequenciesSet::updateFrequencies(), bpp::UserProteinSubstitutionModel::UserProteinSubstitutionModel(), bpp::WAG01::WAG01(), and bpp::BppOFrequenciesSetFormat::write().
|
inlinevirtualinherited |
Implements bpp::FrequenciesSet.
Definition at line 174 of file FrequenciesSet.h.
References bpp::AbstractFrequenciesSet::freq_.
Referenced by bpp::MvaFrequenciesSet::updateFrequencies().
|
inlineprotectedinherited |
Definition at line 202 of file FrequenciesSet.h.
References bpp::AbstractFrequenciesSet::freq_.
|
staticinherited |
A helper function that provide frequencies set for codon models according to PAML option.
option | A code describing the option, one of F61, F1X4 or F3X4. |
gCode | The genetic code to use. The underlying codon alphabet object will be passed to the FrequenciesSet instance. |
mgmtStopFreq | the optional way the frequencies assigned to the stop codons are redistributed to the other codons, with F1X4 and F3X4 options. The available values are:
|
method | The parametrization used for F61. Default method is 1 (ie global ratio). |
Definition at line 623 of file CodonFrequenciesSet.cpp.
References bpp::CodonFrequenciesSet::F0, bpp::CodonFrequenciesSet::F1X4, bpp::CodonFrequenciesSet::F3X4, and bpp::CodonFrequenciesSet::F61.
Referenced by bpp::BppOFrequenciesSetFormat::read().
|
inlinevirtualinherited |
@ brief Return the n-th FrequenciesSet&
Implements bpp::WordFrequenciesSet.
Definition at line 230 of file WordFrequenciesSet.h.
References bpp::WordFromUniqueFrequenciesSet::pFreq_.
Referenced by bpp::BppOFrequenciesSetFormat::write().
|
inlinevirtual |
Implements bpp::CodonFrequenciesSet.
Definition at line 446 of file CodonFrequenciesSet.h.
References pgc_.
|
inlinevirtualinherited |
@ brief Return the length of the words
Reimplemented from bpp::AbstractWordFrequenciesSet.
Definition at line 232 of file WordFrequenciesSet.h.
References bpp::WordFromUniqueFrequenciesSet::length_.
Referenced by bpp::BppOFrequenciesSetFormat::write().
|
pure virtualinherited |
Implemented in bpp::AbstractFrequenciesSet.
Referenced by bpp::AbstractCodonFrequenciesSubstitutionModel::AbstractCodonFrequenciesSubstitutionModel(), bpp::AbstractCodonPhaseFrequenciesSubstitutionModel::AbstractCodonPhaseFrequenciesSubstitutionModel(), bpp::WordFromUniqueFrequenciesSet::getDescription(), bpp::PhylogeneticsApplicationTools::getRootFrequenciesSet(), bpp::BppOFrequenciesSetFormat::read(), and bpp::BppOFrequenciesSetFormat::write().
|
inlinevirtualinherited |
Implements bpp::FrequenciesSet.
Definition at line 191 of file FrequenciesSet.h.
References bpp::AbstractFrequenciesSet::name_.
Referenced by bpp::WordFromIndependentFrequenciesSet::getDescription(), and bpp::WordFromUniqueFrequenciesSet::getDescription().
|
pure virtualinherited |
Implemented in bpp::AbstractFrequenciesSet.
|
inlinevirtualinherited |
Implements bpp::FrequenciesSet.
Definition at line 189 of file FrequenciesSet.h.
References bpp::AbstractFrequenciesSet::freq_.
Referenced by bpp::FixedFrequenciesSet::setFrequencies().
|
protectedvirtualinherited |
Implements bpp::WordFrequenciesSet.
Definition at line 48 of file WordFrequenciesSet.cpp.
Referenced by bpp::WordFromIndependentFrequenciesSet::WordFromIndependentFrequenciesSet().
|
pure virtualinherited |
Implemented in bpp::AbstractFrequenciesSet.
|
inlinevirtualinherited |
Implements bpp::FrequenciesSet.
Definition at line 172 of file FrequenciesSet.h.
References bpp::AbstractFrequenciesSet::stateMap_.
Referenced by bpp::FullPerAACodonFrequenciesSet::updateFrequencies().
|
inlineinherited |
Definition at line 193 of file FrequenciesSet.h.
References bpp::AbstractFrequenciesSet::freq_.
Referenced by bpp::FullPerAACodonFrequenciesSet::updateFrequencies().
CodonFromUniqueFrequenciesSet & CodonFromUniqueFrequenciesSet::operator= | ( | const CodonFromUniqueFrequenciesSet & | iwfs | ) |
Definition at line 553 of file CodonFrequenciesSet.cpp.
References mgmtStopFreq_, mStopNeigh_, bpp::WordFromUniqueFrequenciesSet::operator=(), and pgc_.
|
pure virtualinherited |
Set the parameters in order to match a given set of frequencies.
frequencies | The set of frequencies to match. |
DimensionException | If the number of frequencies does not match the size of the alphabet. |
Exception | If the frequencies do not sum to 1. |
Implemented in bpp::FixedFrequenciesSet, bpp::FullPerAACodonFrequenciesSet, bpp::MarkovModulatedFrequenciesSet, bpp::FullFrequenciesSet, bpp::FixedCodonFrequenciesSet, bpp::WordFromUniqueFrequenciesSet, bpp::WordFromIndependentFrequenciesSet, bpp::FullNucleotideFrequenciesSet, bpp::FullCodonFrequenciesSet, bpp::MvaFrequenciesSet, and bpp::GCFrequenciesSet.
Referenced by bpp::AbstractCodonPhaseFrequenciesSubstitutionModel::AbstractCodonPhaseFrequenciesSubstitutionModel(), bpp::DSO78::DSO78(), bpp::BppOFrequenciesSetFormat::initialize_(), bpp::JCprot::JCprot(), bpp::JTT92::JTT92(), bpp::LG08::LG08(), bpp::LG08::setFreqFromData(), bpp::JTT92::setFreqFromData(), bpp::DSO78::setFreqFromData(), bpp::WAG01::setFreqFromData(), bpp::UserProteinSubstitutionModel::setFreqFromData(), bpp::JCprot::setFreqFromData(), bpp::WordFromUniqueFrequenciesSet::setFrequencies(), bpp::MarkovModulatedFrequenciesSet::setFrequencies(), bpp::UserProteinSubstitutionModel::UserProteinSubstitutionModel(), and bpp::WAG01::WAG01().
|
virtualinherited |
@ brief letter frequencies from given word frequencies. The frequencies of a letter at a position is the sum of the frequencies of the words that have this letter at this position. The frequencies of each letter is the average of the frequencies of that letter at all positions.
Implements bpp::FrequenciesSet.
Definition at line 334 of file WordFrequenciesSet.cpp.
References bpp::FrequenciesSet::getAlphabet(), bpp::AbstractWordFrequenciesSet::getAlphabet(), bpp::WordFromUniqueFrequenciesSet::length_, bpp::WordFromUniqueFrequenciesSet::pFreq_, bpp::FrequenciesSet::setFrequencies(), and bpp::WordFromUniqueFrequenciesSet::updateFrequencies().
|
inlineprotectedinherited |
Definition at line 205 of file FrequenciesSet.h.
References bpp::AbstractFrequenciesSet::freq_.
Referenced by bpp::MarkovModulatedFrequenciesSet::fireParameterChanged(), bpp::MarkovModulatedFrequenciesSet::MarkovModulatedFrequenciesSet(), bpp::FullNucleotideFrequenciesSet::setFrequencies(), bpp::FixedFrequenciesSet::setFrequencies(), and bpp::MvaFrequenciesSet::updateFrequencies().
|
pure virtualinherited |
Set the Frequencies from the one of the map which keys match with a letter of the Alphabet. The frequencies are normalized so that the matching values sum 1.
frequencies | The set of frequencies to match. |
Implemented in bpp::AbstractFrequenciesSet.
Referenced by bpp::BppOFrequenciesSetFormat::initialize_(), bpp::AbstractCodonFitnessSubstitutionModel::setFreq(), bpp::AbstractCodonFrequenciesSubstitutionModel::setFreq(), and bpp::AbstractCodonPhaseFrequenciesSubstitutionModel::setFreq().
|
virtualinherited |
Set the Frequencies from the one of the map which keys match with a letter of the Alphabet. The frequencies are normalized so that the matching values sum 1.
In this implementation, all model states with the same alphabet state are given the same frequency.
frequencies | The set of frequencies to match. |
Implements bpp::FrequenciesSet.
Definition at line 58 of file FrequenciesSet.cpp.
|
inherited |
Definition at line 378 of file WordFrequenciesSet.cpp.
References bpp::WordFromUniqueFrequenciesSet::length_, bpp::WordFromUniqueFrequenciesSet::NestedPrefix_, and bpp::WordFromUniqueFrequenciesSet::pFreq_.
|
virtual |
Update the frequencies given the parameters.
Reimplemented from bpp::WordFromUniqueFrequenciesSet.
Definition at line 562 of file CodonFrequenciesSet.cpp.
References getAlphabet(), bpp::AbstractFrequenciesSet::getFreq_(), mgmtStopFreq_, mStopNeigh_, pgc_, and bpp::WordFromUniqueFrequenciesSet::updateFrequencies().
Referenced by CodonFromUniqueFrequenciesSet().
|
staticinherited |
Definition at line 95 of file CodonFrequenciesSet.h.
Referenced by bpp::CodonFrequenciesSet::getFrequenciesSetForCodons(), and bpp::BppOFrequenciesSetFormat::read().
|
staticinherited |
Definition at line 96 of file CodonFrequenciesSet.h.
Referenced by bpp::CodonFrequenciesSet::getFrequenciesSetForCodons(), and bpp::BppOFrequenciesSetFormat::read().
|
staticinherited |
Definition at line 97 of file CodonFrequenciesSet.h.
Referenced by bpp::CodonFrequenciesSet::getFrequenciesSetForCodons(), and bpp::BppOFrequenciesSetFormat::read().
|
staticinherited |
Definition at line 98 of file CodonFrequenciesSet.h.
Referenced by bpp::CodonFrequenciesSet::getFrequenciesSetForCodons(), and bpp::BppOFrequenciesSetFormat::read().
|
staticinherited |
Definition at line 118 of file FrequenciesSet.h.
|
staticinherited |
Definition at line 117 of file FrequenciesSet.h.
Referenced by bpp::F84::F84(), bpp::FullNucleotideFrequenciesSet::FullNucleotideFrequenciesSet(), bpp::GTR::GTR(), bpp::HKY85::HKY85(), bpp::T92::T92(), and bpp::TN93::TN93().
|
protectedinherited |
Definition at line 196 of file WordFrequenciesSet.h.
Referenced by bpp::WordFromUniqueFrequenciesSet::getDescription(), bpp::WordFromUniqueFrequenciesSet::getLength(), bpp::WordFromUniqueFrequenciesSet::operator=(), bpp::WordFromUniqueFrequenciesSet::setFrequencies(), bpp::WordFromUniqueFrequenciesSet::setNamespace(), bpp::WordFromUniqueFrequenciesSet::updateFrequencies(), and bpp::WordFromUniqueFrequenciesSet::WordFromUniqueFrequenciesSet().
|
private |
Definition at line 407 of file CodonFrequenciesSet.h.
Referenced by CodonFromUniqueFrequenciesSet(), operator=(), and updateFrequencies().
|
private |
Definition at line 405 of file CodonFrequenciesSet.h.
Referenced by CodonFromUniqueFrequenciesSet(), operator=(), and updateFrequencies().
|
protectedinherited |
Definition at line 195 of file WordFrequenciesSet.h.
Referenced by bpp::WordFromUniqueFrequenciesSet::operator=(), bpp::WordFromUniqueFrequenciesSet::setNamespace(), and bpp::WordFromUniqueFrequenciesSet::WordFromUniqueFrequenciesSet().
|
protectedinherited |
Definition at line 194 of file WordFrequenciesSet.h.
Referenced by bpp::WordFromUniqueFrequenciesSet::fireParameterChanged(), bpp::WordFromUniqueFrequenciesSet::getDescription(), bpp::WordFromUniqueFrequenciesSet::getFrequenciesSetForLetter(), bpp::WordFromUniqueFrequenciesSet::operator=(), bpp::WordFromUniqueFrequenciesSet::setFrequencies(), bpp::WordFromUniqueFrequenciesSet::setNamespace(), bpp::WordFromUniqueFrequenciesSet::updateFrequencies(), bpp::WordFromUniqueFrequenciesSet::WordFromUniqueFrequenciesSet(), and bpp::WordFromUniqueFrequenciesSet::~WordFromUniqueFrequenciesSet().
|
private |
Definition at line 409 of file CodonFrequenciesSet.h.
Referenced by CodonFromUniqueFrequenciesSet(), getGeneticCode(), operator=(), and updateFrequencies().