bpp-phyl
2.2.0
|
A generic FrequenciesSet allowing for the estimation of all frequencies. More...
#include <Bpp/Phyl/Model/FrequenciesSet/FrequenciesSet.h>
Public Member Functions | |
FullFrequenciesSet (StateMap *stateMap, bool allowNullFreqs=false, unsigned short method=1, const std::string &name="Full.") | |
Construction with uniform frequencies on the states of the alphabet. More... | |
FullFrequenciesSet (StateMap *stateMap, const std::vector< double > &initFreqs, bool allowNullFreqs=false, unsigned short method=1, const std::string &name="Full.") | |
FullFrequenciesSet * | clone () const |
void | setFrequencies (const std::vector< double > &frequencies) |
Set the parameters in order to match a given set of frequencies. More... | |
unsigned short | getMethod () const |
void | setNamespace (const std::string &nameSpace) |
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 () |
Static Public Attributes | |
static IntervalConstraint | FREQUENCE_CONSTRAINT_SMALL |
static IntervalConstraint | FREQUENCE_CONSTRAINT_MILLI |
Protected Member Functions | |
void | fireParameterChanged (const ParameterList ¶meters) |
std::vector< double > & | getFrequencies_ () |
double & | getFreq_ (size_t i) |
const double & | getFreq_ (size_t i) const |
void | setFrequencies_ (const std::vector< double > &frequencies) |
Private Member Functions | |
void | updateFreq_ () |
Private Attributes | |
Simplex | sFreq_ |
Simplex to handle the probabilities and the parameters. More... | |
A generic FrequenciesSet allowing for the estimation of all frequencies.
The FrequenciesSet has hence n-1 parameters, where n is the size of the input alphabet.
The parametrization depends on the method used. Default method is 1 (ie global ratio).
Definition at line 220 of file FrequenciesSet.h.
FullFrequenciesSet::FullFrequenciesSet | ( | StateMap * | stateMap, |
bool | allowNullFreqs = false , |
||
unsigned short | method = 1 , |
||
const std::string & | name = "Full." |
||
) |
Construction with uniform frequencies on the states of the alphabet.
Definition at line 91 of file FrequenciesSet.cpp.
References bpp::StateMap::getNumberOfModelStates(), sFreq_, and updateFreq_().
Referenced by clone().
FullFrequenciesSet::FullFrequenciesSet | ( | StateMap * | stateMap, |
const std::vector< double > & | initFreqs, | ||
bool | allowNullFreqs = false , |
||
unsigned short | method = 1 , |
||
const std::string & | name = "Full." |
||
) |
Definition at line 106 of file FrequenciesSet.cpp.
References sFreq_, and updateFreq_().
|
inlinevirtual |
Implements bpp::AbstractFrequenciesSet.
Reimplemented in bpp::FullProteinFrequenciesSet.
Definition at line 237 of file FrequenciesSet.h.
References FullFrequenciesSet().
|
protected |
Definition at line 130 of file FrequenciesSet.cpp.
References sFreq_, and updateFreq_().
|
inlinevirtualinherited |
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 bpp::AbstractFrequenciesSet::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 updateFreq_().
|
virtualinherited |
Implements bpp::FrequenciesSet.
Definition at line 79 of file FrequenciesSet.cpp.
|
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_(), updateFreq_(), bpp::MvaFrequenciesSet::updateFrequencies(), bpp::WordFromIndependentFrequenciesSet::updateFrequencies(), bpp::WordFromUniqueFrequenciesSet::updateFrequencies(), bpp::FullPerAACodonFrequenciesSet::updateFrequencies(), bpp::CodonFromIndependentFrequenciesSet::updateFrequencies(), and bpp::CodonFromUniqueFrequenciesSet::updateFrequencies().
|
inlineprotectedinherited |
Definition at line 204 of file FrequenciesSet.h.
References bpp::AbstractFrequenciesSet::freq_.
|
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_.
|
inline |
Definition at line 242 of file FrequenciesSet.h.
References sFreq_.
|
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().
|
inlinevirtualinherited |
Implements bpp::FrequenciesSet.
Definition at line 189 of file FrequenciesSet.h.
References bpp::AbstractFrequenciesSet::freq_.
Referenced by bpp::FixedFrequenciesSet::setFrequencies().
|
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().
|
virtual |
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. |
Implements bpp::FrequenciesSet.
Definition at line 115 of file FrequenciesSet.cpp.
References sFreq_, and updateFreq_().
|
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().
|
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.
void FullFrequenciesSet::setNamespace | ( | const std::string & | nameSpace | ) |
Definition at line 124 of file FrequenciesSet.cpp.
References sFreq_.
|
private |
Definition at line 136 of file FrequenciesSet.cpp.
References bpp::AbstractFrequenciesSet::getAlphabet(), bpp::AbstractFrequenciesSet::getFreq_(), and sFreq_.
Referenced by fireParameterChanged(), FullFrequenciesSet(), 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 |
Simplex to handle the probabilities and the parameters.
Definition at line 227 of file FrequenciesSet.h.
Referenced by fireParameterChanged(), FullFrequenciesSet(), getMethod(), setFrequencies(), setNamespace(), and updateFreq_().