bpp-phyl  2.2.0
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
bpp::LLG08_EHO Class Referenceabstract

The Le et al (2008) EH0 substitution model for proteins. More...

#include <Bpp/Phyl/Model/Protein/LLG08_EHO.h>

+ Inheritance diagram for bpp::LLG08_EHO:
+ Collaboration diagram for bpp::LLG08_EHO:

Classes

class  EmbeddedModel
 

Public Member Functions

 LLG08_EHO (const ProteicAlphabet *alpha)
 Build a EH0 model, with original equilibrium frequencies, probabilities and rates. More...
 
 ~LLG08_EHO ()
 
LLG08_EHOclone () const
 
 LLG08_EHO (const LLG08_EHO &)
 
LLG08_EHOoperator= (const LLG08_EHO &)
 
const SubstitutionModelgetModel () const
 
const MixedSubstitutionModelgetMixedModel () const
 
std::string getName () const
 Get the name of the model. More...
 
const SubstitutionModelgetNModel (size_t i) const
 Returns a specific model from the mixture. More...
 
SubstitutionModelgetNModel (size_t i)
 
double getNProbability (size_t i) const
 Returns the probability of a specific model from the mixture. More...
 
const std::vector< double > & getProbabilities () const
 Returns the vector of the probabilities of the submodels of the mixture. More...
 
void setNProbability (size_t i, double prob)
 Sets the probabilities of the submodels of the mixture. More...
 
size_t getNumberOfModels () const
 Returns the number of submodels. More...
 
void setVRates (const Vdouble &vd)
 sets the rates of the submodels. More...
 
void normalizeVRates ()
 normalizes the rates of the submodels. More...
 
const std::vector< double > & getVRates () const
 Returns the vector of all the rates of the mixture. More...
 
double getNRate (size_t i) const
 Returns the rate of a specific model from the mixture. More...
 
Vint getSubmodelNumbers (std::string &desc) 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 i) const
 
virtual std::string getAlphabetStateAsChar (size_t index) const =0
 
std::string getAlphabetStateAsChar (size_t i) const
 
virtual double freq (size_t i) const =0
 
virtual double freq (size_t i) const
 
virtual double Qij (size_t i, size_t j) const =0
 
virtual double Qij (size_t i, size_t j) 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 VdoublegetFrequencies () const =0
 
virtual const VdoublegetFrequencies () 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 const Matrix< double > & getPij_t (double t) const =0
 
const Matrix< double > & getPij_t (double t) const
 
virtual const Matrix< double > & getdPij_dt (double t) const =0
 
const Matrix< double > & getdPij_dt (double t) const
 
virtual const Matrix< double > & getd2Pij_dt2 (double t) const =0
 
const Matrix< double > & getd2Pij_dt2 (double t) 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 VdoublegetEigenValues () const =0
 
const VdoublegetEigenValues () const
 
virtual const VdoublegetIEigenValues () const =0
 
const VdoublegetIEigenValues () 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 AlphabetgetAlphabet () const =0
 
const AlphabetgetAlphabet () const
 
virtual size_t getNumberOfStates () const =0
 Get the number of states. More...
 
size_t getNumberOfStates () const
 Get the number of states. More...
 
virtual double getInitValue (size_t i, int state) const =0 throw (IndexOutOfBoundsException, BadIntException)
 
