bpp-phyl3
3.0.0
|
Tuffley and Steel's 1998 covarion model. More...
#include <Bpp/Phyl/Model/TS98.h>
Public Member Functions | |
TS98 (std::unique_ptr< ReversibleSubstitutionModelInterface > model, double s1=1., double s2=1., bool normalizeRateChanges=false) | |
Build a new TS98 substitution model. More... | |
virtual | ~TS98 () |
TS98 * | clone () const override |
std::string | getName () const override |
Get the name of the model. More... | |
double | getRate () const override |
Get the rate. More... | |
void | setRate (double rate) override |
Set the rate of the model (must be positive). More... | |
void | addRateParameter () override |
const Alphabet & | alphabet () const override |
std::shared_ptr< const Alphabet > | getAlphabet () const override |
size_t | getNumberOfStates () const override |
Get the number of states. More... | |
const StateMapInterface & | stateMap () const override |
std::shared_ptr< const StateMapInterface > | getStateMap () const override |
const std::vector< int > & | getAlphabetStates () const override |
std::string | getAlphabetStateAsChar (size_t index) const override |
int | getAlphabetStateAsInt (size_t index) const override |
std::vector< size_t > | getModelStates (int code) const override |
Get the state in the model corresponding to a particular state in the alphabet. More... | |
std::vector< size_t > | getModelStates (const std::string &code) const override |
Get the state in the model corresponding to a particular state in the alphabet. More... | |
const Vdouble & | getFrequencies () const override |
const Matrix< double > & | exchangeabilityMatrix () const override |
const Matrix< double > & | generator () const override |
const Matrix< double > & | getPij_t (double t) const override |
const Matrix< double > & | getdPij_dt (double t) const override |
const Matrix< double > & | getd2Pij_dt2 (double t) const override |
const Vdouble & | getEigenValues () const override |
const Vdouble & | getIEigenValues () const override |
bool | isDiagonalizable () const override |
bool | isNonSingular () const override |
const Matrix< double > & | getRowLeftEigenVectors () const override |
const Matrix< double > & | getColumnRightEigenVectors () const override |
double | freq (size_t i) const override |
double | Sij (size_t i, size_t j) const override |
double | Qij (size_t i, size_t j) const override |
A method for computing all necessary matrices. More... | |
double | Pij_t (size_t i, size_t j, double t) const override |
double | dPij_dt (size_t i, size_t j, double t) const override |
double | d2Pij_dt2 (size_t i, size_t j, double t) const override |
double | getInitValue (size_t i, int state) const override |
void | setFreqFromData (const SequenceDataInterface &data, double pseudoCount=0) override |
Set equilibrium frequencies equal to the frequencies estimated from the data. More... | |
void | setFreq (std::map< int, double > &frequencies) override |
Set equilibrium frequencies. More... | |
const FrequencySetInterface & | frequencySet () const override |
const ReversibleSubstitutionModelInterface & | nestedModel () const |
size_t | getRate (size_t i) const |
Get the rate category corresponding to a particular state in the compound model. More... | |
bool | isScalable () const override |
returns if model is scalable More... | |
void | setScalable (bool scalable) override |
sets if model is scalable, ie scale can be changed. Default : true, set to false to avoid normalization for example. More... | |
void | normalize () override |
Normalize the generator. More... | |
void | setDiagonal () override |
set the diagonal of the generator such that sum on each line equals 0. More... | |
double | getScale () const override |
Get the scalar product of diagonal elements of the generator and the frequencies vector. If the generator is normalized, then scale=1. Otherwise each element must be multiplied by 1/scale. More... | |
void | setScale (double scale) override |
Multiplies the current generator by the given scale. More... | |
void | enableEigenDecomposition (bool yn) override |
Set if eigenValues and Vectors must be computed. More... | |
bool | enableEigenDecomposition () override |
Tell if eigenValues and Vectors must be computed. More... | |
bool | computeFrequencies () const override |
void | computeFrequencies (bool yn) override |
virtual void | fireParameterChanged (const ParameterList ¶meters) override |
Tells the model that a parameter value has changed. More... | |
void | setNamespace (const std::string &prefix) override |
virtual const Eigen::VectorXd & | Lik_t (const Eigen::VectorXd &values, double t) const =0 |
const Eigen::VectorXd & | Lik_t (const Eigen::VectorXd &values, double t) const override |
virtual const Eigen::VectorXd & | dLik_dt (const Eigen::VectorXd &values, double t) const =0 |
const Eigen::VectorXd & | dLik_dt (const Eigen::VectorXd &values, double t) const override |
virtual const Eigen::VectorXd & | d2Lik_dt2 (const Eigen::VectorXd &values, double t) const =0 |
const Eigen::VectorXd & | d2Lik_dt2 (const Eigen::VectorXd &values, double t) 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 |
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 |
Protected Member Functions | |
void | updateRatesModel_ () override |
Update the rates vector, generator and equilibrium frequencies. More... | |
virtual void | updateMatrices_ () |
Vdouble & | getFrequencies_ () override |
virtual ParameterList & | getParameters_ ()=0 |
ParameterList & | getParameters_ () override |
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::unique_ptr< ReversibleSubstitutionModelInterface > | model_ |
std::shared_ptr< const MarkovModulatedStateMap > | stateMap_ |
size_t | nbStates_ |
size_t | nbRates_ |
RowMatrix< double > | ratesGenerator_ |
RowMatrix< double > | generator_ |
The generator matrix of the model. More... | |
RowMatrix< double > | exchangeability_ |
The exchangeability matrix of the model. More... | |
RowMatrix< double > | leftEigenVectors_ |
The matrix made of left eigen vectors (by row). More... | |
RowMatrix< double > | rightEigenVectors_ |
The matrix made of right eigen vectors (by column). More... | |
Vdouble | eigenValues_ |
The vector of real parts of eigen values. More... | |
Vdouble | iEigenValues_ |
The vector of imaginary parts of the eigen values (zero in case of reversible pmodel). More... | |
bool | eigenDecompose_ |
Tell if the eigen decomposition should be performed. More... | |
bool | compFreq_ |
Tell if the equilibrium frequencies should be computed from the generator. More... | |
RowMatrix< double > | pijt_ |
These ones are for bookkeeping: More... | |
RowMatrix< double > | dpijt_ |
RowMatrix< double > | d2pijt_ |
Vdouble | freq_ |
The vector of equilibrium frequencies. More... | |
bool | normalizeRateChanges_ |
std::string | nestedPrefix_ |
Rate generator. | |
These variables must be initialized in the constructor of the derived class. | |
RowMatrix< double > | rates_ |
RowMatrix< double > | ratesExchangeability_ |
Vdouble | ratesFreq_ |
Private Attributes | |
ParameterList | independentParameters_ |
std::map< std::string, std::shared_ptr< AliasParameterListener > > | aliasListenersRegister_ |
ParameterList | parameters_ |
std::string | prefix_ |
Eigen::VectorXd | lik_ |
Tuffley and Steel's 1998 covarion model.
This model is a subclass of the so-called Markov-modulated substitution models, with a rate matrix
and
This model was originally designed for nucleotides sequences, but it can be used with other alphabets.
Tuffley C. and Steel M. A., Modelling the covarion hypothesis of nucleotide substitution (1998), Math. Biosci., 147:63-91.
|
inline |
Build a new TS98 substitution model.
model | The substitution model to use. May be of any alphabet type. |
s1 | First rate parameter. |
s2 | Second rate parameter. |
normalizeRateChanges | Tell if the rate transition matrix should be normalized. |
Definition at line 54 of file TS98.h.
References bpp::AbstractParameterAliasable::addParameter_(), bpp::Parameter::R_PLUS_STAR, bpp::MarkovModulatedSubstitutionModel::updateMatrices_(), and updateRatesModel_().
Referenced by clone().
|
inlineoverridevirtual |
Implements bpp::BranchModelInterface.
|
inlineoverridevirtualinherited |
Implements bpp::BranchModelInterface.
Definition at line 177 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::model_.
|
inlineoverridevirtual |
Implements bpp::MarkovModulatedSubstitutionModel.
Definition at line 69 of file TS98.h.
References TS98().
|
inlineoverridevirtualinherited |
Implements bpp::TransitionModelInterface.
Definition at line 299 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::compFreq_.
|
inlineoverridevirtualinherited |
Implements bpp::TransitionModelInterface.
Definition at line 301 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::compFreq_.
|
pure virtualinherited |
Implements bpp::BranchModelInterface.
Implemented in bpp::AbstractLkTransitionModel.
|
inlineoverridevirtualinherited |
Implements bpp::TransitionModelInterface.
Definition at line 64 of file AbstractSubstitutionModel.h.
References bpp::TransitionModelInterface::getd2Pij_dt2(), and bpp::AbstractLkTransitionModel::lik_.
|
inlineoverridevirtualinherited |
Implements bpp::TransitionModelInterface.
Definition at line 222 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::getd2Pij_dt2().
|
pure virtualinherited |
Implements bpp::BranchModelInterface.
Implemented in bpp::AbstractLkTransitionModel.
|
inlineoverridevirtualinherited |
Implements bpp::TransitionModelInterface.
Definition at line 47 of file AbstractSubstitutionModel.h.
References bpp::TransitionModelInterface::getdPij_dt(), and bpp::AbstractLkTransitionModel::lik_.
|
inlineoverridevirtualinherited |
Implements bpp::TransitionModelInterface.
Definition at line 221 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::getdPij_dt().
|
inlineoverridevirtualinherited |
Tell if eigenValues and Vectors must be computed.
Implements bpp::SubstitutionModelInterface.
Definition at line 297 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::eigenDecompose_.
|
inlineoverridevirtualinherited |
Set if eigenValues and Vectors must be computed.
Implements bpp::SubstitutionModelInterface.
Definition at line 295 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::eigenDecompose_.
|
inlineoverridevirtualinherited |
Implements bpp::SubstitutionModelInterface.
Definition at line 199 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::exchangeability_.
|
inlineoverridevirtualinherited |
Tells the model that a parameter value has changed.
This updates the matrices consequently.
Reimplemented from bpp::AbstractParameterAliasable.
Reimplemented in bpp::G2001.
Definition at line 309 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::model_, bpp::MarkovModulatedSubstitutionModel::updateMatrices_(), and bpp::MarkovModulatedSubstitutionModel::updateRatesModel_().
Referenced by bpp::G2001::fireParameterChanged().
|
inlineoverridevirtualinherited |
Implements bpp::TransitionModelInterface.
Definition at line 216 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::freq_.
|
inlineoverridevirtualinherited |
Exception | if no FrequenceSet is associated to this model. |
Implements bpp::BranchModelInterface.
Definition at line 238 of file MarkovModulatedSubstitutionModel.h.
|
inlineoverridevirtualinherited |
See Kosiol and Goldman (2005), Molecular Biology And Evolution 22(2) 193-9.
Implements bpp::SubstitutionModelInterface.
Definition at line 201 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::generator_.
|
inlineoverridevirtualinherited |
Implements bpp::BranchModelInterface.
Definition at line 179 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::model_.
Referenced by bpp::MarkovModulatedSubstitutionModel::getInitValue().
|
inlineoverridevirtualinherited |
index | The model state. |
Implements bpp::BranchModelInterface.
Definition at line 189 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::stateMap_.
|
inlineoverridevirtualinherited |
index | The model state. |
Implements bpp::BranchModelInterface.
Definition at line 191 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::stateMap_.
Referenced by bpp::MarkovModulatedSubstitutionModel::getInitValue().
|
inlineoverridevirtualinherited |
Implements bpp::BranchModelInterface.
Definition at line 187 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::stateMap_.
|
inlineoverridevirtualinherited |
Implements bpp::SubstitutionModelInterface.
Definition at line 214 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::rightEigenVectors_.
|
overridevirtualinherited |
Implements bpp::TransitionModelInterface.
Definition at line 177 of file MarkovModulatedSubstitutionModel.cpp.
References bpp::MarkovModulatedSubstitutionModel::d2pijt_, bpp::MarkovModulatedSubstitutionModel::eigenValues_, bpp::VectorTools::exp(), bpp::MarkovModulatedSubstitutionModel::leftEigenVectors_, bpp::MatrixTools::mult(), bpp::MarkovModulatedSubstitutionModel::rightEigenVectors_, and bpp::VectorTools::sqr().
Referenced by bpp::MarkovModulatedSubstitutionModel::d2Pij_dt2().
|
overridevirtualinherited |
Implements bpp::TransitionModelInterface.
Definition at line 171 of file MarkovModulatedSubstitutionModel.cpp.
References bpp::MarkovModulatedSubstitutionModel::dpijt_, bpp::MarkovModulatedSubstitutionModel::eigenValues_, bpp::VectorTools::exp(), bpp::MarkovModulatedSubstitutionModel::leftEigenVectors_, bpp::MatrixTools::mult(), and bpp::MarkovModulatedSubstitutionModel::rightEigenVectors_.
Referenced by bpp::MarkovModulatedSubstitutionModel::dPij_dt().
|
inlineoverridevirtualinherited |
Implements bpp::SubstitutionModelInterface.
Definition at line 207 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::eigenValues_.
|
inlineoverridevirtualinherited |
Implements bpp::TransitionModelInterface.
Definition at line 197 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::freq_.
|
inlineoverrideprotectedvirtualinherited |
Implements bpp::TransitionModelInterface.
Definition at line 329 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::freq_.
|
inlineoverridevirtualinherited |
Implements bpp::SubstitutionModelInterface.
Definition at line 208 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::iEigenValues_.
|
overridevirtualinherited |
This method is used to initialize likelihoods in recursions. It typically sends 1 if i = state, 0 otherwise, where i is one of the possible states of the alphabet allowed in the model and state is the observed state in the considered sequence/site.
i | the index of the state in the model. |
state | An observed state in the sequence/site. |
IndexOutOfBoundsException | if array position is out of range. |
BadIntException | if states are not allowed in the associated alphabet. |
Implements bpp::BranchModelInterface.
Definition at line 185 of file MarkovModulatedSubstitutionModel.cpp.
References bpp::MarkovModulatedSubstitutionModel::getAlphabet(), bpp::MarkovModulatedSubstitutionModel::getAlphabetStateAsInt(), bpp::MarkovModulatedSubstitutionModel::model_, bpp::MarkovModulatedSubstitutionModel::nbRates_, and bpp::MarkovModulatedSubstitutionModel::nbStates_.
|
inlineoverridevirtualinherited |
Get the state in the model corresponding to a particular state in the alphabet.
code | The alphabet state to check. |
Implements bpp::BranchModelInterface.
Definition at line 195 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::stateMap_.
|
inlineoverridevirtualinherited |
Get the state in the model corresponding to a particular state in the alphabet.
code | The alphabet state to check. |
Implements bpp::BranchModelInterface.
Definition at line 193 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::stateMap_.
|
inlineoverridevirtual |
|
inlineoverridevirtualinherited |
Get the number of states.
For most models, this equals the size of the alphabet.
Implements bpp::BranchModelInterface.
Definition at line 181 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::stateMap_.
Referenced by bpp::MarkovModulatedSubstitutionModel::setDiagonal().
|
overridevirtualinherited |
Implements bpp::TransitionModelInterface.
Definition at line 162 of file MarkovModulatedSubstitutionModel.cpp.
References bpp::MarkovModulatedSubstitutionModel::eigenValues_, bpp::VectorTools::exp(), bpp::MarkovModulatedSubstitutionModel::leftEigenVectors_, bpp::MatrixTools::mult(), bpp::MarkovModulatedSubstitutionModel::nbRates_, bpp::MarkovModulatedSubstitutionModel::nbStates_, bpp::MarkovModulatedSubstitutionModel::pijt_, and bpp::MarkovModulatedSubstitutionModel::rightEigenVectors_.
Referenced by bpp::MarkovModulatedSubstitutionModel::Pij_t().
|
inlineoverridevirtual |
Get the rate.
Reimplemented from bpp::MarkovModulatedSubstitutionModel.
|
inlineinherited |
Get the rate category corresponding to a particular state in the compound model.
i | The state. |
Definition at line 255 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::nbStates_.
|
inlineoverridevirtualinherited |
Implements bpp::SubstitutionModelInterface.
Definition at line 213 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::leftEigenVectors_.
|
inlineoverridevirtualinherited |
Get the scalar product of diagonal elements of the generator and the frequencies vector. If the generator is normalized, then scale=1. Otherwise each element must be multiplied by 1/scale.
Implements bpp::SubstitutionModelInterface.
Definition at line 282 of file MarkovModulatedSubstitutionModel.h.
References bpp::MatrixTools::diag(), bpp::MarkovModulatedSubstitutionModel::freq_, and bpp::MarkovModulatedSubstitutionModel::generator_.
Referenced by bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
inlineoverridevirtualinherited |
Implements bpp::BranchModelInterface.
Definition at line 185 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::stateMap_.
|
inlineoverridevirtualinherited |
Implements bpp::SubstitutionModelInterface.
Definition at line 210 of file MarkovModulatedSubstitutionModel.h.
|
inlineoverridevirtualinherited |
Implements bpp::SubstitutionModelInterface.
Definition at line 211 of file MarkovModulatedSubstitutionModel.h.
|
inlineoverridevirtualinherited |
returns if model is scalable
Implements bpp::SubstitutionModelInterface.
Definition at line 264 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::model_.
Referenced by bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
pure virtualinherited |
This method is used to compute likelihoods in recursions. It computes the probability of a vector given a start state.
values | An vector of states on the site. |
t | the branch length |
Implements bpp::BranchModelInterface.
Implemented in bpp::AbstractLkTransitionModel.
|
inlineoverridevirtualinherited |
This method is used to compute likelihoods in recursions. It computes the probability of a vector given a start state.
values | An vector of states on the site. |
t | the branch length |
Implements bpp::TransitionModelInterface.
Definition at line 30 of file AbstractSubstitutionModel.h.
References bpp::TransitionModelInterface::getPij_t(), and bpp::AbstractLkTransitionModel::lik_.
|
inlineinherited |
Definition at line 243 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::model_.
Referenced by bpp::BppOSubstitutionModelFormat::write().
|
inlineoverridevirtualinherited |
Normalize the generator.
Implements bpp::SubstitutionModelInterface.
Definition at line 274 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::model_, and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
inlineoverridevirtualinherited |
Implements bpp::TransitionModelInterface.
Definition at line 220 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::getPij_t().
|
inlineoverridevirtualinherited |
A method for computing all necessary matrices.
Implements bpp::SubstitutionModelInterface.
Definition at line 218 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::generator_.
|
overridevirtualinherited |
set the diagonal of the generator such that sum on each line equals 0.
Implements bpp::SubstitutionModelInterface.
Definition at line 144 of file MarkovModulatedSubstitutionModel.cpp.
References bpp::MarkovModulatedSubstitutionModel::generator_, bpp::MarkovModulatedSubstitutionModel::getNumberOfStates(), and RowMatrix< double >::getRow().
|
inlineoverridevirtualinherited |
Set equilibrium frequencies.
frequencies | The map of the frequencies to use. |
Implements bpp::TransitionModelInterface.
Definition at line 232 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::model_, and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
inlineoverridevirtualinherited |
Set equilibrium frequencies equal to the frequencies estimated from the data.
data | The sequences to use. |
pseudoCount | A quantity to add to adjust the observed values in order to prevent issues due to missing states on small data set. The corrected frequencies shall be computed as
|
Implements bpp::TransitionModelInterface.
Definition at line 226 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::model_, and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
overridevirtualinherited |
Reimplemented from bpp::AbstractParameterAliasable.
Definition at line 202 of file MarkovModulatedSubstitutionModel.cpp.
References bpp::MarkovModulatedSubstitutionModel::model_, bpp::MarkovModulatedSubstitutionModel::nestedPrefix_, and bpp::AbstractParameterAliasable::setNamespace().
Referenced by bpp::G2001::setNamespace().
|
inlineoverridevirtual |
Set the rate of the model (must be positive).
rate | must be positive. |
Reimplemented from bpp::MarkovModulatedSubstitutionModel.
|
inlineoverridevirtualinherited |
sets if model is scalable, ie scale can be changed. Default : true, set to false to avoid normalization for example.
Implements bpp::SubstitutionModelInterface.
Definition at line 269 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::model_.
|
inlineoverridevirtualinherited |
Multiplies the current generator by the given scale.
scale | the scale by which the generator is multiplied. |
Implements bpp::SubstitutionModelInterface.
Definition at line 289 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::model_, and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
Referenced by bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
inlineoverridevirtualinherited |
By definition Sij(i,j) = Sij(j,i).
Implements bpp::SubstitutionModelInterface.
Definition at line 217 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::exchangeability_.
|
inlineoverridevirtualinherited |
Implements bpp::BranchModelInterface.
Definition at line 183 of file MarkovModulatedSubstitutionModel.h.
References bpp::MarkovModulatedSubstitutionModel::stateMap_.
|
protectedvirtualinherited |
Definition at line 74 of file MarkovModulatedSubstitutionModel.cpp.
References bpp::MatrixTools::add(), bpp::MarkovModulatedSubstitutionModel::d2pijt_, bpp::MatrixTools::diag(), bpp::MarkovModulatedSubstitutionModel::dpijt_, bpp::MarkovModulatedSubstitutionModel::eigenValues_, bpp::MarkovModulatedSubstitutionModel::exchangeability_, bpp::MarkovModulatedSubstitutionModel::freq_, bpp::MarkovModulatedSubstitutionModel::generator_, RowMatrix< double >::getNumberOfColumns(), bpp::EigenValue< class >::getRealEigenValues(), bpp::MarkovModulatedSubstitutionModel::getScale(), bpp::EigenValue< class >::getV(), bpp::MarkovModulatedSubstitutionModel::iEigenValues_, bpp::MatrixTools::inv(), bpp::MarkovModulatedSubstitutionModel::isScalable(), bpp::MatrixTools::kroneckerMult(), bpp::VectorTools::kroneckerMult(), bpp::MarkovModulatedSubstitutionModel::leftEigenVectors_, bpp::MarkovModulatedSubstitutionModel::model_, bpp::MatrixTools::mult(), bpp::MarkovModulatedSubstitutionModel::nbRates_, bpp::MarkovModulatedSubstitutionModel::nbStates_, bpp::MarkovModulatedSubstitutionModel::normalizeRateChanges_, bpp::MarkovModulatedSubstitutionModel::pijt_, bpp::MarkovModulatedSubstitutionModel::rates_, bpp::MarkovModulatedSubstitutionModel::ratesExchangeability_, bpp::MarkovModulatedSubstitutionModel::ratesFreq_, bpp::MarkovModulatedSubstitutionModel::ratesGenerator_, RowMatrix< double >::resize(), bpp::MarkovModulatedSubstitutionModel::rightEigenVectors_, bpp::MatrixTools::scale(), and bpp::MarkovModulatedSubstitutionModel::setScale().
Referenced by bpp::MarkovModulatedSubstitutionModel::fireParameterChanged(), bpp::G2001::G2001(), bpp::MarkovModulatedSubstitutionModel::normalize(), bpp::MarkovModulatedSubstitutionModel::setFreq(), bpp::MarkovModulatedSubstitutionModel::setFreqFromData(), bpp::MarkovModulatedSubstitutionModel::setScale(), and TS98().
|
inlineoverrideprotectedvirtual |
Update the rates vector, generator and equilibrium frequencies.
This method must be implemented by the derived class. It is called by the fireParameterChanged() method.
Implements bpp::MarkovModulatedSubstitutionModel.
Definition at line 81 of file TS98.h.
References bpp::AbstractParameterAliasable::getParameterValue(), bpp::MarkovModulatedSubstitutionModel::rates_, bpp::MarkovModulatedSubstitutionModel::ratesExchangeability_, and bpp::MarkovModulatedSubstitutionModel::ratesFreq_.
Referenced by TS98().
|
protectedinherited |
Tell if the equilibrium frequencies should be computed from the generator.
Definition at line 110 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::computeFrequencies(), and bpp::MarkovModulatedSubstitutionModel::operator=().
|
mutableprotectedinherited |
Definition at line 117 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::getd2Pij_dt2(), bpp::MarkovModulatedSubstitutionModel::operator=(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
mutableprotectedinherited |
Definition at line 116 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::getdPij_dt(), bpp::MarkovModulatedSubstitutionModel::operator=(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
protectedinherited |
Tell if the eigen decomposition should be performed.
Definition at line 103 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::enableEigenDecomposition(), and bpp::MarkovModulatedSubstitutionModel::operator=().
|
protectedinherited |
The vector of real parts of eigen values.
Definition at line 92 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::getd2Pij_dt2(), bpp::MarkovModulatedSubstitutionModel::getdPij_dt(), bpp::MarkovModulatedSubstitutionModel::getEigenValues(), bpp::MarkovModulatedSubstitutionModel::getPij_t(), bpp::MarkovModulatedSubstitutionModel::operator=(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
protectedinherited |
The exchangeability matrix of the model.
Definition at line 77 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::exchangeabilityMatrix(), bpp::MarkovModulatedSubstitutionModel::operator=(), bpp::MarkovModulatedSubstitutionModel::Sij(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
protectedinherited |
The vector of equilibrium frequencies.
Definition at line 122 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::freq(), bpp::MarkovModulatedSubstitutionModel::getFrequencies(), bpp::MarkovModulatedSubstitutionModel::getFrequencies_(), bpp::MarkovModulatedSubstitutionModel::getScale(), bpp::MarkovModulatedSubstitutionModel::operator=(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
protectedinherited |
The generator matrix of the model.
Definition at line 72 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::generator(), bpp::MarkovModulatedSubstitutionModel::getScale(), bpp::MarkovModulatedSubstitutionModel::operator=(), bpp::MarkovModulatedSubstitutionModel::Qij(), bpp::MarkovModulatedSubstitutionModel::setDiagonal(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
protectedinherited |
The vector of imaginary parts of the eigen values (zero in case of reversible pmodel).
Definition at line 98 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::getIEigenValues(), bpp::MarkovModulatedSubstitutionModel::operator=(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
protectedinherited |
The matrix made of left eigen vectors (by row).
Definition at line 82 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::getd2Pij_dt2(), bpp::MarkovModulatedSubstitutionModel::getdPij_dt(), bpp::MarkovModulatedSubstitutionModel::getPij_t(), bpp::MarkovModulatedSubstitutionModel::getRowLeftEigenVectors(), bpp::MarkovModulatedSubstitutionModel::operator=(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
mutableprivateinherited |
Definition at line 23 of file AbstractSubstitutionModel.h.
Referenced by bpp::AbstractLkTransitionModel::d2Lik_dt2(), bpp::AbstractLkTransitionModel::dLik_dt(), and bpp::AbstractLkTransitionModel::Lik_t().
|
protectedinherited |
Definition at line 52 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::alphabet(), bpp::MarkovModulatedSubstitutionModel::fireParameterChanged(), bpp::MarkovModulatedSubstitutionModel::getAlphabet(), bpp::MarkovModulatedSubstitutionModel::getInitValue(), bpp::MarkovModulatedSubstitutionModel::getRate(), bpp::MarkovModulatedSubstitutionModel::isScalable(), bpp::MarkovModulatedSubstitutionModel::MarkovModulatedSubstitutionModel(), bpp::MarkovModulatedSubstitutionModel::nestedModel(), bpp::MarkovModulatedSubstitutionModel::normalize(), bpp::MarkovModulatedSubstitutionModel::operator=(), bpp::MarkovModulatedSubstitutionModel::setFreq(), bpp::MarkovModulatedSubstitutionModel::setFreqFromData(), bpp::MarkovModulatedSubstitutionModel::setNamespace(), bpp::MarkovModulatedSubstitutionModel::setRate(), bpp::MarkovModulatedSubstitutionModel::setScalable(), bpp::MarkovModulatedSubstitutionModel::setScale(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
protectedinherited |
Definition at line 55 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::G2001::G2001(), bpp::MarkovModulatedSubstitutionModel::getInitValue(), bpp::MarkovModulatedSubstitutionModel::getPij_t(), bpp::MarkovModulatedSubstitutionModel::operator=(), bpp::MarkovModulatedSubstitutionModel::updateMatrices_(), and bpp::G2001::updateRatesModel_().
|
protectedinherited |
Definition at line 54 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::getInitValue(), bpp::MarkovModulatedSubstitutionModel::getPij_t(), bpp::MarkovModulatedSubstitutionModel::getRate(), bpp::MarkovModulatedSubstitutionModel::operator=(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
protectedinherited |
|
protectedinherited |
Definition at line 124 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::operator=(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
mutableprotectedinherited |
These ones are for bookkeeping:
Definition at line 115 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::getPij_t(), bpp::MarkovModulatedSubstitutionModel::operator=(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
protectedinherited |
Definition at line 63 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::operator=(), bpp::MarkovModulatedSubstitutionModel::updateMatrices_(), bpp::G2001::updateRatesModel_(), and updateRatesModel_().
|
protectedinherited |
Definition at line 64 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::operator=(), bpp::MarkovModulatedSubstitutionModel::updateMatrices_(), bpp::G2001::updateRatesModel_(), and updateRatesModel_().
|
protectedinherited |
Definition at line 65 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::G2001::G2001(), bpp::MarkovModulatedSubstitutionModel::operator=(), bpp::MarkovModulatedSubstitutionModel::updateMatrices_(), and updateRatesModel_().
|
protectedinherited |
Definition at line 67 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::operator=(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
protectedinherited |
The matrix made of right eigen vectors (by column).
Definition at line 87 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::getColumnRightEigenVectors(), bpp::MarkovModulatedSubstitutionModel::getd2Pij_dt2(), bpp::MarkovModulatedSubstitutionModel::getdPij_dt(), bpp::MarkovModulatedSubstitutionModel::getPij_t(), bpp::MarkovModulatedSubstitutionModel::operator=(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices_().
|
protectedinherited |
Definition at line 53 of file MarkovModulatedSubstitutionModel.h.
Referenced by bpp::MarkovModulatedSubstitutionModel::getAlphabetStateAsChar(), bpp::MarkovModulatedSubstitutionModel::getAlphabetStateAsInt(), bpp::MarkovModulatedSubstitutionModel::getAlphabetStates(), bpp::MarkovModulatedSubstitutionModel::getModelStates(), bpp::MarkovModulatedSubstitutionModel::getNumberOfStates(), bpp::MarkovModulatedSubstitutionModel::getStateMap(), bpp::MarkovModulatedSubstitutionModel::operator=(), and bpp::MarkovModulatedSubstitutionModel::stateMap().