bpp-phyl
2.2.0
|
A frequencies set used to estimate frequencies at the root with the COaLA model. Frequencies at the root are optimized in the same way than the equlibrium frequencies on branches. Hyperparameters are used, which represent positions along the principal axes obtained from a preliminary Correspondence Analysis. From the optimized positions, the 20 frequencies are calculated. More...
#include <Bpp/Phyl/Model/FrequenciesSet/MvaFrequenciesSet.h>
Public Member Functions | |
MvaFrequenciesSet (const ProteicAlphabet *alpha) | |
Constructor. More... | |
MvaFrequenciesSet * | clone () const |
MvaFrequenciesSet & | operator= (const MvaFrequenciesSet &mfs) |
const ProteicAlphabet * | getAlphabet () const |
void | setTransposeMatrixOfPpalAxes (const RowMatrix< double > &matrix) |
void | setMatrixOfRowCoords (const RowMatrix< double > &matrix) |
void | setNbrOfAxes (const size_t &nAxes) |
void | setModelName (const std::string &modelName) |
void | setVectorOfColumnWeights (const std::vector< double > &cw) |
void | setParamValues (std::map< std::string, std::string > &valuesSettings) |
void | setFrequencies (const std::vector< double > &frequencies) throw (DimensionException, Exception) |
Set the parameters in order to match a given set of frequencies. More... | |
void | defineParameters () |
void | fireParameterChanged (const ParameterList ¶meters) |
void | updateFrequencies () throw (Exception) |
void | initSet (CoalaCore *coala) |
void | computeReversePCA (const std::vector< double > &positions, std::vector< double > &tmpFreqs) throw (Exception) |
void | computeCoordsFirstSpacePCA (std::vector< double > &tmpFreqs, std::vector< double > &freqs) throw (Exception) |
void | computeReverseCOA (const std::vector< double > &positions, std::vector< double > &tmpFreqs) throw (Exception) |
void | computeCoordsFirstSpaceCOA (std::vector< double > &tmpFreqs, std::vector< double > &freqs) throw (Exception) |
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 | 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 |
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 | |
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 | |
RowMatrix< double > | tPpalAxes_ |
RowMatrix< double > | rowCoords_ |
size_t | nbrOfAxes_ |
std::string | model_ |
std::vector< double > | columnWeights_ |
std::map< std::string, std::string > | paramValues_ |
A frequencies set used to estimate frequencies at the root with the COaLA model. Frequencies at the root are optimized in the same way than the equlibrium frequencies on branches. Hyperparameters are used, which represent positions along the principal axes obtained from a preliminary Correspondence Analysis. From the optimized positions, the 20 frequencies are calculated.
Definition at line 57 of file MvaFrequenciesSet.h.
MvaFrequenciesSet::MvaFrequenciesSet | ( | const ProteicAlphabet * | alpha | ) |
|
inlinevirtual |
Implements bpp::AbstractFrequenciesSet.
Definition at line 72 of file MvaFrequenciesSet.h.
References MvaFrequenciesSet().
void MvaFrequenciesSet::computeCoordsFirstSpaceCOA | ( | std::vector< double > & | tmpFreqs, |
std::vector< double > & | freqs | ||
) | |||
throw | ( | Exception | |
) |
Definition at line 144 of file MvaFrequenciesSet.cpp.
Referenced by updateFrequencies().
void bpp::MvaFrequenciesSet::computeCoordsFirstSpacePCA | ( | std::vector< double > & | tmpFreqs, |
std::vector< double > & | freqs | ||
) | |||
throw | ( | Exception | |
) |
void MvaFrequenciesSet::computeReverseCOA | ( | const std::vector< double > & | positions, |
std::vector< double > & | tmpFreqs | ||
) | |||
throw | ( | Exception | |
) |
Definition at line 133 of file MvaFrequenciesSet.cpp.
Referenced by updateFrequencies().
void bpp::MvaFrequenciesSet::computeReversePCA | ( | const std::vector< double > & | positions, |
std::vector< double > & | tmpFreqs | ||
) | |||
throw | ( | Exception | |
) |
void MvaFrequenciesSet::defineParameters | ( | ) |
Definition at line 66 of file MvaFrequenciesSet.cpp.
References nbrOfAxes_, paramValues_, and rowCoords_.
Referenced by initSet().
void MvaFrequenciesSet::fireParameterChanged | ( | const ParameterList & | parameters | ) |
Definition at line 82 of file MvaFrequenciesSet.cpp.
References updateFrequencies().
|
inlinevirtual |
Reimplemented from bpp::AbstractFrequenciesSet.
Definition at line 96 of file MvaFrequenciesSet.h.
References bpp::AbstractFrequenciesSet::getAlphabet().
|
pure virtualinherited |
Implemented in bpp::AbstractFrequenciesSet.
Referenced by bpp::CodonDistanceFitnessPhaseFrequenciesSubstitutionModel::setFreq().
|
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_(), bpp::FullFrequenciesSet::updateFreq_(), 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_.
|
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 updateFrequencies().
|
inlineprotectedinherited |
Definition at line 202 of file FrequenciesSet.h.
References bpp::AbstractFrequenciesSet::freq_.
|
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().
|
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().
void MvaFrequenciesSet::initSet | ( | CoalaCore * | coala | ) |
Definition at line 56 of file MvaFrequenciesSet.cpp.
References defineParameters(), bpp::CoalaCore::getColumnWeights(), bpp::CoalaCore::getNbrOfAxes(), bpp::CoalaCore::getRowCoordinates(), bpp::CoalaCore::getTppalAxesMatrix(), setMatrixOfRowCoords(), setNbrOfAxes(), setTransposeMatrixOfPpalAxes(), setVectorOfColumnWeights(), and updateFrequencies().
|
inlineinherited |
Definition at line 193 of file FrequenciesSet.h.
References bpp::AbstractFrequenciesSet::freq_.
Referenced by bpp::FullPerAACodonFrequenciesSet::updateFrequencies().
|
inline |
Definition at line 74 of file MvaFrequenciesSet.h.
References columnWeights_, model_, nbrOfAxes_, bpp::AbstractFrequenciesSet::operator=(), paramValues_, rowCoords_, and tPpalAxes_.
|
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 130 of file MvaFrequenciesSet.cpp.
|
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 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.
|
inline |
|
inline |
Definition at line 101 of file MvaFrequenciesSet.h.
References model_.
|
inline |
|
inline |
Definition at line 103 of file MvaFrequenciesSet.h.
References paramValues_.
|
inline |
|
inline |
Definition at line 102 of file MvaFrequenciesSet.h.
References columnWeights_.
Referenced by initSet().
void MvaFrequenciesSet::updateFrequencies | ( | ) | ||
throw | ( | Exception | ||
) |
Definition at line 87 of file MvaFrequenciesSet.cpp.
References computeCoordsFirstSpaceCOA(), computeReverseCOA(), bpp::AbstractFrequenciesSet::getFreq_(), bpp::AbstractFrequenciesSet::getFrequencies(), nbrOfAxes_, and bpp::AbstractFrequenciesSet::setFrequencies_().
Referenced by fireParameterChanged(), and initSet().
|
protected |
Definition at line 92 of file MvaFrequenciesSet.h.
Referenced by operator=(), and setVectorOfColumnWeights().
|
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().
|
protected |
Definition at line 91 of file MvaFrequenciesSet.h.
Referenced by operator=(), and setModelName().
|
protected |
Definition at line 90 of file MvaFrequenciesSet.h.
Referenced by defineParameters(), operator=(), setNbrOfAxes(), and updateFrequencies().
|
protected |
Definition at line 93 of file MvaFrequenciesSet.h.
Referenced by defineParameters(), operator=(), and setParamValues().
|
protected |
Definition at line 89 of file MvaFrequenciesSet.h.
Referenced by defineParameters(), operator=(), and setMatrixOfRowCoords().
|
protected |
Definition at line 88 of file MvaFrequenciesSet.h.
Referenced by operator=(), and setTransposeMatrixOfPpalAxes().