bpp-phyl  2.2.0
bpp::MixtureOfASubstitutionModel Class Referenceabstract

Substitution models defined as a mixture of nested substitution models. More...

#include <Bpp/Phyl/Model/MixtureOfASubstitutionModel.h>

+ Inheritance diagram for bpp::MixtureOfASubstitutionModel:
+ Collaboration diagram for bpp::MixtureOfASubstitutionModel:

Public Member Functions

 MixtureOfASubstitutionModel (const Alphabet *alpha, SubstitutionModel *model, std::map< std::string, DiscreteDistribution *> parametersDistributionsList, int ffrom=-1, int tto=-1) throw (Exception)
 
 MixtureOfASubstitutionModel (const MixtureOfASubstitutionModel &)
 
MixtureOfASubstitutionModeloperator= (const MixtureOfASubstitutionModel &)
 
virtual ~MixtureOfASubstitutionModel ()
 
MixtureOfASubstitutionModelclone () const
 
std::string getName () const
 Get the name of the model. More...
 
void updateMatrices ()
 Diagonalize the $Q$ matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVectors_ matrices. More...
 
Vint getSubmodelNumbers (std::string &desc) const
 
void setFreq (std::map< int, double > &)
 sets the eq frequencies of the first nested model, and adapts the parameters at best to it (surely there is a better way to manage this). More...
 
const DiscreteDistribution * getDistribution (std::string &parName) const
 returns the DiscreteDistribution associated with a given parameter name. More...
 
int from () const
 Numbers of the states between which the substitution rates of all the submodels must be equal. If they are set to -1, this constraint does not exist among the submodels. More...
 
int to () const
 
virtual size_t getNumberOfModels () const
 returns the number of models in the mixture More...
 
virtual const SubstitutionModelgetNModel (size_t i) const
 Returns a specific model from the mixture. More...
 
virtual SubstitutionModelgetNModel (size_t i)
 
double getNRate (size_t i) const
 Returns the rate of a specific model from the mixture. More...
 
virtual void setRate (double rate)
 Set the rate of the model and the submodels. More...
 
virtual void setVRates (const Vdouble &vd)
 Sets the rates of the submodels to be proportional to a given vector, with the constraint that the mean rate of the mixture equals rate_. More...
 
virtual void normalizeVRates ()
 Normalizes the rates of the submodels so that the mean rate of the mixture equals rate_. More...
 
const std::vector< double > & getVRates () const
 Returns the vector of all the rates of the mixture. More...
 
virtual double getNProbability (size_t i) const
 Returns the probability of a specific model from the mixture. More...
 
virtual const std::vector< double > & getProbabilities () const
 Returns the vector of probabilities. More...
 
virtual void setNProbability (size_t i, double prob)
 Sets the probability of a specific model from the mixture. More...
 
double Qij (size_t i, size_t j) const
 This function can not be applied here, so it is defined to prevent wrong usage. More...
 
virtual size_t getNumberOfStates () const
 From SubstitutionModel interface. More...
 
virtual const Matrix< double > & getPij_t (double t) const
 
virtual const Matrix< double > & getdPij_dt (double t) const
 
virtual const Matrix< double > & getd2Pij_dt2 (double t) const
 
virtual const std::vector< int > & getAlphabetStates () const =0
 
const std::vector< int > & getAlphabetStates () const
 
virtual const StateMapgetStateMap () const =0
 
const StateMapgetStateMap () const
 
virtual std::vector< size_t > getModelStates (int code) const =0
 Get the state in the model corresponding to a particular state in the alphabet. More...
 
virtual std::vector< size_t > getModelStates (const std::string &code) const =0
 Get the state in the model corresponding to a particular state in the alphabet. More...
 
std::vector< size_t > getModelStates (int code) const
 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
 Get the state in the model corresponding to a particular state in the alphabet. More...
 
virtual int getAlphabetStateAsInt (size_t index) const =0
 
int getAlphabetStateAsInt (size_t index) const
 
virtual std::string getAlphabetStateAsChar (size_t index) const =0
 
std::string getAlphabetStateAsChar (size_t index) const
 
virtual double freq (size_t i) const =0
 
virtual double freq (size_t i) const
 
virtual double Pij_t (size_t i, size_t j, double t) const =0
 
virtual double Pij_t (size_t i, size_t j, double t) const
 
virtual double dPij_dt (size_t i, size_t j, double t) const =0
 
virtual double dPij_dt (size_t i, size_t j, double t) const
 
virtual double d2Pij_dt2 (size_t i, size_t j, double t) const =0
 
virtual double d2Pij_dt2 (size_t i, size_t j, double t) const
 
virtual const Vdouble & getFrequencies () const =0
 
virtual const Vdouble & getFrequencies () const
 
virtual const Matrix< double > & getGenerator () const =0
 
const Matrix< double > & getGenerator () const
 
virtual const Matrix< double > & getExchangeabilityMatrix () const =0
 
const Matrix< double > & getExchangeabilityMatrix () const
 
virtual double Sij (size_t i, size_t j) const =0
 
double Sij (size_t i, size_t j) const
 
virtual void enableEigenDecomposition (bool yn)=0
 Set if eigenValues and Vectors must be computed. More...
 
virtual bool enableEigenDecomposition ()=0
 Tell if eigenValues and Vectors must be computed. More...
 
void enableEigenDecomposition (bool yn)
 Set if eigenValues and Vectors must be computed. More...
 
bool enableEigenDecomposition ()
 Tell if eigenValues and Vectors must be computed. More...
 
virtual const Vdouble & getEigenValues () const =0
 
const Vdouble & getEigenValues () const
 
virtual const Vdouble & getIEigenValues () const =0
 
const Vdouble & getIEigenValues () const
 
virtual bool isDiagonalizable () const =0
 
bool isDiagonalizable () const
 
virtual bool isNonSingular () const =0
 
bool isNonSingular () const
 
virtual const Matrix< double > & getRowLeftEigenVectors () const =0
 
const Matrix< double > & getRowLeftEigenVectors () const
 
virtual const Matrix< double > & getColumnRightEigenVectors () const =0
 
const Matrix< double > & getColumnRightEigenVectors () const
 
virtual const Alphabet * getAlphabet () const =0
 
const Alphabet * getAlphabet () const
 
virtual double getInitValue (size_t i, int state) const =0 throw (IndexOutOfBoundsException, BadIntException)
 
double getInitValue (size_t i, int state) const throw (IndexOutOfBoundsException, BadIntException)
 
virtual double getScale () const =0
 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...
 
