bpp-phyl
2.2.0
|
Basic implementation of the FrequenciesSet interface. More...
#include <Bpp/Phyl/Model/FrequenciesSet/FrequenciesSet.h>
Public Member Functions | |
AbstractFrequenciesSet (StateMap *stateMap, const std::string &prefix, const std::string &name) | |
AbstractFrequenciesSet * | clone () const =0 |
AbstractFrequenciesSet (const AbstractFrequenciesSet &af) | |
AbstractFrequenciesSet & | operator= (const AbstractFrequenciesSet &af) |
const Alphabet * | getAlphabet () 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... | |
size_t | getNumberOfFrequencies () const |
std::string | getName () const |
void | normalize () |
virtual void | setFrequencies (const std::vector< double > &frequencies)=0 |
Set the parameters in order to match a given set of frequencies. More... | |
Static Public Attributes | |
static IntervalConstraint | FREQUENCE_CONSTRAINT_SMALL |
static IntervalConstraint | FREQUENCE_CONSTRAINT_MILLI |
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) |
Private Attributes | |
const Alphabet * | alphabet_ |
std::auto_ptr< StateMap > | stateMap_ |
std::vector< double > | freq_ |
std::string | name_ |
Basic implementation of the FrequenciesSet interface.
Definition at line 125 of file FrequenciesSet.h.
|
inline |
Definition at line 136 of file FrequenciesSet.h.
|
inline |
Definition at line 151 of file FrequenciesSet.h.
|
pure virtual |
Implements bpp::FrequenciesSet.
Implemented in bpp::CodonFromUniqueFrequenciesSet, bpp::CodonFromIndependentFrequenciesSet, bpp::FixedFrequenciesSet, bpp::FullPerAACodonFrequenciesSet, bpp::MarkovModulatedFrequenciesSet, bpp::FullFrequenciesSet, bpp::WordFromUniqueFrequenciesSet, bpp::FixedCodonFrequenciesSet, bpp::FixedNucleotideFrequenciesSet, bpp::WordFromIndependentFrequenciesSet, bpp::FullNucleotideFrequenciesSet, bpp::FullCodonFrequenciesSet, bpp::FixedProteinFrequenciesSet, bpp::AbstractWordFrequenciesSet, bpp::GCFrequenciesSet, bpp::FullProteinFrequenciesSet, and bpp::MvaFrequenciesSet.
|
inlinevirtual |
Implements bpp::FrequenciesSet.
Reimplemented in bpp::FixedNucleotideFrequenciesSet, bpp::FullNucleotideFrequenciesSet, bpp::FixedProteinFrequenciesSet, bpp::AbstractWordFrequenciesSet, bpp::MvaFrequenciesSet, bpp::GCFrequenciesSet, and bpp::FullProteinFrequenciesSet.
Definition at line 170 of file FrequenciesSet.h.
References alphabet_.
Referenced by bpp::FullProteinFrequenciesSet::getAlphabet(), bpp::GCFrequenciesSet::getAlphabet(), bpp::MvaFrequenciesSet::getAlphabet(), bpp::AbstractWordFrequenciesSet::getAlphabet(), bpp::FixedProteinFrequenciesSet::getAlphabet(), bpp::FullNucleotideFrequenciesSet::getAlphabet(), bpp::FullCodonFrequenciesSet::getAlphabet(), bpp::FixedNucleotideFrequenciesSet::getAlphabet(), bpp::FixedCodonFrequenciesSet::getAlphabet(), bpp::FullPerAACodonFrequenciesSet::getAlphabet(), and bpp::FullFrequenciesSet::updateFreq_().
|
virtual |
Implements bpp::FrequenciesSet.
Definition at line 79 of file FrequenciesSet.cpp.
|
inlineprotected |
Definition at line 203 of file FrequenciesSet.h.
References 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 bpp::CodonFromUniqueFrequenciesSet::updateFrequencies().
|
inlineprotected |
Definition at line 204 of file FrequenciesSet.h.
References freq_.
|
inlinevirtual |
Implements bpp::FrequenciesSet.
Definition at line 174 of file FrequenciesSet.h.
References freq_.
Referenced by bpp::MvaFrequenciesSet::updateFrequencies().
|
inlineprotected |
Definition at line 202 of file FrequenciesSet.h.
References freq_.
|
inlinevirtual |
Implements bpp::FrequenciesSet.
Definition at line 191 of file FrequenciesSet.h.
References name_.
Referenced by bpp::WordFromIndependentFrequenciesSet::getDescription(), and bpp::WordFromUniqueFrequenciesSet::getDescription().
|
inlinevirtual |
Implements bpp::FrequenciesSet.
Definition at line 189 of file FrequenciesSet.h.
References freq_.
Referenced by bpp::FixedFrequenciesSet::setFrequencies().
|
inlinevirtual |
Implements bpp::FrequenciesSet.
Definition at line 172 of file FrequenciesSet.h.
References stateMap_.
Referenced by bpp::FullPerAACodonFrequenciesSet::updateFrequencies().
|
inline |
Definition at line 193 of file FrequenciesSet.h.
References freq_.
Referenced by bpp::FullPerAACodonFrequenciesSet::updateFrequencies().
|
inline |
Definition at line 159 of file FrequenciesSet.h.
References alphabet_, freq_, name_, and stateMap_.
Referenced by bpp::MvaFrequenciesSet::operator=(), bpp::AbstractWordFrequenciesSet::operator=(), bpp::FullCodonFrequenciesSet::operator=(), bpp::FixedCodonFrequenciesSet::operator=(), bpp::MarkovModulatedFrequenciesSet::operator=(), and bpp::FullPerAACodonFrequenciesSet::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::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().
|
inlineprotected |
Definition at line 205 of file FrequenciesSet.h.
References freq_.
Referenced by bpp::MarkovModulatedFrequenciesSet::fireParameterChanged(), bpp::MarkovModulatedFrequenciesSet::MarkovModulatedFrequenciesSet(), bpp::FullNucleotideFrequenciesSet::setFrequencies(), bpp::FixedFrequenciesSet::setFrequencies(), and bpp::MvaFrequenciesSet::updateFrequencies().
|
virtual |
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.
|
private |
Definition at line 130 of file FrequenciesSet.h.
Referenced by getAlphabet(), and operator=().
|
private |
Definition at line 132 of file FrequenciesSet.h.
Referenced by getFreq_(), getFrequencies(), getFrequencies_(), getNumberOfFrequencies(), normalize(), operator=(), and setFrequencies_().
|
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 133 of file FrequenciesSet.h.
Referenced by getName(), and operator=().
|
private |
Definition at line 131 of file FrequenciesSet.h.
Referenced by getStateMap(), and operator=().