bpp-phyl3
3.0.0
|
Basic implementation of the FrequencySet interface. More...
#include <Bpp/Phyl/Model/FrequencySet/FrequencySet.h>
Public Member Functions | |
AbstractFrequencySet (std::shared_ptr< const StateMapInterface > stateMap, const std::string &prefix, const std::string &name) | |
AbstractFrequencySet (const AbstractFrequencySet &af) | |
AbstractFrequencySet & | operator= (const AbstractFrequencySet &af) |
std::shared_ptr< const Alphabet > | getAlphabet () const override |
const Alphabet & | alphabet () const override |
const StateMapInterface & | stateMap () const override |
std::shared_ptr< const StateMapInterface > | getStateMap () const override |
const Vdouble & | getFrequencies () const override |
const std::map< int, double > | getAlphabetStatesFrequencies () const override |
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... | |
size_t | getNumberOfFrequencies () const override |
std::string | getName () const override |
void | normalize () |
FrequencySetInterface * | clone () 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 size_t | getNumberOfIndependentParameters () const=0 |
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 |
virtual void | unaliasParameters (const std::string &p1, const std::string &p2)=0 |
virtual const ParameterList & | getIndependentParameters () const=0 |
virtual std::vector< std::string > | getAlias (const std::string &name) const=0 |
virtual std::map< std::string, std::string > | getAliases () const=0 |
virtual bool | hasParameter (const std::string &name) const=0 |
virtual const ParameterList & | getParameters () const=0 |
virtual const Parameter & | parameter (const std::string &name) const=0 |
virtual double | getParameterValue (const std::string &name) const=0 |
virtual void | setAllParametersValues (const ParameterList ¶meters)=0 |
virtual void | setParameterValue (const std::string &name, double value)=0 |
virtual void | setParametersValues (const ParameterList ¶meters)=0 |
virtual bool | matchParametersValues (const ParameterList ¶meters)=0 |
virtual void | removeConstraint (const std::string &name)=0 |
virtual void | setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint)=0 |
virtual size_t | getNumberOfParameters () const=0 |
virtual void | setNamespace (const std::string &prefix)=0 |
virtual std::string | getNamespace () const=0 |
virtual std::string | getParameterNameWithoutNamespace (const std::string &name) const=0 |
void | setNamespace (const std::string &prefix) |
bool | hasIndependentParameter (const std::string &name) const |
const ParameterList & | getIndependentParameters () const |
size_t | getNumberOfIndependentParameters () const |
void | aliasParameters (const std::string &p1, const std::string &p2) |
void | aliasParameters (std::map< std::string, std::string > &unparsedParams, bool verbose) |
void | unaliasParameters (const std::string &p1, const std::string &p2) |
ParameterList | getAliasedParameters (const ParameterList &pl) const |
ParameterList | getFromParameters (const ParameterList &pl) const |
virtual std::vector< std::string > | getAlias (const std::string &name) const |
virtual std::map< std::string, std::string > | getAliases () const |
std::string | getFrom (const std::string &name) const |
bool | hasParameter (const std::string &name) const override |
const ParameterList & | getParameters () const override |
const Parameter & | parameter (const std::string &name) const override |
const std::shared_ptr< Parameter > & | getParameter (const std::string &name) const |
double | getParameterValue (const std::string &name) const override |
void | setAllParametersValues (const ParameterList ¶meters) override |
void | setParameterValue (const std::string &name, double value) override |
void | setParametersValues (const ParameterList ¶meters) override |
bool | matchParametersValues (const ParameterList ¶meters) override |
void | removeConstraint (const std::string &name) override |
void | setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override |
size_t | getNumberOfParameters () const override |
std::string | getNamespace () const override |
std::string | getParameterNameWithoutNamespace (const std::string &name) const override |
virtual void | fireParameterChanged (const ParameterList ¶meters) |
virtual Clonable * | clone () const=0 |
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 | |
std::vector< double > & | getFrequencies_ () |
double & | getFreq_ (size_t i) |
const double & | getFreq_ (size_t i) const |
void | setFrequencies_ (const std::vector< double > &frequencies) |
virtual ParameterList & | getParameters_ ()=0 |
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 |
ParameterList & | getParameters_ () override |
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_ |
Basic implementation of the FrequencySet interface.
Definition at line 99 of file FrequencySet.h.
|
inline |
Definition at line 110 of file FrequencySet.h.
|
inline |
Definition at line 121 of file FrequencySet.h.
|
inlineoverridevirtual |
Implements bpp::FrequencySetInterface.
Definition at line 142 of file FrequencySet.h.
References alphabet_.
|
pure virtualinherited |
Implements bpp::ParameterAliasable.
Implemented in bpp::AbstractWordFrequencySet, bpp::WordFrequencySetInterface, bpp::ProteinFrequencySetInterface, bpp::NucleotideFrequencySetInterface, bpp::CodonFrequencySetInterface, bpp::WordFromUniqueFrequencySet, bpp::WordFromIndependentFrequencySet, bpp::UserProteinFrequencySet, bpp::FixedProteinFrequencySet, bpp::FullProteinFrequencySet, bpp::UserNucleotideFrequencySet, bpp::FixedNucleotideFrequencySet, bpp::FullNucleotideFrequencySet, bpp::GCFrequencySet, bpp::MvaFrequencySet, bpp::UserFrequencySet, bpp::FixedFrequencySet, bpp::MarkovModulatedFrequencySet, bpp::FromModelFrequencySet, bpp::FullFrequencySet, bpp::CodonFromUniqueFrequencySet, bpp::CodonFromIndependentFrequencySet, bpp::FullPerAACodonFrequencySet, bpp::UserCodonFrequencySet, bpp::FixedCodonFrequencySet, and bpp::FullCodonFrequencySet.
Referenced by bpp::EquiprobableSubstitutionModel::setFrequencySet().
|
inlineoverridevirtual |
Implements bpp::FrequencySetInterface.
Definition at line 140 of file FrequencySet.h.
References 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_().
|
overridevirtual |
Implements bpp::FrequencySetInterface.
Definition at line 57 of file FrequencySet.cpp.
|
inlineprotected |
Definition at line 179 of file FrequencySet.h.
References 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(), bpp::WordFromIndependentFrequencySet::updateFrequencies(), bpp::WordFromUniqueFrequencySet::updateFrequencies(), bpp::CodonFromIndependentFrequencySet::updateFrequencies(), bpp::CodonFromUniqueFrequencySet::updateFrequencies(), and bpp::FullPerAACodonFrequencySet::updateFrequencies_().
|
inlineprotected |
Definition at line 180 of file FrequencySet.h.
References freq_.
|
inlineoverridevirtual |
Implements bpp::FrequencySetInterface.
Definition at line 148 of file FrequencySet.h.
References freq_.
Referenced by bpp::MvaFrequencySet::updateFrequencies().
|
inlineprotected |
Definition at line 178 of file FrequencySet.h.
References freq_.
Referenced by bpp::UserFrequencySet::readFromFile_().
|
inlineoverridevirtual |
Implements bpp::FrequencySetInterface.
Definition at line 165 of file FrequencySet.h.
References name_.
Referenced by bpp::WordFromIndependentFrequencySet::getDescription(), and bpp::WordFromUniqueFrequencySet::getDescription().
|
inlineoverridevirtual |
Implements bpp::FrequencySetInterface.
Definition at line 163 of file FrequencySet.h.
References freq_.
Referenced by bpp::FromModelFrequencySet::setFrequencies(), bpp::FixedFrequencySet::setFrequencies(), and bpp::UserFrequencySet::setFrequencies().
|
inlineoverridevirtual |
Implements bpp::FrequencySetInterface.
Definition at line 146 of file FrequencySet.h.
References stateMap_.
|
inline |
Definition at line 167 of file FrequencySet.h.
References freq_.
Referenced by bpp::FullPerAACodonFrequencySet::updateFrequencies_().
|
inline |
Definition at line 129 of file FrequencySet.h.
References alphabet_, freq_, name_, bpp::AbstractParameterAliasable::operator=(), and stateMap_.
Referenced by bpp::AbstractWordFrequencySet::operator=(), bpp::FixedCodonFrequencySet::operator=(), bpp::FromModelFrequencySet::operator=(), bpp::FullCodonFrequencySet::operator=(), bpp::FullPerAACodonFrequencySet::operator=(), bpp::MarkovModulatedFrequencySet::operator=(), and bpp::UserFrequencySet::operator=().
|
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::WordFromUniqueFrequencySet, bpp::WordFromIndependentFrequencySet, bpp::FullNucleotideFrequencySet, bpp::GCFrequencySet, bpp::MvaFrequencySet, bpp::UserFrequencySet, bpp::FixedFrequencySet, bpp::MarkovModulatedFrequencySet, bpp::FromModelFrequencySet, bpp::FullFrequencySet, bpp::FullPerAACodonFrequencySet, bpp::UserCodonFrequencySet, bpp::FixedCodonFrequencySet, and bpp::FullCodonFrequencySet.
Referenced by bpp::BppOFrequencySetFormat::initialize_().
|
inlineprotected |
Definition at line 181 of file FrequencySet.h.
References 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().
|
overridevirtual |
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.
|
inlineoverridevirtual |
Implements bpp::FrequencySetInterface.
Definition at line 144 of file FrequencySet.h.
References stateMap_.
Referenced by bpp::FixedFrequencySet::FixedFrequencySet(), bpp::FullFrequencySet::FullFrequencySet(), bpp::FromModelFrequencySet::setFrequencies(), and bpp::FullPerAACodonFrequencySet::updateFrequencies_().
|
private |
Definition at line 104 of file FrequencySet.h.
Referenced by alphabet(), getAlphabet(), and operator=().
|
private |
Definition at line 106 of file FrequencySet.h.
Referenced by getFreq_(), getFrequencies(), getFrequencies_(), getNumberOfFrequencies(), normalize(), operator=(), and 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().
|
private |
Definition at line 107 of file FrequencySet.h.
Referenced by getName(), and operator=().
|
private |
Definition at line 105 of file FrequencySet.h.
Referenced by getStateMap(), operator=(), and stateMap().