double getScale () const
 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...
 
virtual void setScale (double scale)=0
 Multiplies the current generator by the given scale. More...
 
void setScale (double scale)
 Multiplies the current generator by the given scale. More...
 
virtual double getRate () const =0
 Get the rate. More...
 
virtual double getRate () const
 Get the rate. More...
 
virtual void addRateParameter ()=0
 
void addRateParameter ()
 
virtual void setFreqFromData (const SequenceContainer &data, double pseudoCount=0)=0
 Set equilibrium frequencies equal to the frequencies estimated from the data. More...
 
void setFreqFromData (const SequenceContainer &data, double pseudoCount=0)
 Set equilibrium frequencies equal to the frequencies estimated from the data. More...
 
virtual const FrequenciesSetgetFrequenciesSet () const
 If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0. More...
 
virtual void fireParameterChanged (const ParameterList &parameters)
 Tells the model that a parameter value has changed. More...
 

Protected Attributes

std::vector< SubstitutionModel * > modelsContainer_
 vector of pointers to SubstitutionModels. More...
 
std::vector< double > vProbas_
 vector of the probabilities of the models More...
 
std::vector< double > vRates_
 vector of the rates of the models. More...
 
const Alphabet * alphabet_
 The alphabet relevant to this model. More...
 
std::auto_ptr< StateMapstateMap_
 The map of model states with alphabet states. More...
 
size_t size_
 The size of the generator, i.e. the number of states. More...
 
double rate_
 The rate of the model (default: 1). The generator (and all its vectorial components) is independent of the rate, since it should be normalized. More...
 
RowMatrix< double > generator_
 The generator matrix $Q$ of the model. More...
 
Vdouble freq_
 The vector $\pi_e$ of equilibrium frequencies. More...
 
RowMatrix< double > exchangeability_
 The exchangeability matrix $S$ of the model, defined as $ S_{ij}=\frac{Q_{ij}}{\pi_j}$. When the model is reversible, this matrix is symetric. More...
 
RowMatrix< double > pijt_
 These ones are for bookkeeping: More...
 
RowMatrix< double > dpijt_
 
RowMatrix< double > d2pijt_
 
bool eigenDecompose_
 Tell if the eigen decomposition should be performed. More...
 
Vdouble eigenValues_
 The vector of eigen values. More...
 
Vdouble iEigenValues_
 The vector of the imaginary part of the eigen values. More...
 
bool isDiagonalizable_
 boolean value for diagonalizability in R of the generator_ More...
 
RowMatrix< double > rightEigenVectors_
 The $U^-1$ matrix made of right eigen vectors (by column). More...
 
bool isNonSingular_
 boolean value for non-singularity of rightEigenVectors_ More...
 
RowMatrix< double > leftEigenVectors_
 The $U$ matrix made of left eigen vectors (by row) if rightEigenVectors_ is non-singular. More...
 
std::vector< RowMatrix< double > > vPowGen_
 vector of the powers of generator_ for Taylor development (if rightEigenVectors_ is singular). More...
 
RowMatrix< double > tmpMat_
 For computational issues. More...
 

Private Attributes

std::map< std::string, DiscreteDistribution * > distributionMap_
 
int from_
 
int to_
 

Detailed Description

Substitution models defined as a mixture of nested substitution models.

Author
Laurent Guéguen

All the nested models are of the same type (for example T92 or GY94), and their parameter values can follow discrete distributions.

In this kind of model, there is no generator.

There is a map with connection from parameter names to discrete distributions, and then a related vector of "simple" substitution models for all the combinations of parameter values.

For example: HKY85(kappa=Gamma(n=3,alpha=2,beta=5), theta=TruncExponential(n=4,lambda=0.2,tp=1), theta1=0.4, theta2=TruncExponential(n=5,lambda=0.6,tp=1))

defines 3*4*5=60 different HKY85 nested models with rate one.

Optionnal arguments are used to homogeneize the rates of the nested models. Default values sets all the rates to 1, and given values are the two letters (from_ & to_) between which the substitution rates are the same in all nested models.

For example: HKY85(kappa=Gamma(n=3,alpha=2,beta=5), theta=TruncExponential(n=4,lambda=0.2,tp=1), theta1=0.4, theta2=TruncExponential(n=5,lambda=0.6,tp=1), from=A, to=C)

defines 3*4*5=60 different HKY85 nested models with the same A->C substitution rate.

If a distribution parameter does not respect the constraints of this parameter, there is an Exception at the creation of the wrong model, if any.

When used through a MixedTreeLikelihood objets, all the models have a specific probability, defined through the probabilities of the several parameter distributions. The computing of the likelihoods and probabilities are the expectation of the "simple" models values.

Definition at line 103 of file MixtureOfASubstitutionModel.h.

Constructor & Destructor Documentation

◆ MixtureOfASubstitutionModel() [1/2]

MixtureOfASubstitutionModel::MixtureOfASubstitutionModel ( const Alphabet *  alpha,
SubstitutionModel model,
std::map< std::string, DiscreteDistribution *>  parametersDistributionsList,
int  ffrom = -1,
int  tto = -1 
)
throw (Exception
)

Definition at line 51 of file MixtureOfASubstitutionModel.cpp.

Referenced by clone().

◆ MixtureOfASubstitutionModel() [2/2]

MixtureOfASubstitutionModel::MixtureOfASubstitutionModel ( const MixtureOfASubstitutionModel msm)

Definition at line 139 of file MixtureOfASubstitutionModel.cpp.

References distributionMap_.

◆ ~MixtureOfASubstitutionModel()

MixtureOfASubstitutionModel::~MixtureOfASubstitutionModel ( )
virtual

Definition at line 174 of file MixtureOfASubstitutionModel.cpp.

References distributionMap_.

Member Function Documentation

◆ addRateParameter() [1/2]

void AbstractSubstitutionModel::addRateParameter ( )
virtualinherited

◆ addRateParameter() [2/2]

virtual void bpp::SubstitutionModel::addRateParameter ( )
pure virtualinherited

◆ clone()

MixtureOfASubstitutionModel* bpp::MixtureOfASubstitutionModel::clone ( ) const
inlinevirtual

◆ d2Pij_dt2() [1/2]

virtual double bpp::AbstractSubstitutionModel::d2Pij_dt2 ( size_t  i,
size_t  j,
double  t 
) const
inlinevirtualinherited
Returns
The second order derivative of the probability of change from state i to state j with respect to time t, at time t.
See also
getd2Pij_dt2(), getStates()

Implements bpp::SubstitutionModel.

