bpp-phyl
2.2.0
|
the Frequencies in codons are the product of Independent Frequencies in letters with the frequencies of stop codons set to zero. More...
#include <Bpp/Phyl/Model/FrequenciesSet/CodonFrequenciesSet.h>
Public Member Functions | |
CodonFromIndependentFrequenciesSet (const GeneticCode *gCode, const std::vector< FrequenciesSet *> &freqvector, const std::string &name="Codon", const std::string &mgmtStopFreq="quadratic") | |
Constructor from a CodonAlphabet* and a vector of different FrequenciesSet*. Throws an Exception if their lengths do not match. More... | |
CodonFromIndependentFrequenciesSet (const CodonFromIndependentFrequenciesSet &iwfs) | |
virtual | ~CodonFromIndependentFrequenciesSet () |
CodonFromIndependentFrequenciesSet & | operator= (const CodonFromIndependentFrequenciesSet &iwfs) |
CodonFromIndependentFrequenciesSet * | clone () const |
const CodonAlphabet * | getAlphabet () const |
const GeneticCode * | getGeneticCode () const |
void | updateFrequencies () |
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 |
void | fireParameterChanged (const ParameterList &pl) |
virtual void | setFrequencies (const std::vector< double > &frequencies) |
const FrequenciesSet & | getFrequenciesSetForLetter (size_t i) const |
virtual 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 | |
std::vector< FrequenciesSet * > | vFreq_ |
std::vector< std::string > | vNestedPrefix_ |
Private Attributes | |
std::map< int, Vint > | mStopNeigh_ |
unsigned short | mgmtStopFreq_ |
const GeneticCode * | pgc_ |
the Frequencies in codons are the product of Independent Frequencies in letters with the frequencies of stop codons set to zero.
Definition at line 338 of file CodonFrequenciesSet.h.
CodonFromIndependentFrequenciesSet::CodonFromIndependentFrequenciesSet | ( | const GeneticCode * | gCode, |
const std::vector< FrequenciesSet *> & | freqvector, | ||
const std::string & | name = "Codon" , |
||
const std::string & | mgmtStopFreq = "quadratic" |
||
) |
Constructor from a CodonAlphabet* and a vector of different FrequenciesSet*. Throws an Exception if their lengths do not match.
gCode | a pointer to the genetic code to use. |
freqvector | a vector of pointers to the phase specific FrequenciesSets |
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 377 of file CodonFrequenciesSet.cpp.
References getAlphabet(), mgmtStopFreq_, mStopNeigh_, pgc_, and updateFrequencies().
Referenced by clone().
CodonFromIndependentFrequenciesSet::CodonFromIndependentFrequenciesSet | ( | const CodonFromIndependentFrequenciesSet & | iwfs | ) |
Definition at line 419 of file CodonFrequenciesSet.cpp.
References updateFrequencies().
|
inlinevirtual |
Definition at line 374 of file CodonFrequenciesSet.h.
|
inlinevirtual |
Implements bpp::CodonFrequenciesSet.
Definition at line 378 of file CodonFrequenciesSet.h.
References CodonFromIndependentFrequenciesSet().
|
inherited |
Definition at line 143 of file WordFrequenciesSet.cpp.
References bpp::WordFromIndependentFrequenciesSet::updateFrequencies(), and bpp::WordFromIndependentFrequenciesSet::vFreq_.
|
virtual |
Implements bpp::CodonFrequenciesSet.
Definition at line 414 of file CodonFrequenciesSet.cpp.
References bpp::AbstractWordFrequenciesSet::getAlphabet().
Referenced by CodonFromIndependentFrequenciesSet(), 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 239 of file WordFrequenciesSet.cpp.
References bpp::AbstractFrequenciesSet::getName(), and bpp::WordFromIndependentFrequenciesSet::vFreq_.
|
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(), updateFrequencies(), and bpp::CodonFromUniqueFrequenciesSet::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 177 of file WordFrequenciesSet.h.
References bpp::WordFromIndependentFrequenciesSet::vFreq_.
Referenced by bpp::BppOFrequenciesSetFormat::write().
|
inlinevirtual |
Implements bpp::CodonFrequenciesSet.
Definition at line 382 of file CodonFrequenciesSet.h.
References pgc_.
|
virtualinherited |
@ brief Return the length of the words
Reimplemented from bpp::AbstractWordFrequenciesSet.
Definition at line 225 of file WordFrequenciesSet.cpp.
References bpp::WordFromIndependentFrequenciesSet::vFreq_.
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().
CodonFromIndependentFrequenciesSet & CodonFromIndependentFrequenciesSet::operator= | ( | const CodonFromIndependentFrequenciesSet & | iwfs | ) |
Definition at line 428 of file CodonFrequenciesSet.cpp.
References mgmtStopFreq_, mStopNeigh_, bpp::WordFromIndependentFrequenciesSet::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 Independent 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.
Implements bpp::FrequenciesSet.
Definition at line 183 of file WordFrequenciesSet.cpp.
References bpp::AbstractWordFrequenciesSet::getAlphabet(), bpp::WordFromIndependentFrequenciesSet::updateFrequencies(), and bpp::WordFromIndependentFrequenciesSet::vFreq_.
|
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 230 of file WordFrequenciesSet.cpp.
References bpp::WordFromIndependentFrequenciesSet::vFreq_, and bpp::WordFromIndependentFrequenciesSet::vNestedPrefix_.
|
virtual |
@ brief Update the frequencies given the parameters.
Reimplemented from bpp::WordFromIndependentFrequenciesSet.
Definition at line 437 of file CodonFrequenciesSet.cpp.
References getAlphabet(), bpp::AbstractFrequenciesSet::getFreq_(), mgmtStopFreq_, mStopNeigh_, pgc_, and bpp::WordFromIndependentFrequenciesSet::updateFrequencies().
Referenced by CodonFromIndependentFrequenciesSet().
|
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().
|
private |
Definition at line 346 of file CodonFrequenciesSet.h.
Referenced by CodonFromIndependentFrequenciesSet(), operator=(), and updateFrequencies().
|
private |
Definition at line 344 of file CodonFrequenciesSet.h.
Referenced by CodonFromIndependentFrequenciesSet(), operator=(), and updateFrequencies().
|
private |
Definition at line 348 of file CodonFrequenciesSet.h.
Referenced by CodonFromIndependentFrequenciesSet(), getGeneticCode(), operator=(), and updateFrequencies().
|
protectedinherited |
Definition at line 143 of file WordFrequenciesSet.h.
Referenced by bpp::WordFromIndependentFrequenciesSet::fireParameterChanged(), bpp::WordFromIndependentFrequenciesSet::getDescription(), bpp::WordFromIndependentFrequenciesSet::getFrequenciesSetForLetter(), bpp::WordFromIndependentFrequenciesSet::getLength(), bpp::WordFromIndependentFrequenciesSet::operator=(), bpp::WordFromIndependentFrequenciesSet::setFrequencies(), bpp::WordFromIndependentFrequenciesSet::setNamespace(), bpp::WordFromIndependentFrequenciesSet::updateFrequencies(), bpp::WordFromIndependentFrequenciesSet::WordFromIndependentFrequenciesSet(), and bpp::WordFromIndependentFrequenciesSet::~WordFromIndependentFrequenciesSet().
|
protectedinherited |
Definition at line 144 of file WordFrequenciesSet.h.
Referenced by bpp::WordFromIndependentFrequenciesSet::operator=(), bpp::WordFromIndependentFrequenciesSet::setNamespace(), and bpp::WordFromIndependentFrequenciesSet::WordFromIndependentFrequenciesSet().