double getInitValue (size_t i, int state) const throw (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...
 
double getRate () const
 Get the rate. More...
 
virtual void setRate (double rate)=0
 Set the rate of the model (must be positive). More...
 
void setRate (double rate)
 Set the rate of the model (must be positive). 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 void setFreq (std::map< int, double > &frequencies)
 Set equilibrium frequencies. More...
 
void setFreq (std::map< int, double > &frequ)
 Set equilibrium frequencies. More...
 
virtual const FrequenciesSetgetFrequenciesSet () const
 If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0. More...
 
const FrequenciesSetgetFrequenciesSet () const
 If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0. More...
 
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 ParameterListgetIndependentParameters () const =0
 
const ParameterListgetIndependentParameters () const
 
virtual std::vector< std::string > getAlias (const std::string &name) const =0
 
std::vector< std::string > getAlias (const std::string &name) const
 
virtual void fireParameterChanged (const ParameterList &parameters)
 Tells the model that a parameter value has changed. More...
 
void setNamespace (const std::string &prefix)
 
ParameterList getAliasedParameters (const ParameterList &pl) const
 
std::string getFrom (const std::string &name) const
 
bool hasParameter (const std::string &name) const
 
const ParameterListgetParameters () const
 
const ParametergetParameter (const std::string &name) const
 
double getParameterValue (const std::string &name) const
 
void setAllParametersValues (const ParameterList &parameters)
 
void setParameterValue (const std::string &name, double value)
 
void setParametersValues (const ParameterList &parameters)
 
bool matchParametersValues (const ParameterList &parameters)
 
size_t getNumberOfParameters () const
 
std::string getNamespace () const
 
std::string getParameterNameWithoutNamespace (const std::string &name) const
 

Protected Member Functions

virtual void updateMatrices ()
 
void addParameter_ (Parameter *parameter)
 
void addParameters_ (const ParameterList &parameters)
 
void deleteParameter_ (size_t index)
 
void deleteParameter_ (std::string &name)
 
void deleteParameters_ (const std::vector< std::string > &names)
 
void resetParameters_ ()
 
void includeParameters_ (const ParameterList &parameters)
 
ParametergetParameter_ (const std::string &name)
 
ParametergetParameter_ (size_t index)
 
const ParametergetParameter_ (size_t index) const
 
ParametergetParameterWithNamespace_ (const std::string &name)
 
const ParametergetParameterWithNamespace_ (const std::string &name) const
 
ParameterListgetParameters_ ()
 

Protected Attributes

std::map< std::string,
std::string > 
mapParNamesFromPmodel_
 Tools to make the link between the Parameters of the object and those of pmixmodel_. More...
 
ParameterList lParPmodel_
 

Private Member Functions

SubstitutionModelgetModel ()
 
MixedSubstitutionModelgetMixedModel ()
 

Private Attributes

auto_ptr
< MixtureOfSubstitutionModels
pmixmodel_
 

Detailed Description

The Le et al (2008) EH0 substitution model for proteins.

Author
Laurent Gu├ęguen

This model is a mixture of three models corresponding to extended/helix/other sites in proteins. The models are considered in this order.

This model includes 4 parameters :

  • relrate1 is the relative rate of model of extended sites;
  • relrate2 is the relative rate of helix sites;
  • relproba1 is the proportion of extended sites;
  • relproba2 is the ratio of the proportions of helix sites over the sum of the proportion of helix sites plus the proportion of other sites.

Important: See the relation between these parameters and the rates and probabilities of the models in the description of MixtureOfSubstitutionModels class.

Reference:

Le S.Q., Lartillot N., Gascuel O. (2008) Phil. Trans. R. Soc. B 363:3965–3976.

Definition at line 78 of file LLG08_EHO.h.

Constructor & Destructor Documentation

LLG08_EHO::~LLG08_EHO ( )

Definition at line 99 of file LLG08_EHO.cpp.

LLG08_EHO::LLG08_EHO ( const LLG08_EHO mod2)

Definition at line 87 of file LLG08_EHO.cpp.

Member Function Documentation

virtual void bpp::SubstitutionModel::addRateParameter ( )
pure virtualinherited
LLG08_EHO* bpp::LLG08_EHO::clone ( ) const
inlinevirtual

Implements bpp::AbstractBiblioMixedSubstitutionModel.

Definition at line 113 of file LLG08_EHO.h.

virtual double bpp::AbstractBiblioSubstitutionModel::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.

Definition at line 112 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::d2Pij_dt2(), and bpp::AbstractBiblioSubstitutionModel::getModel().

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().

virtual double bpp::AbstractBiblioSubstitutionModel::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.

Definition at line 111 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::dPij_dt(), and bpp::AbstractBiblioSubstitutionModel::getModel().

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().

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

Set if eigenValues and Vectors must be computed.

Implements bpp::SubstitutionModel.

Definition at line 128 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::enableEigenDecomposition(), and bpp::AbstractBiblioSubstitutionModel::getModel().

bool bpp::AbstractBiblioSubstitutionModel::enableEigenDecomposition ( )
inlinevirtualinherited

Tell if eigenValues and Vectors must be computed.

Implements bpp::SubstitutionModel.

Definition at line 130 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::enableEigenDecomposition(), and bpp::AbstractBiblioSubstitutionModel::getModel().

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

Tell if eigenValues and Vectors must be computed.

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

virtual void bpp::AbstractBiblioSubstitutionModel::fireParameterChanged ( const ParameterList parameters)
inlinevirtualinherited

Tells the model that a parameter value has changed.

This updates the matrices consequently.

Reimplemented from bpp::AbstractParameterAliasable.

Definition at line 177 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractParameterAliasable::fireParameterChanged(), bpp::AbstractParameterAliasable::getNamespace(), bpp::ParameterList::size(), and bpp::AbstractBiblioSubstitutionModel::updateMatrices().

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

Implements bpp::SubstitutionModel.

Definition at line 106 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::freq(), and bpp::AbstractBiblioSubstitutionModel::getModel().

virtual double bpp::SubstitutionModel::freq ( size_t  i) const
pure virtualinherited
const Alphabet* bpp::AbstractBiblioSubstitutionModel::getAlphabet ( ) const
inlinevirtualinherited
Returns
Get the alphabet associated to this model.

Implements bpp::SubstitutionModel.

Definition at line 153 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getAlphabet(), and bpp::AbstractBiblioSubstitutionModel::getModel().

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_().

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

Implements bpp::SubstitutionModel.

Definition at line 100 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getAlphabetStateAsChar(), and bpp::AbstractBiblioSubstitutionModel::getModel().

virtual std::string bpp::SubstitutionModel::getAlphabetStateAsChar ( size_t  index) const
pure virtualinherited
int bpp::AbstractBiblioSubstitutionModel::getAlphabetStateAsInt ( size_t  index) const
inlinevirtualinherited
Parameters
indexThe model state.
Returns
The corresponding alphabet state as character code.

Implements bpp::SubstitutionModel.

Definition at line 98 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getAlphabetStateAsInt(), and bpp::AbstractBiblioSubstitutionModel::getModel().

const std::vector<int>& bpp::AbstractBiblioSubstitutionModel::getAlphabetStates ( ) const
inlinevirtualinherited
const Matrix<double>& bpp::AbstractBiblioSubstitutionModel::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 141 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getColumnRightEigenVectors(), and bpp::AbstractBiblioSubstitutionModel::getModel().

virtual const Matrix<double>& bpp::SubstitutionModel::getColumnRightEigenVectors ( ) const
pure virtualinherited
const Matrix<double>& bpp::AbstractBiblioSubstitutionModel::getd2Pij_dt2 ( double  t) const
inlinevirtualinherited
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()

Implements bpp::SubstitutionModel.

Definition at line 126 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getd2Pij_dt2(), and bpp::AbstractBiblioSubstitutionModel::getModel().

const Matrix<double>& bpp::AbstractBiblioSubstitutionModel::getdPij_dt ( double  t) const
inlinevirtualinherited
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()

Implements bpp::SubstitutionModel.

Definition at line 124 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getdPij_dt(), and bpp::AbstractBiblioSubstitutionModel::getModel().

const Vdouble& bpp::AbstractBiblioSubstitutionModel::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 136 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getEigenValues(), and bpp::AbstractBiblioSubstitutionModel::getModel().

virtual const Vdouble& bpp::SubstitutionModel::getEigenValues ( ) const
pure virtualinherited
const Matrix<double>& bpp::AbstractBiblioSubstitutionModel::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 118 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getExchangeabilityMatrix(), and bpp::AbstractBiblioSubstitutionModel::getModel().

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().

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

Implements bpp::SubstitutionModel.

Definition at line 114 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getFrequencies(), and bpp::AbstractBiblioSubstitutionModel::getModel().

const FrequenciesSet* bpp::AbstractBiblioSubstitutionModel::getFrequenciesSet ( ) const
inlinevirtualinherited

If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0.

Reimplemented from bpp::SubstitutionModel.

Reimplemented in bpp::YNGKP_M1, bpp::YNGKP_M8, bpp::YNGKP_M7, bpp::YNGKP_M3, and bpp::YNGKP_M2.

Definition at line 159 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getFrequenciesSet(), and bpp::AbstractBiblioSubstitutionModel::getModel().

const Matrix<double>& bpp::AbstractBiblioSubstitutionModel::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 116 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getGenerator(), and bpp::AbstractBiblioSubstitutionModel::getModel().

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().

const Vdouble& bpp::AbstractBiblioSubstitutionModel::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 138 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getIEigenValues(), and bpp::AbstractBiblioSubstitutionModel::getModel().

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().

double bpp::AbstractBiblioSubstitutionModel::getInitValue ( size_t  i,
int  state 
) const
throw (BadIntException
)
inlinevirtualinherited

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.

Definition at line 157 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getInitValue(), and bpp::AbstractBiblioSubstitutionModel::getModel().

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().

const MixedSubstitutionModel& bpp::LLG08_EHO::getMixedModel ( ) const
inlinevirtual

Implements bpp::AbstractBiblioMixedSubstitutionModel.

Definition at line 121 of file LLG08_EHO.h.

MixedSubstitutionModel& bpp::LLG08_EHO::getMixedModel ( )
inlineprivatevirtual

Implements bpp::AbstractBiblioMixedSubstitutionModel.

Definition at line 128 of file LLG08_EHO.h.

const SubstitutionModel& bpp::LLG08_EHO::getModel ( ) const
inlinevirtual

Implements bpp::AbstractBiblioSubstitutionModel.

Definition at line 119 of file LLG08_EHO.h.

SubstitutionModel& bpp::LLG08_EHO::getModel ( )
inlineprivatevirtual

Implements bpp::AbstractBiblioSubstitutionModel.

Definition at line 126 of file LLG08_EHO.h.

std::vector<size_t> bpp::AbstractBiblioSubstitutionModel::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 102 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getModelStates().

std::vector<size_t> bpp::AbstractBiblioSubstitutionModel::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 104 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getModelStates().

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().

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.

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

Get the name of the model.

Returns
The name of this model.

Implements bpp::SubstitutionModel.

Definition at line 123 of file LLG08_EHO.h.

const SubstitutionModel* bpp::AbstractBiblioMixedSubstitutionModel::getNModel ( size_t  i) const
inlinevirtualinherited
SubstitutionModel* bpp::AbstractBiblioMixedSubstitutionModel::getNModel ( size_t  i)
inlinevirtualinherited
double bpp::AbstractBiblioMixedSubstitutionModel::getNProbability ( size_t  i) const
inlinevirtualinherited

Returns the probability of a specific model from the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 91 of file AbstractBiblioMixedSubstitutionModel.h.

References bpp::AbstractBiblioMixedSubstitutionModel::getMixedModel(), and bpp::MixedSubstitutionModel::getNProbability().

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

Returns the rate of a specific model from the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 155 of file AbstractBiblioMixedSubstitutionModel.h.

References bpp::AbstractBiblioMixedSubstitutionModel::getMixedModel(), and bpp::MixedSubstitutionModel::getNRate().

size_t bpp::AbstractBiblioMixedSubstitutionModel::getNumberOfModels ( ) const
inlinevirtualinherited
size_t bpp::AbstractBiblioSubstitutionModel::getNumberOfStates ( ) const
inlinevirtualinherited

Get the number of states.

For most models, this equals the size of the alphabet.

See Also
getAlphabetChars for the list of supported states.
Returns
The number of different states in the model.

Implements bpp::SubstitutionModel.

Definition at line 155 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getNumberOfStates().

const Matrix<double>& bpp::AbstractBiblioSubstitutionModel::getPij_t ( double  t) const
inlinevirtualinherited
Returns
All probabilities of change from state i to state j during time t.
See Also
Pij_t()

Implements bpp::SubstitutionModel.

Definition at line 122 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getPij_t().

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

Returns the vector of the probabilities of the submodels of the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 102 of file AbstractBiblioMixedSubstitutionModel.h.

References bpp::AbstractBiblioMixedSubstitutionModel::getMixedModel(), and bpp::MixedSubstitutionModel::getProbabilities().

virtual double bpp::SubstitutionModel::getRate ( ) const
pure virtualinherited
const Matrix<double>& bpp::AbstractBiblioSubstitutionModel::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 140 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getRowLeftEigenVectors().

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

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 190 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getScale().

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().

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

Implements bpp::SubstitutionModel.

Definition at line 96 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getStateMap().

virtual const StateMap& bpp::SubstitutionModel::getStateMap ( ) const
pure virtualinherited
const std::vector<double>& bpp::AbstractBiblioMixedSubstitutionModel::getVRates ( ) const
inlinevirtualinherited

Returns the vector of all the rates of the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 147 of file AbstractBiblioMixedSubstitutionModel.h.

References bpp::AbstractBiblioMixedSubstitutionModel::getMixedModel(), and bpp::MixedSubstitutionModel::getVRates().

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

Implements bpp::SubstitutionModel.

Definition at line 132 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::isDiagonalizable().

virtual bool bpp::SubstitutionModel::isDiagonalizable ( ) const
pure virtualinherited
bool bpp::AbstractBiblioSubstitutionModel::isNonSingular ( ) const
inlinevirtualinherited
Returns
True is the model is non-singular.

Implements bpp::SubstitutionModel.

Definition at line 134 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::isNonSingular().

virtual bool bpp::SubstitutionModel::isNonSingular ( ) const
pure virtualinherited
void bpp::AbstractBiblioMixedSubstitutionModel::normalizeVRates ( )
inlinevirtualinherited
LLG08_EHO & LLG08_EHO::operator= ( const LLG08_EHO mod2)
virtual double bpp::AbstractBiblioSubstitutionModel::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.

Definition at line 110 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::Pij_t().

virtual double bpp::SubstitutionModel::Pij_t ( size_t  i,
size_t  j,
double  t 
) const
pure virtualinherited
virtual double bpp::AbstractBiblioSubstitutionModel::Qij ( size_t  i,
size_t  j 
) const
inlinevirtualinherited
Returns
The rate in the generator of change from state i to state j.
See Also
getStates();

Implements bpp::SubstitutionModel.

Definition at line 108 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::Qij().

void AbstractBiblioSubstitutionModel::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.

Definition at line 110 of file AbstractBiblioSubstitutionModel.cpp.

References bpp::ParameterList::addParameter(), bpp::AbstractBiblioSubstitutionModel::getModel(), bpp::AbstractParameterAliasable::getNamespace(), bpp::AbstractParameterAliasable::getParameterNameWithoutNamespace(), bpp::AbstractParameterAliasable::getParameterValue(), bpp::AbstractBiblioSubstitutionModel::mapParNamesFromPmodel_, bpp::AbstractParameterAliasable::matchParametersValues(), and bpp::SubstitutionModel::setFreqFromData().

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().

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

Sets the probabilities of the submodels of the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 111 of file AbstractBiblioMixedSubstitutionModel.h.

References bpp::AbstractBiblioMixedSubstitutionModel::getMixedModel(), and bpp::MixedSubstitutionModel::setNProbability().

void bpp::AbstractBiblioSubstitutionModel::setRate ( double  rate)
inlinevirtualinherited

Set the rate of the model (must be positive).

Parameters
ratemust be positive.

Implements bpp::SubstitutionModel.

Definition at line 145 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::setRate().

virtual void bpp::SubstitutionModel::setRate ( double  rate)
pure virtualinherited
void bpp::AbstractBiblioSubstitutionModel::setScale ( double  scale)
inlinevirtualinherited

Multiplies the current generator by the given scale.

Parameters
scalethe scale by which the generator is multiplied.

Implements bpp::SubstitutionModel.

Definition at line 192 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::setScale().

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().

void bpp::AbstractBiblioMixedSubstitutionModel::setVRates ( const Vdouble vd)
inlinevirtualinherited
double bpp::AbstractBiblioSubstitutionModel::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 120 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::Sij().

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().

Member Data Documentation

auto_ptr<MixtureOfSubstitutionModels> bpp::LLG08_EHO::pmixmodel_
private

Definition at line 99 of file LLG08_EHO.h.

Referenced by LLG08_EHO(), and operator=().


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