Reimplemented in bpp::F84, bpp::HKY85, bpp::JCprot, bpp::T92, bpp::K80, bpp::RN95, bpp::TN93, bpp::RE08, bpp::JCnuc, bpp::RN95s, and bpp::BinarySubstitutionModel.

Definition at line 281 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::getd2Pij_dt2().

◆ d2Pij_dt2() [2/2]

virtual double bpp::SubstitutionModel::d2Pij_dt2 ( size_t  i,
size_t  j,
double  t 
) const
pure virtualinherited
Returns
The second order derivative of the probability of change from state i to state j with respect to time t, at time t.
See also
getd2Pij_dt2(), getStates()

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, bpp::F84, bpp::HKY85, bpp::JCprot, bpp::T92, bpp::K80, bpp::RN95, bpp::TN93, bpp::RE08, bpp::JCnuc, bpp::RN95s, bpp::BinarySubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::d2Pij_dt2().

◆ dPij_dt() [1/2]

virtual double bpp::AbstractSubstitutionModel::dPij_dt ( size_t  i,
size_t  j,
double  t 
) const
inlinevirtualinherited
Returns
The first order derivative of the probability of change from state i to state j with respect to time t, at time t.
See also
getdPij_dt(), getStates()

Implements bpp::SubstitutionModel.

Reimplemented in bpp::F84, bpp::HKY85, bpp::JCprot, bpp::T92, bpp::K80, bpp::RN95, bpp::TN93, bpp::RE08, bpp::JCnuc, bpp::RN95s, and bpp::BinarySubstitutionModel.

Definition at line 280 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::getdPij_dt().

◆ dPij_dt() [2/2]

virtual double bpp::SubstitutionModel::dPij_dt ( size_t  i,
size_t  j,
double  t 
) const
pure virtualinherited
Returns
The first order derivative of the probability of change from state i to state j with respect to time t, at time t.
See also
getdPij_dt(), getStates()

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, bpp::F84, bpp::HKY85, bpp::JCprot, bpp::T92, bpp::K80, bpp::RN95, bpp::TN93, bpp::RE08, bpp::JCnuc, bpp::RN95s, bpp::BinarySubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::dPij_dt().

◆ enableEigenDecomposition() [1/4]

void bpp::AbstractSubstitutionModel::enableEigenDecomposition ( bool  yn)
inlinevirtualinherited

Set if eigenValues and Vectors must be computed.

Implements bpp::SubstitutionModel.

Definition at line 289 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::eigenDecompose_.

◆ enableEigenDecomposition() [2/4]

◆ enableEigenDecomposition() [3/4]

virtual void bpp::SubstitutionModel::enableEigenDecomposition ( bool  yn)
pure virtualinherited

◆ enableEigenDecomposition() [4/4]

virtual bool bpp::SubstitutionModel::enableEigenDecomposition ( )
pure virtualinherited

Tell if eigenValues and Vectors must be computed.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

◆ fireParameterChanged()

virtual void bpp::AbstractSubstitutionModel::fireParameterChanged ( const ParameterList &  parameters)
inlinevirtualinherited

◆ freq() [1/2]

virtual double bpp::SubstitutionModel::freq ( size_t  i) const
pure virtualinherited

◆ freq() [2/2]

virtual double bpp::AbstractSubstitutionModel::freq ( size_t  i) const
inlinevirtualinherited
Returns
Equilibrium frequency associated to character i.
See also
getFrequencies(), getStates()

Implements bpp::SubstitutionModel.

Definition at line 275 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::freq_.

◆ from()

int bpp::MixtureOfASubstitutionModel::from ( ) const
inline

Numbers of the states between which the substitution rates of all the submodels must be equal. If they are set to -1, this constraint does not exist among the submodels.

Definition at line 164 of file MixtureOfASubstitutionModel.h.

References from_.

Referenced by bpp::BppOSubstitutionModelFormat::writeMixed_().

◆ getAlphabet() [1/2]

◆ getAlphabet() [2/2]

virtual const Alphabet* bpp::SubstitutionModel::getAlphabet ( ) const
pure virtualinherited
Returns
Get the alphabet associated to this model.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AAExteriorSubstitutionRegister::AAExteriorSubstitutionRegister(), bpp::AAInteriorSubstitutionRegister::AAInteriorSubstitutionRegister(), bpp::SubstitutionModelSet::addModel(), bpp::DecompositionReward::alphabetIndexHasChanged(), bpp::ComprehensiveSubstitutionRegister::ComprehensiveSubstitutionRegister(), bpp::DecompositionReward::DecompositionReward(), bpp::DecompositionSubstitutionCount::DecompositionSubstitutionCount(), bpp::AbstractMutationProcess::detailedEvolve(), bpp::LaplaceSubstitutionCount::getAllNumbersOfSubstitutions(), bpp::AbstractSubstitutionRegister::getAlphabet(), bpp::AbstractBiblioSubstitutionModel::getAlphabet(), bpp::MarkovModulatedSubstitutionModel::getAlphabet(), bpp::SubstitutionMappingTools::getNormalizationsPerBranch(), bpp::DnDsSubstitutionRegister::getType(), bpp::SelectedSubstitutionRegister::SelectedSubstitutionRegister(), bpp::CategorySubstitutionRegister::setCategories(), bpp::LaplaceSubstitutionCount::setSubstitutionModel(), bpp::UniformizationSubstitutionCount::setSubstitutionModel(), bpp::DecompositionSubstitutionCount::setSubstitutionModel(), bpp::DecompositionReward::setSubstitutionModel(), bpp::UniformizationSubstitutionCount::substitutionRegisterHasChanged(), bpp::DecompositionSubstitutionCount::substitutionRegisterHasChanged(), bpp::UniformizationSubstitutionCount::UniformizationSubstitutionCount(), bpp::YpR::updateMatrices(), and bpp::BppOSubstitutionModelFormat::writeMixed_().

◆ getAlphabetStateAsChar() [1/2]

std::string bpp::AbstractSubstitutionModel::getAlphabetStateAsChar ( size_t  index) const
inlinevirtualinherited
Parameters
indexThe model state.
Returns
The corresponding alphabet state as character code.

Implements bpp::SubstitutionModel.

Definition at line 243 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::stateMap_.

◆ getAlphabetStateAsChar() [2/2]

virtual std::string bpp::SubstitutionModel::getAlphabetStateAsChar ( size_t  index) const
pure virtualinherited

◆ getAlphabetStateAsInt() [1/2]

