bpp-phyl3
3.0.0
|
the Frequencies in words are the product of Independent Frequencies in letters More...
#include <Bpp/Phyl/Model/FrequencySet/WordFrequencySet.h>
Public Member Functions | |
WordFromIndependentFrequencySet (std::shared_ptr< const WordAlphabet > pWA, std::vector< std::unique_ptr< FrequencySetInterface >> &freqVector, const std::string &prefix="", const std::string &name="WordFromIndependent") | |
Constructor from a WordAlphabet* and a vector of different std::shared_ptr<FrequencySet>. Throws an Exception if their lengths do not match. More... | |
WordFromIndependentFrequencySet (std::shared_ptr< const CodonAlphabet > pWA, std::vector< std::unique_ptr< FrequencySetInterface >> &freqVector, const std::string &prefix="", const std::string &name="WordFromIndependent") | |
WordFromIndependentFrequencySet (const WordFromIndependentFrequencySet &iwfs) | |
virtual | ~WordFromIndependentFrequencySet () |
WordFromIndependentFrequencySet & | operator= (const WordFromIndependentFrequencySet &iwfs) |
WordFromIndependentFrequencySet * | clone () const override |
void | fireParameterChanged (const ParameterList &pl) override |
virtual void | updateFrequencies () |
virtual void | setFrequencies (const std::vector< double > &frequencies) override |
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. More... | |
const FrequencySetInterface & | frequencySetForLetter (size_t i) const override |
Return the n-th FrequencySet&. More... | |
virtual size_t | getLength () const override |
Return the length of the words. More... | |
void | setNamespace (const std::string &prefix) override |
std::string | getDescription () const |
std::shared_ptr< const CoreWordAlphabet > | getWordAlphabet () const override |
virtual std::shared_ptr< const Alphabet > | getAlphabet () const =0 |
std::shared_ptr< const Alphabet > | getAlphabet () const override |
virtual const Alphabet & | alphabet () const =0 |
const Alphabet & | alphabet () const override |
virtual const StateMapInterface & | stateMap () const =0 |
const StateMapInterface & | stateMap () const override |
virtual std::shared_ptr< const StateMapInterface > | getStateMap () const =0 |
std::shared_ptr< const StateMapInterface > | getStateMap () const override |
virtual const Vdouble & | getFrequencies () const =0 |
const Vdouble & | getFrequencies () const override |
virtual const std::map< int, double > | getAlphabetStatesFrequencies () const =0 |
const std::map< int, double > | getAlphabetStatesFrequencies () const override |
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... | |
void | setFrequenciesFromAlphabetStatesFrequencies (const std::map< int, double > &frequencies) override |
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 |
std::string | getName () const override |
virtual size_t | getNumberOfFrequencies () const =0 |
size_t | getNumberOfFrequencies () const override |
virtual size_t | getNumberOfIndependentParameters () const=0 |
size_t | getNumberOfIndependentParameters () const |
virtual void | aliasParameters (const std::string &p1, const std::string &p2)=0 |
virtual void | aliasParameters (std::map< std::string, std::string > &unparsedParams, bool verbose)=0 |
void | aliasParameters (const std::string &p1, const std::string &p2) |
void | aliasParameters (std::map< std::string, std::string > &unparsedParams, bool verbose) |
virtual void | unaliasParameters (const std::string &p1, const std::string &p2)=0 |
void | unaliasParameters (const std::string &p1, const std::string &p2) |
virtual const ParameterList & | getIndependentParameters () const=0 |
const ParameterList & | getIndependentParameters () const |
virtual std::vector< std::string > | getAlias (const std::string &name) const=0 |
virtual std::vector< std::string > | getAlias (const std::string &name) const |
virtual std::map< std::string, std::string > | getAliases () const=0 |
virtual std::map< std::string, std::string > | getAliases () const |
virtual bool | hasParameter (const std::string &name) const=0 |
bool | hasParameter (const std::string &name) const override |
virtual const ParameterList & | getParameters () const=0 |
const ParameterList & | getParameters () const override |
virtual const Parameter & | parameter (const std::string &name) const=0 |
const Parameter & | parameter (const std::string &name) const override |
virtual double | getParameterValue (const std::string &name) const=0 |
double | getParameterValue (const std::string &name) const override |
virtual void | setAllParametersValues (const ParameterList ¶meters)=0 |
void | setAllParametersValues (const ParameterList ¶meters) override |
virtual void | setParameterValue (const std::string &name, double value)=0 |
void | setParameterValue (const std::string &name, double value) override |
virtual void | setParametersValues (const ParameterList ¶meters)=0 |
void | setParametersValues (const ParameterList ¶meters) override |
virtual bool | matchParametersValues (const ParameterList ¶meters)=0 |
bool | matchParametersValues (const ParameterList ¶meters) override |
virtual void | removeConstraint (const std::string &name)=0 |
void | removeConstraint (const std::string &name) override |
virtual void | setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint)=0 |
void | setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override |
virtual size_t | getNumberOfParameters () const=0 |
size_t | getNumberOfParameters () const override |
virtual std::string | getNamespace () const=0 |
std::string | getNamespace () const override |
virtual std::string | getParameterNameWithoutNamespace (const std::string &name) const=0 |
std::string | getParameterNameWithoutNamespace (const std::string &name) const override |
void | normalize () |
bool | hasIndependentParameter (const std::string &name) const |
ParameterList | getAliasedParameters (const ParameterList &pl) const |
ParameterList | getFromParameters (const ParameterList &pl) const |
std::string | getFrom (const std::string &name) const |
const std::shared_ptr< Parameter > & | getParameter (const std::string &name) const |
Static Public Attributes | |
static std::shared_ptr< IntervalConstraint > | FREQUENCE_CONSTRAINT_SMALL |
static std::shared_ptr< IntervalConstraint > | FREQUENCE_CONSTRAINT_MILLI |
static std::shared_ptr< IntervalConstraint > | FREQUENCE_CONSTRAINT_CENTI |
Protected Member Functions | |
size_t | getSizeFromVector (const std::vector< std::unique_ptr< FrequencySetInterface >> &freqVector) override |
virtual ParameterList & | getParameters_ ()=0 |
ParameterList & | getParameters_ () override |
std::vector< double > & | getFrequencies_ () |
double & | getFreq_ (size_t i) |
const double & | getFreq_ (size_t i) const |
void | setFrequencies_ (const std::vector< double > &frequencies) |
const std::shared_ptr< Parameter > & | getParameter (size_t i) const |
std::shared_ptr< Parameter > & | getParameter (size_t i) |
void | addParameter_ (Parameter *parameter) |
void | addParameters_ (const ParameterList ¶meters) |
void | shareParameter_ (const std::shared_ptr< Parameter > ¶meter) |
void | shareParameters_ (const ParameterList ¶meters) |
void | includeParameters_ (const ParameterList ¶meters) |
void | deleteParameter_ (size_t index) |
void | deleteParameter_ (std::string &name) |
void | deleteParameters_ (const std::vector< std::string > &names) |
void | resetParameters_ () |
Parameter & | getParameter_ (const std::string &name) |
Parameter & | getParameter_ (size_t index) |
const Parameter & | getParameter_ (size_t index) const |
Parameter & | getParameterWithNamespace_ (const std::string &name) |
const Parameter & | getParameterWithNamespace_ (const std::string &name) const |
Protected Attributes | |
std::vector< std::unique_ptr< FrequencySetInterface > > | vFreq_ |
std::vector< std::string > | vNestedPrefix_ |
Private Attributes | |
std::shared_ptr< const Alphabet > | alphabet_ |
std::shared_ptr< const StateMapInterface > | stateMap_ |
std::vector< double > | freq_ |
std::string | name_ |
ParameterList | independentParameters_ |
std::map< std::string, std::shared_ptr< AliasParameterListener > > | aliasListenersRegister_ |
ParameterList | parameters_ |
std::string | prefix_ |
the Frequencies in words are the product of Independent Frequencies in letters
Definition at line 91 of file WordFrequencySet.h.
WordFromIndependentFrequencySet::WordFromIndependentFrequencySet | ( | std::shared_ptr< const WordAlphabet > | pWA, |
std::vector< std::unique_ptr< FrequencySetInterface >> & | freqVector, | ||
const std::string & | prefix = "" , |
||
const std::string & | name = "WordFromIndependent" |
||
) |
Constructor from a WordAlphabet* and a vector of different std::shared_ptr<FrequencySet>. Throws an Exception if their lengths do not match.
Definition at line 41 of file WordFrequencySet.cpp.
References bpp::AbstractParameterAliasable::addParameters_(), bpp::AbstractParameterAliasable::getNamespace(), bpp::AbstractParameterAliasable::getParameters(), bpp::AbstractWordFrequencySet::getSizeFromVector(), bpp::TextTools::toString(), updateFrequencies(), vFreq_, and vNestedPrefix_.
Referenced by clone().
WordFromIndependentFrequencySet::WordFromIndependentFrequencySet | ( | std::shared_ptr< const CodonAlphabet > | pWA, |
std::vector< std::unique_ptr< FrequencySetInterface >> & | freqVector, | ||
const std::string & | prefix = "" , |
||
const std::string & | name = "WordFromIndependent" |
||
) |
Definition at line 69 of file WordFrequencySet.cpp.
References bpp::AbstractParameterAliasable::addParameters_(), bpp::AbstractParameterAliasable::getNamespace(), bpp::AbstractParameterAliasable::getParameters(), bpp::AbstractWordFrequencySet::getSizeFromVector(), bpp::TextTools::toString(), updateFrequencies(), vFreq_, and vNestedPrefix_.
WordFromIndependentFrequencySet::WordFromIndependentFrequencySet | ( | const WordFromIndependentFrequencySet & | iwfs | ) |
Definition at line 98 of file WordFrequencySet.cpp.
References updateFrequencies(), and vFreq_.
|
virtual |
Definition at line 110 of file WordFrequencySet.cpp.
|
pure virtualinherited |
Implemented in bpp::AbstractFrequencySet.
|
inlineoverridevirtualinherited |
Implements bpp::FrequencySetInterface.
Definition at line 142 of file FrequencySet.h.
References bpp::AbstractFrequencySet::alphabet_.
|
inlineoverridevirtual |
Implements bpp::AbstractWordFrequencySet.
Definition at line 121 of file WordFrequencySet.h.
References WordFromIndependentFrequencySet().
|
overridevirtual |
Reimplemented from bpp::AbstractParameterAliasable.
Definition at line 129 of file WordFrequencySet.cpp.
References updateFrequencies(), and vFreq_.
|
inlineoverridevirtual |
Return the n-th FrequencySet&.
Implements bpp::WordFrequencySetInterface.
Definition at line 142 of file WordFrequencySet.h.
References vFreq_.
|
pure virtualinherited |
Implemented in bpp::AbstractFrequencySet.
Referenced by bpp::UserCodonFrequencySet::getCodonAlphabet(), bpp::FixedNucleotideFrequencySet::getNucleicAlphabet(), bpp::UserNucleotideFrequencySet::getNucleicAlphabet(), bpp::FullProteinFrequencySet::getProteicAlphabet(), bpp::FixedProteinFrequencySet::getProteicAlphabet(), and bpp::UserProteinFrequencySet::getProteicAlphabet().
|
inlineoverridevirtualinherited |
Implements bpp::FrequencySetInterface.
Definition at line 140 of file FrequencySet.h.
References bpp::AbstractFrequencySet::alphabet_.
Referenced by bpp::FullCodonFrequencySet::getCodonAlphabet(), bpp::FixedCodonFrequencySet::getCodonAlphabet(), bpp::FullPerAACodonFrequencySet::getCodonAlphabet(), bpp::CodonFromIndependentFrequencySet::getCodonAlphabet(), bpp::GCFrequencySet::getNucleicAlphabet(), bpp::FullNucleotideFrequencySet::getNucleicAlphabet(), bpp::MvaFrequencySet::getProteicAlphabet(), bpp::AbstractWordFrequencySet::getWordAlphabet(), bpp::UserFrequencySet::readFromFile_(), bpp::FullCodonFrequencySet::setFrequencies(), and bpp::FullFrequencySet::updateFreq_().
|
pure virtualinherited |
Implemented in bpp::AbstractFrequencySet.
|
overridevirtualinherited |
Implements bpp::FrequencySetInterface.
Definition at line 57 of file FrequencySet.cpp.
std::string WordFromIndependentFrequencySet::getDescription | ( | ) | const |
Definition at line 225 of file WordFrequencySet.cpp.
References bpp::AbstractFrequencySet::getName(), and vFreq_.
|
inlineprotectedinherited |
Definition at line 179 of file FrequencySet.h.
References bpp::AbstractFrequencySet::freq_.
Referenced by bpp::GCFrequencySet::fireParameterChanged(), bpp::FullNucleotideFrequencySet::fireParameterChanged(), bpp::FixedCodonFrequencySet::FixedCodonFrequencySet(), bpp::FullNucleotideFrequencySet::FullNucleotideFrequencySet(), bpp::GCFrequencySet::GCFrequencySet(), bpp::UserFrequencySet::readFromFile_(), bpp::FixedCodonFrequencySet::setFrequencies(), bpp::UserCodonFrequencySet::setFrequencies(), bpp::GCFrequencySet::setFrequencies(), bpp::FullCodonFrequencySet::updateFreq_(), bpp::FullFrequencySet::updateFreq_(), bpp::MvaFrequencySet::updateFrequencies(), updateFrequencies(), bpp::WordFromUniqueFrequencySet::updateFrequencies(), bpp::CodonFromIndependentFrequencySet::updateFrequencies(), bpp::CodonFromUniqueFrequencySet::updateFrequencies(), and bpp::FullPerAACodonFrequencySet::updateFrequencies_().
|
inlineprotectedinherited |
Definition at line 180 of file FrequencySet.h.
References bpp::AbstractFrequencySet::freq_.
|
pure virtualinherited |
Implemented in bpp::AbstractFrequencySet.
Referenced by bpp::CodonDistanceFrequenciesSubstitutionModel::fireParameterChanged(), bpp::CodonDistancePhaseFrequenciesSubstitutionModel::fireParameterChanged(), bpp::AbstractCodonPhaseFrequenciesSubstitutionModel::getCodonsMulRate(), bpp::NonHomogeneousSubstitutionProcess::getRootFrequencies(), bpp::CodonDistanceFrequenciesSubstitutionModel::setFreq(), bpp::CodonDistancePhaseFrequenciesSubstitutionModel::setFreq(), bpp::DFPDistanceFrequenciesSubstitutionModel::setFreq(), and bpp::BppOFrequencySetFormat::writeFrequencySet().
|
inlineoverridevirtualinherited |
Implements bpp::FrequencySetInterface.
Definition at line 148 of file FrequencySet.h.
References bpp::AbstractFrequencySet::freq_.
Referenced by bpp::MvaFrequencySet::updateFrequencies().
|
inlineprotectedinherited |
Definition at line 178 of file FrequencySet.h.
References bpp::AbstractFrequencySet::freq_.
Referenced by bpp::UserFrequencySet::readFromFile_().
|
overridevirtual |
Return the length of the words.
Reimplemented from bpp::AbstractWordFrequencySet.
Definition at line 211 of file WordFrequencySet.cpp.
References vFreq_.
|
pure virtualinherited |
Implemented in bpp::AbstractFrequencySet.
Referenced by bpp::BppOFrequencySetFormat::writeFrequencySet().
|
inlineoverridevirtualinherited |
Implements bpp::FrequencySetInterface.
Definition at line 165 of file FrequencySet.h.
References bpp::AbstractFrequencySet::name_.
Referenced by getDescription(), and bpp::WordFromUniqueFrequencySet::getDescription().
|
pure virtualinherited |
Implemented in bpp::AbstractFrequencySet.
|
inlineoverridevirtualinherited |
Implements bpp::FrequencySetInterface.
Definition at line 163 of file FrequencySet.h.
References bpp::AbstractFrequencySet::freq_.
Referenced by bpp::FromModelFrequencySet::setFrequencies(), bpp::FixedFrequencySet::setFrequencies(), and bpp::UserFrequencySet::setFrequencies().
|
overrideprotectedvirtualinherited |
Implements bpp::WordFrequencySetInterface.
Definition at line 12 of file WordFrequencySet.cpp.
Referenced by WordFromIndependentFrequencySet().
|
pure virtualinherited |
Implemented in bpp::AbstractFrequencySet.
|
inlineoverridevirtualinherited |
Implements bpp::FrequencySetInterface.
Definition at line 146 of file FrequencySet.h.
References bpp::AbstractFrequencySet::stateMap_.
|
inlineoverridevirtualinherited |
Implements bpp::WordFrequencySetInterface.
Definition at line 72 of file WordFrequencySet.h.
References bpp::AbstractFrequencySet::getAlphabet().
Referenced by bpp::CodonFromUniqueFrequencySet::getCodonAlphabet(), bpp::AbstractWordFrequencySet::getLength(), setFrequencies(), bpp::WordFromUniqueFrequencySet::setFrequencies(), updateFrequencies(), and bpp::WordFromUniqueFrequencySet::updateFrequencies().
|
inlineinherited |
Definition at line 167 of file FrequencySet.h.
References bpp::AbstractFrequencySet::freq_.
Referenced by bpp::FullPerAACodonFrequencySet::updateFrequencies_().
WordFromIndependentFrequencySet & WordFromIndependentFrequencySet::operator= | ( | const WordFromIndependentFrequencySet & | iwfs | ) |
Definition at line 113 of file WordFrequencySet.cpp.
References bpp::AbstractWordFrequencySet::operator=(), updateFrequencies(), vFreq_, and vNestedPrefix_.
Referenced by bpp::CodonFromIndependentFrequencySet::operator=().
|
overridevirtual |
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::FrequencySetInterface.
Definition at line 169 of file WordFrequencySet.cpp.
References bpp::AbstractParameterAliasable::getParameters(), bpp::AbstractWordFrequencySet::getWordAlphabet(), bpp::AbstractParameterAliasable::matchParametersValues(), bpp::TextTools::toString(), updateFrequencies(), and vFreq_.
|
inlineprotectedinherited |
Definition at line 181 of file FrequencySet.h.
References bpp::AbstractFrequencySet::freq_.
Referenced by bpp::FromModelFrequencySet::fireParameterChanged(), bpp::MarkovModulatedFrequencySet::fireParameterChanged(), bpp::FixedFrequencySet::FixedFrequencySet(), bpp::FromModelFrequencySet::FromModelFrequencySet(), bpp::MarkovModulatedFrequencySet::MarkovModulatedFrequencySet(), bpp::FixedFrequencySet::setFrequencies(), bpp::UserFrequencySet::setFrequencies(), bpp::FullNucleotideFrequencySet::setFrequencies(), and bpp::MvaFrequencySet::updateFrequencies().
|
overridevirtualinherited |
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::FrequencySetInterface.
Definition at line 28 of file FrequencySet.cpp.
|
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::AbstractFrequencySet.
Referenced by bpp::BppOFrequencySetFormat::initialize_().
|
overridevirtual |
Reimplemented from bpp::AbstractParameterAliasable.
Definition at line 216 of file WordFrequencySet.cpp.
References bpp::AbstractParameterAliasable::setNamespace(), bpp::TextTools::toString(), vFreq_, and vNestedPrefix_.
|
pure virtualinherited |
Implemented in bpp::AbstractFrequencySet.
|
inlineoverridevirtualinherited |
Implements bpp::FrequencySetInterface.
Definition at line 144 of file FrequencySet.h.
References bpp::AbstractFrequencySet::stateMap_.
Referenced by bpp::FixedFrequencySet::FixedFrequencySet(), bpp::FullFrequencySet::FullFrequencySet(), bpp::FromModelFrequencySet::setFrequencies(), and bpp::FullPerAACodonFrequencySet::updateFrequencies_().
|
virtual |
Reimplemented in bpp::CodonFromIndependentFrequencySet.
Definition at line 143 of file WordFrequencySet.cpp.
References bpp::AbstractFrequencySet::getFreq_(), bpp::AbstractWordFrequencySet::getWordAlphabet(), and vFreq_.
Referenced by fireParameterChanged(), operator=(), setFrequencies(), bpp::CodonFromIndependentFrequencySet::updateFrequencies(), and WordFromIndependentFrequencySet().
|
privateinherited |
Definition at line 104 of file FrequencySet.h.
Referenced by bpp::AbstractFrequencySet::alphabet(), bpp::AbstractFrequencySet::getAlphabet(), and bpp::AbstractFrequencySet::operator=().
|
privateinherited |
Definition at line 106 of file FrequencySet.h.
Referenced by bpp::AbstractFrequencySet::getFreq_(), bpp::AbstractFrequencySet::getFrequencies(), bpp::AbstractFrequencySet::getFrequencies_(), bpp::AbstractFrequencySet::getNumberOfFrequencies(), bpp::AbstractFrequencySet::normalize(), bpp::AbstractFrequencySet::operator=(), and bpp::AbstractFrequencySet::setFrequencies_().
|
staticinherited |
Definition at line 92 of file FrequencySet.h.
Referenced by bpp::FullNucleotideFrequencySet::FullNucleotideFrequencySet().
|
staticinherited |
Definition at line 91 of file FrequencySet.h.
|
staticinherited |
Definition at line 90 of file FrequencySet.h.
Referenced by bpp::F81::F81(), bpp::F84::F84(), bpp::GTR::GTR(), bpp::HKY85::HKY85(), bpp::T92::T92(), and bpp::TN93::TN93().
|
privateinherited |
Definition at line 107 of file FrequencySet.h.
Referenced by bpp::AbstractFrequencySet::getName(), and bpp::AbstractFrequencySet::operator=().
|
privateinherited |
Definition at line 105 of file FrequencySet.h.
Referenced by bpp::AbstractFrequencySet::getStateMap(), bpp::AbstractFrequencySet::operator=(), and bpp::AbstractFrequencySet::stateMap().
|
protected |
Definition at line 95 of file WordFrequencySet.h.
Referenced by fireParameterChanged(), frequencySetForLetter(), getDescription(), getLength(), operator=(), setFrequencies(), setNamespace(), updateFrequencies(), and WordFromIndependentFrequencySet().
|
protected |
Definition at line 96 of file WordFrequencySet.h.
Referenced by operator=(), setNamespace(), and WordFromIndependentFrequencySet().