int bpp::AbstractSubstitutionModel::getAlphabetStateAsInt ( size_t  index) const
inlinevirtualinherited
Parameters
indexThe model state.
Returns
The corresponding alphabet state as character code.

Implements bpp::SubstitutionModel.

Definition at line 245 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::stateMap_.

◆ getAlphabetStateAsInt() [2/2]

◆ getAlphabetStates() [1/2]

◆ getAlphabetStates() [2/2]

const std::vector<int>& bpp::AbstractSubstitutionModel::getAlphabetStates ( ) const
inlinevirtualinherited
Returns
The alphabet states of each state of the model, as a vector of int codes.
See also
Alphabet

Implements bpp::SubstitutionModel.

Definition at line 241 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::stateMap_.

◆ getColumnRightEigenVectors() [1/2]

const Matrix<double>& bpp::AbstractSubstitutionModel::getColumnRightEigenVectors ( ) const
inlinevirtualinherited
Returns
A matrix with right eigen vectors. Each column in the matrix stands for an eigen vector.

Implements bpp::SubstitutionModel.

Definition at line 273 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::rightEigenVectors_.

◆ getColumnRightEigenVectors() [2/2]

virtual const Matrix<double>& bpp::SubstitutionModel::getColumnRightEigenVectors ( ) const
pure virtualinherited

◆ getd2Pij_dt2()

const Matrix< double > & AbstractMixedSubstitutionModel::getd2Pij_dt2 ( double  t) const
virtualinherited
Returns
All second order derivatives of the probability of change from state i to state j with respect to time t, at time t.
See also
d2Pij_dt2()

Reimplemented from bpp::AbstractSubstitutionModel.

Definition at line 170 of file AbstractMixedSubstitutionModel.cpp.

References bpp::AbstractSubstitutionModel::d2pijt_, bpp::AbstractMixedSubstitutionModel::getNumberOfStates(), bpp::AbstractMixedSubstitutionModel::modelsContainer_, and bpp::AbstractMixedSubstitutionModel::vProbas_.

◆ getDistribution()

const DiscreteDistribution * MixtureOfASubstitutionModel::getDistribution ( std::string &  parName) const

returns the DiscreteDistribution associated with a given parameter name.

Parameters
parNamename of the parameter

Definition at line 184 of file MixtureOfASubstitutionModel.cpp.

References distributionMap_.

Referenced by bpp::BppOSubstitutionModelFormat::writeMixed_().

◆ getdPij_dt()

const Matrix< double > & AbstractMixedSubstitutionModel::getdPij_dt ( double  t) const
virtualinherited
Returns
Get all first order derivatives of the probability of change from state i to state j with respect to time t, at time t.
See also
dPij_dt()

Reimplemented from bpp::AbstractSubstitutionModel.

Definition at line 144 of file AbstractMixedSubstitutionModel.cpp.

References bpp::AbstractSubstitutionModel::dpijt_, bpp::AbstractMixedSubstitutionModel::getNumberOfStates(), bpp::AbstractMixedSubstitutionModel::modelsContainer_, and bpp::AbstractMixedSubstitutionModel::vProbas_.

◆ getEigenValues() [1/2]

const Vdouble& bpp::AbstractSubstitutionModel::getEigenValues ( ) const
inlinevirtualinherited
Returns
A vector with all real parts of the eigen values of the generator of this model;

Implements bpp::SubstitutionModel.

Definition at line 263 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::eigenValues_.

◆ getEigenValues() [2/2]

virtual const Vdouble& bpp::SubstitutionModel::getEigenValues ( ) const
pure virtualinherited

◆ getExchangeabilityMatrix() [1/2]

const Matrix<double>& bpp::AbstractSubstitutionModel::getExchangeabilityMatrix ( ) const
inlinevirtualinherited
Returns
The matrix of exchangeability terms. It is recommended that exchangeability matrix be normalized so that the normalized generator be obtained directly by the dot product $S . \pi$.

Implements bpp::SubstitutionModel.

Definition at line 255 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::exchangeability_.

◆ getExchangeabilityMatrix() [2/2]

virtual const Matrix<double>& bpp::SubstitutionModel::getExchangeabilityMatrix ( ) const
pure virtualinherited
Returns
The matrix of exchangeability terms. It is recommended that exchangeability matrix be normalized so that the normalized generator be obtained directly by the dot product $S . \pi$.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::Coala::Coala(), bpp::AbstractBiblioSubstitutionModel::getExchangeabilityMatrix(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices().

◆ getFrequencies() [1/2]

virtual const Vdouble& bpp::AbstractSubstitutionModel::getFrequencies ( ) const
inlinevirtualinherited
Returns
A vector of all equilibrium frequencies.
See also
freq()

Implements bpp::SubstitutionModel.

Definition at line 251 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::freq_.

◆ getFrequencies() [2/2]

◆ getFrequenciesSet()

◆ getGenerator() [1/2]

const Matrix<double>& bpp::AbstractSubstitutionModel::getGenerator ( ) const
inlinevirtualinherited
Returns
The normalized Markov generator matrix, i.e. all normalized rates of changes from state i to state j. The generator is normalized so that (i) $ \forall i; \sum_j Q_{i,j} = 0 $, meaning that $ $ \forall i; Q_{i,i} = -\sum_{j \neq i}Q_{i,j}$, and (ii) $ \sum_i Q_{i,i} \times \pi_i = -1$. This means that, under normalization, the mean rate of replacement at equilibrium is 1 and that time $t$ are measured in units of expected number of changes per site. Additionnaly, the rate_ attibute provides the possibility to increase or decrease this mean rate.

See Kosiol and Goldman (2005), Molecular Biology And Evolution 22(2) 193-9.

See also
Qij()

Implements bpp::SubstitutionModel.

Definition at line 253 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::generator_.

◆ getGenerator() [2/2]

virtual const Matrix<double>& bpp::SubstitutionModel::getGenerator ( ) const
pure virtualinherited
Returns
The normalized Markov generator matrix, i.e. all normalized rates of changes from state i to state j. The generator is normalized so that (i) $ \forall i; \sum_j Q_{i,j} = 0 $, meaning that $ $ \forall i; Q_{i,i} = -\sum_{j \neq i}Q_{i,j}$, and (ii) $ \sum_i Q_{i,i} \times \pi_i = -1$. This means that, under normalization, the mean rate of replacement at equilibrium is 1 and that time $t$ are measured in units of expected number of changes per site. Additionnaly, the rate_ attibute provides the possibility to increase or decrease this mean rate.

See Kosiol and Goldman (2005), Molecular Biology And Evolution 22(2) 193-9.

See also
Qij()

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::LaplaceSubstitutionCount::computeCounts(), bpp::UniformizationSubstitutionCount::computeCounts_(), bpp::AbstractBiblioSubstitutionModel::getGenerator(), bpp::SimpleMutationProcess::SimpleMutationProcess(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices().

◆ getIEigenValues() [1/2]

const Vdouble& bpp::AbstractSubstitutionModel::getIEigenValues ( ) const
inlinevirtualinherited
Returns
A vector with all imaginary parts of the eigen values of the generator of this model;

Implements bpp::SubstitutionModel.

Definition at line 265 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::iEigenValues_.

◆ getIEigenValues() [2/2]

virtual const Vdouble& bpp::SubstitutionModel::getIEigenValues ( ) const
pure virtualinherited
Returns
A vector with all imaginary parts of the eigen values of the generator of this model;

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::getIEigenValues().

◆ getInitValue() [1/2]

double AbstractSubstitutionModel::getInitValue ( size_t  i,
int  state 
) const
throw (IndexOutOfBoundsException,
BadIntException
)
virtualinherited

This method is used to initialize likelihoods in reccursions. 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.

Parameters
ithe index of the state in the model.
stateAn observed state in the sequence/site.
Returns
1 or 0 depending if the two states are compatible.
Exceptions
IndexOutOfBoundsExceptionif array position is out of range.
BadIntExceptionif states are not allowed in the associated alphabet.
See also
getStates();

Implements bpp::SubstitutionModel.

Reimplemented in bpp::RE08.

Definition at line 349 of file AbstractSubstitutionModel.cpp.

◆ getInitValue() [2/2]

virtual double bpp::SubstitutionModel::getInitValue ( size_t  i,
int  state 
) const
throw (IndexOutOfBoundsException,
BadIntException
)
pure virtualinherited

This method is used to initialize likelihoods in reccursions. 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.

Parameters
ithe index of the state in the model.
stateAn observed state in the sequence/site.
Returns
1 or 0 depending if the two states are compatible.
Exceptions
IndexOutOfBoundsExceptionif array position is out of range.
BadIntExceptionif states are not allowed in the associated alphabet.
See also
getStates();

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, bpp::RE08, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::getInitValue().

◆ getModelStates() [1/4]

virtual std::vector<size_t> bpp::SubstitutionModel::getModelStates ( int  code) const
pure virtualinherited

Get the state in the model corresponding to a particular state in the alphabet.

Parameters
codeThe alphabet state to check.
Returns
A vector of indices of model states.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::getModelStates(), bpp::SubstitutionModelSet::getModelStates(), and bpp::MarginalAncestralStateReconstruction::recursiveMarginalAncestralStates().

◆ getModelStates() [2/4]

virtual std::vector<size_t> bpp::SubstitutionModel::getModelStates ( const std::string &  code) const
pure virtualinherited

Get the state in the model corresponding to a particular state in the alphabet.

Parameters
codeThe alphabet state to check.
Returns
A vector of indices of model states.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

◆ getModelStates() [3/4]

std::vector<size_t> bpp::AbstractSubstitutionModel::getModelStates ( int  code) const
inlinevirtualinherited

Get the state in the model corresponding to a particular state in the alphabet.

Parameters
codeThe alphabet state to check.
Returns
A vector of indices of model states.

Implements bpp::SubstitutionModel.

Definition at line 247 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::stateMap_.

◆ getModelStates() [4/4]

std::vector<size_t> bpp::AbstractSubstitutionModel::getModelStates ( const std::string &  code) const
inlinevirtualinherited

Get the state in the model corresponding to a particular state in the alphabet.

Parameters
codeThe alphabet state to check.
Returns
A vector of indices of model states.

Implements bpp::SubstitutionModel.

Definition at line 249 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::stateMap_.

◆ getName()

std::string bpp::MixtureOfASubstitutionModel::getName ( ) const
inlinevirtual

Get the name of the model.

Returns
The name of this model.

Implements bpp::SubstitutionModel.

Definition at line 126 of file MixtureOfASubstitutionModel.h.

◆ getNModel() [1/2]

virtual const SubstitutionModel* bpp::AbstractMixedSubstitutionModel::getNModel ( size_t  i) const
inlinevirtualinherited

◆ getNModel() [2/2]

virtual SubstitutionModel* bpp::AbstractMixedSubstitutionModel::getNModel ( size_t  i)
inlinevirtualinherited

◆ getNProbability()

virtual double bpp::AbstractMixedSubstitutionModel::getNProbability ( size_t  i) const
inlinevirtualinherited

Returns the probability of a specific model from the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 179 of file AbstractMixedSubstitutionModel.h.

References bpp::AbstractMixedSubstitutionModel::vProbas_.

◆ getNRate()

double bpp::AbstractMixedSubstitutionModel::getNRate ( size_t  i) const
inlinevirtualinherited

Returns the rate of a specific model from the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 135 of file AbstractMixedSubstitutionModel.h.

References bpp::AbstractMixedSubstitutionModel::vRates_.

◆ getNumberOfModels()

virtual size_t bpp::AbstractMixedSubstitutionModel::getNumberOfModels ( ) const
inlinevirtualinherited

◆ getNumberOfStates()

◆ getPij_t()

const Matrix< double > & AbstractMixedSubstitutionModel::getPij_t ( double  t) const
virtualinherited

◆ getProbabilities()

virtual const std::vector<double>& bpp::AbstractMixedSubstitutionModel::getProbabilities ( ) const
inlinevirtualinherited

Returns the vector of probabilities.

Implements bpp::MixedSubstitutionModel.

Definition at line 189 of file AbstractMixedSubstitutionModel.h.

References bpp::AbstractMixedSubstitutionModel::vProbas_.

◆ getRate() [1/2]

double AbstractSubstitutionModel::getRate ( ) const
virtualinherited

Get the rate.

Implements bpp::SubstitutionModel.

Definition at line 415 of file AbstractSubstitutionModel.cpp.

References bpp::AbstractSubstitutionModel::rate_.

◆ getRate() [2/2]

virtual double bpp::SubstitutionModel::getRate ( ) const
pure virtualinherited

◆ getRowLeftEigenVectors() [1/2]

const Matrix<double>& bpp::AbstractSubstitutionModel::getRowLeftEigenVectors ( ) const
inlinevirtualinherited
Returns
A matrix with left eigen vectors. Each row in the matrix stands for an eigen vector.

Implements bpp::SubstitutionModel.

Definition at line 271 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::leftEigenVectors_.

◆ getRowLeftEigenVectors() [2/2]

virtual const Matrix<double>& bpp::SubstitutionModel::getRowLeftEigenVectors ( ) const
pure virtualinherited

◆ getScale() [1/2]

double AbstractSubstitutionModel::getScale ( ) const
virtualinherited

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.

Returns
Minus the scalar product of diagonal elements and the frequencies vector.

Implements bpp::SubstitutionModel.

Definition at line 400 of file AbstractSubstitutionModel.cpp.

References bpp::AbstractSubstitutionModel::freq_, and bpp::AbstractSubstitutionModel::generator_.

Referenced by bpp::AbstractReversibleSubstitutionModel::updateMatrices().

◆ getScale() [2/2]

virtual double bpp::SubstitutionModel::getScale ( ) const
pure virtualinherited

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.

Returns
Minus the scalar product of diagonal elements and the frequencies vector.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::getScale().

◆ getStateMap() [1/2]

virtual const StateMap& bpp::SubstitutionModel::getStateMap ( ) const
pure virtualinherited

◆ getStateMap() [2/2]

const StateMap& bpp::AbstractSubstitutionModel::getStateMap ( ) const
inlinevirtualinherited
Returns
The mapping of model states with alphabet states.

Implements bpp::SubstitutionModel.

Definition at line 239 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::stateMap_.

◆ getSubmodelNumbers()

Vint MixtureOfASubstitutionModel::getSubmodelNumbers ( std::string &  desc) const
virtual

◆ getVRates()

const std::vector<double>& bpp::AbstractMixedSubstitutionModel::getVRates ( ) const
inlinevirtualinherited

Returns the vector of all the rates of the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 170 of file AbstractMixedSubstitutionModel.h.

References bpp::AbstractMixedSubstitutionModel::vRates_.

◆ isDiagonalizable() [1/2]

bool bpp::AbstractSubstitutionModel::isDiagonalizable ( ) const
inlinevirtualinherited
Returns
True if the model is diagonalizable in R.

Implements bpp::SubstitutionModel.

Definition at line 267 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::isDiagonalizable_.

◆ isDiagonalizable() [2/2]

virtual bool bpp::SubstitutionModel::isDiagonalizable ( ) const
pure virtualinherited

◆ isNonSingular() [1/2]

bool bpp::AbstractSubstitutionModel::isNonSingular ( ) const
inlinevirtualinherited
Returns
True is the model is non-singular.

Implements bpp::SubstitutionModel.

Definition at line 269 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::isNonSingular_.

◆ isNonSingular() [2/2]

virtual bool bpp::SubstitutionModel::isNonSingular ( ) const
pure virtualinherited

◆ normalizeVRates()

void AbstractMixedSubstitutionModel::normalizeVRates ( )
virtualinherited

◆ operator=()

MixtureOfASubstitutionModel & MixtureOfASubstitutionModel::operator= ( const MixtureOfASubstitutionModel msm)

◆ Pij_t() [1/2]

virtual double bpp::SubstitutionModel::Pij_t ( size_t  i,
size_t  j,
double  t 
) const
pure virtualinherited

◆ Pij_t() [2/2]

virtual double bpp::AbstractSubstitutionModel::Pij_t ( size_t  i,
size_t  j,
double  t 
) const
inlinevirtualinherited
Returns
The probability of change from state i to state j during time t.
See also
getPij_t(), getStates()

Implements bpp::SubstitutionModel.

Reimplemented in bpp::F84, bpp::HKY85, bpp::JCprot, bpp::T92, bpp::K80, bpp::RN95, bpp::TN93, bpp::RE08, bpp::JCnuc, bpp::RN95s, and bpp::BinarySubstitutionModel.

Definition at line 279 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::getPij_t().

◆ Qij()

double bpp::AbstractMixedSubstitutionModel::Qij ( size_t  i,
size_t  j 
) const
inlinevirtualinherited

This function can not be applied here, so it is defined to prevent wrong usage.

Reimplemented from bpp::AbstractSubstitutionModel.

Definition at line 207 of file AbstractMixedSubstitutionModel.h.

Referenced by updateMatrices().

◆ setFreq()

void MixtureOfASubstitutionModel::setFreq ( std::map< int, double > &  m)
virtual

sets the eq frequencies of the first nested model, and adapts the parameters at best to it (surely there is a better way to manage this).

Reimplemented from bpp::AbstractSubstitutionModel.

Definition at line 273 of file MixtureOfASubstitutionModel.cpp.

References bpp::AbstractMixedSubstitutionModel::modelsContainer_.

◆ setFreqFromData() [1/2]

void AbstractSubstitutionModel::setFreqFromData ( const SequenceContainer &  data,
double  pseudoCount = 0 
)
virtualinherited

Set equilibrium frequencies equal to the frequencies estimated from the data.

Parameters
dataThe sequences to use.
pseudoCountA quantity $\psi$ 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

\[ \pi_i = \frac{n_i+\psi}{\sum_j (f_j+\psi)} \]

Implements bpp::SubstitutionModel.

Reimplemented in bpp::JCprot, bpp::K80, bpp::RE08, bpp::JCnuc, bpp::UserProteinSubstitutionModel, bpp::WAG01, bpp::DSO78, bpp::JTT92, bpp::LG08, and bpp::Coala.

Definition at line 366 of file AbstractSubstitutionModel.cpp.

References bpp::AbstractSubstitutionModel::setFreq(), and bpp::AbstractSubstitutionModel::size_.

◆ setFreqFromData() [2/2]

virtual void bpp::SubstitutionModel::setFreqFromData ( const SequenceContainer &  data,
double  pseudoCount = 0 
)
pure virtualinherited

Set equilibrium frequencies equal to the frequencies estimated from the data.

Parameters
dataThe sequences to use.
pseudoCountA quantity $\psi$ 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

\[ \pi_i = \frac{n_i+\psi}{\sum_j (f_j+\psi)} \]

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, bpp::JCprot, bpp::K80, bpp::RE08, bpp::JCnuc, bpp::UserProteinSubstitutionModel, bpp::AbstractBiblioSubstitutionModel, bpp::WAG01, bpp::DSO78, bpp::JTT92, bpp::LG08, and bpp::Coala.

Referenced by bpp::BppOSubstitutionModelFormat::read(), bpp::AbstractBiblioSubstitutionModel::setFreqFromData(), and bpp::MarkovModulatedSubstitutionModel::setFreqFromData().

◆ setNProbability()

virtual void bpp::AbstractMixedSubstitutionModel::setNProbability ( size_t  i,
double  prob 
)
inlinevirtualinherited

Sets the probability of a specific model from the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 197 of file AbstractMixedSubstitutionModel.h.

References bpp::AbstractMixedSubstitutionModel::vProbas_.

◆ setRate()

void AbstractMixedSubstitutionModel::setRate ( double  rate)
virtualinherited

◆ setScale() [1/2]

void AbstractSubstitutionModel::setScale ( double  scale)
virtualinherited

Multiplies the current generator by the given scale.

Parameters
scalethe scale by which the generator is multiplied.

Implements bpp::SubstitutionModel.

Definition at line 409 of file AbstractSubstitutionModel.cpp.

References bpp::AbstractSubstitutionModel::generator_.

◆ setScale() [2/2]

virtual void bpp::SubstitutionModel::setScale ( double  scale)
pure virtualinherited

Multiplies the current generator by the given scale.

Parameters
scalethe scale by which the generator is multiplied.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::setScale(), and bpp::MarkovModulatedSubstitutionModel::setScale().

◆ setVRates()

void AbstractMixedSubstitutionModel::setVRates ( const Vdouble &  vd)
virtualinherited

Sets the rates of the submodels to be proportional to a given vector, with the constraint that the mean rate of the mixture equals rate_.

Parameters
vda vector of positive values such that the rates of the respective submodels are in the same proportions (ie this vector does not need to be normalized).

Implements bpp::MixedSubstitutionModel.

Reimplemented in bpp::MixtureOfSubstitutionModels.

Definition at line 216 of file AbstractMixedSubstitutionModel.cpp.

References bpp::AbstractMixedSubstitutionModel::modelsContainer_, bpp::AbstractMixedSubstitutionModel::normalizeVRates(), and bpp::AbstractMixedSubstitutionModel::vRates_.

Referenced by bpp::MixtureOfSubstitutionModels::setVRates(), and updateMatrices().

◆ Sij() [1/2]

double bpp::AbstractSubstitutionModel::Sij ( size_t  i,
size_t  j 
) const
inlinevirtualinherited
Returns
The exchangeability between state i and state j.

By definition Sij(i,j) = Sij(j,i).

Implements bpp::SubstitutionModel.

Definition at line 257 of file AbstractSubstitutionModel.h.

References bpp::AbstractSubstitutionModel::exchangeability_.

◆ Sij() [2/2]

virtual double bpp::SubstitutionModel::Sij ( size_t  i,
size_t  j 
) const
pure virtualinherited
Returns
The exchangeability between state i and state j.

By definition Sij(i,j) = Sij(j,i).

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::Sij().

◆ to()

int bpp::MixtureOfASubstitutionModel::to ( ) const
inline

Definition at line 165 of file MixtureOfASubstitutionModel.h.

References to_.

Referenced by bpp::BppOSubstitutionModelFormat::writeMixed_().

◆ updateMatrices()

void MixtureOfASubstitutionModel::updateMatrices ( )
virtual

Diagonalize the $Q$ matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVectors_ matrices.

The generator_ matrix and freq_ vector must be initialized.

Eigen values and vectors are computed from the generator and assigned to the eigenValues_ for the real part, iEigenValues_ for the imaginary part, rightEigenVectors_ and leftEigenVectors_ variables. isDiagonalizable_ checks if the generator_ is diagonalizable in R.

The optional rate parameter is not taken into account in this method to prevent unnecessary computation.

Reimplemented from bpp::AbstractSubstitutionModel.

Definition at line 192 of file MixtureOfASubstitutionModel.cpp.

References distributionMap_, bpp::AbstractSubstitutionModel::freq_, from_, bpp::AbstractMixedSubstitutionModel::getNModel(), bpp::AbstractMixedSubstitutionModel::getNumberOfStates(), bpp::AbstractMixedSubstitutionModel::modelsContainer_, bpp::AbstractMixedSubstitutionModel::Qij(), bpp::AbstractMixedSubstitutionModel::setVRates(), to_, and bpp::AbstractMixedSubstitutionModel::vProbas_.

Member Data Documentation

◆ alphabet_

◆ d2pijt_

◆ distributionMap_

std::map<std::string, DiscreteDistribution*> bpp::MixtureOfASubstitutionModel::distributionMap_
private

◆ dpijt_

RowMatrix<double> bpp::AbstractSubstitutionModel::dpijt_
mutableprotectedinherited

◆ eigenDecompose_

bool bpp::AbstractSubstitutionModel::eigenDecompose_
protectedinherited

◆ eigenValues_

◆ exchangeability_

◆ freq_

Vdouble bpp::AbstractSubstitutionModel::freq_
protectedinherited

The vector $\pi_e$ of equilibrium frequencies.

Definition at line 113 of file AbstractSubstitutionModel.h.

Referenced by bpp::AbstractSubstitutionModel::AbstractSubstitutionModel(), bpp::WordSubstitutionModel::completeMatrices(), bpp::Coala::computeEquilibriumFrequencies(), bpp::RE08::d2Pij_dt2(), bpp::RE08::dPij_dt(), bpp::DSO78::DSO78(), bpp::LG08::fireParameterChanged(), bpp::DSO78::fireParameterChanged(), bpp::JTT92::fireParameterChanged(), bpp::WAG01::fireParameterChanged(), bpp::UserProteinSubstitutionModel::fireParameterChanged(), bpp::JCprot::fireParameterChanged(), bpp::AbstractSubstitutionModel::freq(), bpp::RE08::getd2Pij_dt2(), bpp::RE08::getdPij_dt(), bpp::AbstractSubstitutionModel::getFrequencies(), bpp::RN95s::getPij_t(), bpp::RE08::getPij_t(), bpp::RN95::getPij_t(), bpp::AbstractSubstitutionModel::getScale(), bpp::JCprot::JCprot(), bpp::JTT92::JTT92(), bpp::LG08::LG08(), bpp::AbstractSubstitutionModel::operator=(), bpp::RN95s::Pij_t(), bpp::RE08::Pij_t(), bpp::RN95::Pij_t(), bpp::RE08::RE08(), bpp::UserProteinSubstitutionModel::readFromFile(), bpp::AbstractSubstitutionModel::setFreq(), bpp::LG08::setFreqFromData(), bpp::DSO78::setFreqFromData(), bpp::JTT92::setFreqFromData(), bpp::WAG01::setFreqFromData(), bpp::UserProteinSubstitutionModel::setFreqFromData(), bpp::JCprot::setFreqFromData(), bpp::AbstractWordSubstitutionModel::updateMatrices(), bpp::gBGC::updateMatrices(), bpp::L95::updateMatrices(), bpp::SSR::updateMatrices(), updateMatrices(), bpp::BinarySubstitutionModel::updateMatrices(), bpp::RN95s::updateMatrices(), bpp::MixtureOfSubstitutionModels::updateMatrices(), bpp::YpR::updateMatrices(), bpp::GTR::updateMatrices(), bpp::RN95::updateMatrices(), bpp::TN93::updateMatrices(), bpp::JCnuc::updateMatrices(), bpp::K80::updateMatrices(), bpp::T92::updateMatrices(), bpp::RE08::updateMatrices(), bpp::HKY85::updateMatrices(), bpp::F84::updateMatrices(), bpp::JCprot::updateMatrices(), bpp::AbstractSubstitutionModel::updateMatrices(), bpp::AbstractReversibleSubstitutionModel::updateMatrices(), bpp::UserProteinSubstitutionModel::UserProteinSubstitutionModel(), and bpp::WAG01::WAG01().

◆ from_

int bpp::MixtureOfASubstitutionModel::from_
private

Definition at line 108 of file MixtureOfASubstitutionModel.h.

Referenced by from(), operator=(), and updateMatrices().

◆ generator_

◆ iEigenValues_

◆ isDiagonalizable_

◆ isNonSingular_

◆ leftEigenVectors_

◆ modelsContainer_

◆ pijt_

RowMatrix<double> bpp::AbstractSubstitutionModel::pijt_
mutableprotectedinherited

◆ rate_

double bpp::AbstractSubstitutionModel::rate_
protectedinherited

The rate of the model (default: 1). The generator (and all its vectorial components) is independent of the rate, since it should be normalized.

Definition at line 103 of file AbstractSubstitutionModel.h.

Referenced by bpp::AbstractSubstitutionModel::addRateParameter(), bpp::RN95s::d2Pij_dt2(), bpp::JCnuc::d2Pij_dt2(), bpp::TN93::d2Pij_dt2(), bpp::RN95::d2Pij_dt2(), bpp::K80::d2Pij_dt2(), bpp::T92::d2Pij_dt2(), bpp::JCprot::d2Pij_dt2(), bpp::HKY85::d2Pij_dt2(), bpp::F84::d2Pij_dt2(), bpp::RN95s::dPij_dt(), bpp::JCnuc::dPij_dt(), bpp::TN93::dPij_dt(), bpp::RN95::dPij_dt(), bpp::K80::dPij_dt(), bpp::T92::dPij_dt(), bpp::JCprot::dPij_dt(), bpp::HKY85::dPij_dt(), bpp::F84::dPij_dt(), bpp::WordSubstitutionModel::getd2Pij_dt2(), bpp::RN95s::getd2Pij_dt2(), bpp::JCnuc::getd2Pij_dt2(), bpp::TN93::getd2Pij_dt2(), bpp::RN95::getd2Pij_dt2(), bpp::K80::getd2Pij_dt2(), bpp::T92::getd2Pij_dt2(), bpp::JCprot::getd2Pij_dt2(), bpp::F84::getd2Pij_dt2(), bpp::HKY85::getd2Pij_dt2(), bpp::AbstractSubstitutionModel::getd2Pij_dt2(), bpp::WordSubstitutionModel::getdPij_dt(), bpp::RN95s::getdPij_dt(), bpp::JCnuc::getdPij_dt(), bpp::TN93::getdPij_dt(), bpp::RN95::getdPij_dt(), bpp::K80::getdPij_dt(), bpp::T92::getdPij_dt(), bpp::JCprot::getdPij_dt(), bpp::F84::getdPij_dt(), bpp::HKY85::getdPij_dt(), bpp::AbstractSubstitutionModel::getdPij_dt(), bpp::WordSubstitutionModel::getPij_t(), bpp::RN95s::getPij_t(), bpp::JCnuc::getPij_t(), bpp::TN93::getPij_t(), bpp::RN95::getPij_t(), bpp::K80::getPij_t(), bpp::T92::getPij_t(), bpp::JCprot::getPij_t(), bpp::F84::getPij_t(), bpp::HKY85::getPij_t(), bpp::AbstractSubstitutionModel::getPij_t(), bpp::AbstractSubstitutionModel::getRate(), bpp::AbstractMixedSubstitutionModel::normalizeVRates(), bpp::AbstractSubstitutionModel::operator=(), bpp::RN95s::Pij_t(), bpp::JCnuc::Pij_t(), bpp::TN93::Pij_t(), bpp::RN95::Pij_t(), bpp::K80::Pij_t(), bpp::T92::Pij_t(), bpp::JCprot::Pij_t(), bpp::F84::Pij_t(), bpp::HKY85::Pij_t(), bpp::AbstractMixedSubstitutionModel::setRate(), bpp::AbstractSubstitutionModel::setRate(), and bpp::BinarySubstitutionModel::updateMatrices().

◆ rightEigenVectors_

◆ size_

◆ stateMap_

◆ tmpMat_

◆ to_

int bpp::MixtureOfASubstitutionModel::to_
private

Definition at line 108 of file MixtureOfASubstitutionModel.h.

Referenced by operator=(), to(), and updateMatrices().

◆ vPowGen_

◆ vProbas_

◆ vRates_

std::vector<double> bpp::AbstractMixedSubstitutionModel::vRates_
protectedinherited

vector of the rates of the models.

For the computation of the transition probabilities, the rates are included in the submodels while updating the mixture, so there is no need to multiply here the transition times with the rates.

The mean (on the distribution of the models) of the elements of this vector equals the overall rate of the mixture model, that is rate_;

Definition at line 97 of file AbstractMixedSubstitutionModel.h.

Referenced by bpp::AbstractMixedSubstitutionModel::AbstractMixedSubstitutionModel(), bpp::AbstractMixedSubstitutionModel::getNRate(), bpp::AbstractMixedSubstitutionModel::getVRates(), bpp::MixtureOfSubstitutionModels::MixtureOfSubstitutionModels(), bpp::AbstractMixedSubstitutionModel::normalizeVRates(), bpp::AbstractMixedSubstitutionModel::operator=(), bpp::AbstractMixedSubstitutionModel::setRate(), bpp::AbstractMixedSubstitutionModel::setVRates(), bpp::MixtureOfSubstitutionModels::setVRates(), and bpp::MixtureOfSubstitutionModels::updateMatrices().


The documentation for this class was generated from the following files: