bpp-phyl  2.4.0
bpp::GY94 Class Referenceabstract

The Goldman and Yang (1994) substitution model for codons. More...

#include <Bpp/Phyl/Model/Codon/GY94.h>

+ Inheritance diagram for bpp::GY94:
+ Collaboration diagram for bpp::GY94:

Public Member Functions

 GY94 (const GeneticCode *gc, FrequenciesSet *codonFreqs)
 
 ~GY94 ()
 
 GY94 (const GY94 &gy94)
 
GY94operator= (const GY94 &gy94)
 
GY94clone () const
 
std::string getName () const
 Get the name of the model. More...
 
const SubstitutionModelgetSubstitutionModel () const
 
const GeneticCodegetGeneticCode () const
 
double getCodonsMulRate (size_t i, size_t j) const
 
std::string getParNameFromPmodel (const std::string &name) const
 
void addRateParameter ()
 
void setFreqFromData (const SequenceContainer &data, double pseudoCount=0)
 Set equilibrium frequencies equal to the frequencies estimated from the data. More...
 
void setFreq (std::map< int, double > &frequ)
 Set equilibrium frequencies. More...
 
virtual void fireParameterChanged (const ParameterList &parameters)
 Tells the model that a parameter value has changed. More...
 
void setNamespace (const std::string &name)
 
double Qij (size_t i, size_t j) const
 
const Matrix< double > & getGenerator () const
 
const Matrix< double > & getExchangeabilityMatrix () const
 
double Sij (size_t i, size_t j) const
 
void enableEigenDecomposition (bool yn)
 Set if eigenValues and Vectors must be computed. More...
 
bool enableEigenDecomposition ()
 Tell if eigenValues and Vectors must be computed. More...
 
bool isDiagonalizable () const
 
bool isNonSingular () const
 
const VdoublegetEigenValues () const
 
const VdoublegetIEigenValues () const
 
const Matrix< double > & getRowLeftEigenVectors () const
 
const Matrix< double > & getColumnRightEigenVectors () const
 
bool isScalable () const
 returns if model is scalable More...
 
void setScalable (bool scalable)
 sets if model is scalable, ie scale can be changed. Default : true, set to false to avoid normalization for example. More...
 
void normalize ()
 Normalize the generator. More...
 
void setDiagonal ()
 set the diagonal of the generator such that sum on each line equals 0. 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...
 
void setScale (double scale)
 Multiplies the current generator by the given scale. More...
 
double freq (size_t i) const
 
double Pij_t (size_t i, size_t j, double t) const
 
double dPij_dt (size_t i, size_t j, double t) const
 
double d2Pij_dt2 (size_t i, size_t j, double t) const
 
const VdoublegetFrequencies () const
 
const Matrix< double > & getPij_t (double t) const
 
const Matrix< double > & getdPij_dt (double t) const
 
const Matrix< double > & getd2Pij_dt2 (double t) const
 
double getInitValue (size_t i, int state) const
 
double getRate () const
 Get the rate. More...
 
void setRate (double rate)
 Set the rate of the model (must be positive). More...
 
bool computeFrequencies () const
 
void computeFrequencies (bool yn)
 
const std::vector< int > & getAlphabetStates () const
 
const StateMapgetStateMap () const
 
int getAlphabetStateAsInt (size_t i) const
 
std::string getAlphabetStateAsChar (size_t i) const
 
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...
 
const AlphabetgetAlphabet () const
 
size_t getNumberOfStates () const
 Get the number of states. More...
 
const FrequenciesSetgetFrequenciesSet () const
 If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0. More...
 
virtual const TransitionModelgetModel () const =0
 
const TransitionModelgetModel () const
 
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
 
virtual std::vector< std::string > getAlias (const std::string &name) const
 
virtual std::map< std::string, std::string > getAliases () const =0
 
virtual std::map< std::string, std::string > getAliases () const
 
virtual bool hasParameter (const std::string &name) const =0
 
bool hasParameter (const std::string &name) const
 
virtual const ParameterListgetParameters () const =0
 
const ParameterListgetParameters () const
 
virtual const ParametergetParameter (const std::string &name) const =0
 
const ParametergetParameter (const std::string &name) const
 
virtual double getParameterValue (const std::string &name) const =0
 
double getParameterValue (const std::string &name) const
 
virtual void setAllParametersValues (const ParameterList &parameters)=0
 
void setAllParametersValues (const ParameterList &parameters)
 
virtual void setParameterValue (const std::string &name, double value)=0
 
void setParameterValue (const std::string &name, double value)
 
virtual void setParametersValues (const ParameterList &parameters)=0
 
void setParametersValues (const ParameterList &parameters)
 
virtual bool matchParametersValues (const ParameterList &parameters)=0
 
bool matchParametersValues (const ParameterList &parameters)
 
virtual size_t getNumberOfParameters () const =0
 
size_t getNumberOfParameters () const
 
virtual std::string getNamespace () const =0
 
std::string getNamespace () const
 
virtual std::string getParameterNameWithoutNamespace (const std::string &name) const =0
 
std::string getParameterNameWithoutNamespace (const std::string &name) const
 
bool hasIndependentParameter (const std::string &name) const
 
ParameterList getAliasedParameters (const ParameterList &pl) const
 
ParameterList getFromParameters (const ParameterList &pl) const
 
std::string getFrom (const std::string &name) const
 
const std::shared_ptr< Parameter > & getSharedParameter (const std::string &name) const
 

Protected Member Functions

SubstitutionModelgetSubstitutionModel ()
 
virtual void updateMatrices ()
 A method for computing all necessary matrices. More...
 
VdoublegetFrequencies_ ()
 
virtual TransitionModelgetModel ()=0
 
TransitionModelgetModel ()
 
const std::shared_ptr< Parameter > & getSharedParameter (size_t i) const
 
std::shared_ptr< Parameter > & getSharedParameter (size_t i)
 
void addParameter_ (Parameter *parameter)
 
void addParameters_ (const ParameterList &parameters)
 
void includeParameters_ (const ParameterList &parameters)
 
void deleteParameter_ (size_t index)
 
void deleteParameter_ (std::string &name)
 
void deleteParameters_ (const std::vector< std::string > &names)
 
void resetParameters_ ()
 
void shareParameter_ (const std::shared_ptr< Parameter > &parameter)
 
void shareParameters_ (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 Attributes

GranthamAAChemicalDistance gacd_
 
std::unique_ptr< CodonDistanceFrequenciesSubstitutionModelpmodel_
 

Detailed Description

The Goldman and Yang (1994) substitution model for codons.

Author
Laurent Gu├ęguen

This model has one rate of transitions and one rate of transversion. It also allows distinct equilibrium frequencies between codons. A multiplicative factor accounts for the selective restraints at the amino acid level. This factor applies on the distance $d$ between amino acids given by Grantham (1974).

For codons $i=i_1i_2i_3$ and $j=j_1j_2j_3$, the generator term $Q_{ij} (i \neq j)$ is:

0 if 2 or 3 of the pair $(i_1,j_1) (i_2,j_2) (i_3,j_3) $ are different.

$\mu \pi_j \exp(-d_{aa_i,aa_j}/V)$ if exactly 1 of the pairs $(i_1,j_1) (i_2,j_2) (i_3,j_3) $ is different, and that difference is a transversion.

$\mu \kappa \pi_j \exp(-d_{aa_i,aa_j}/V)$ if exactly 1 of the pairs $(i_1,j_1) (i_2,j_2) (i_3,j_3) $ is different, and that difference is a transition.

$\mu$ is a normalization factor.

This model includes 2 parameters ( $\kappa$ and $V$). The codon frequencies $\pi_j$ are either observed or infered.

Reference:

  • Goldman N. and Yang Z. (1994), Molecular Biology And Evolution 11(5) 725–736.

Definition at line 82 of file GY94.h.

Constructor & Destructor Documentation

GY94::~GY94 ( )

Definition at line 85 of file GY94.cpp.

GY94::GY94 ( const GY94 gy94)

Definition at line 72 of file GY94.cpp.

Member Function Documentation

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

Implements bpp::AbstractBiblioSubstitutionModel.

Definition at line 100 of file GY94.h.

References GY94().

bool bpp::AbstractTotallyWrappedModel::computeFrequencies ( ) const
inlinevirtualinherited
Returns
Says if equilibrium frequencies should be computed from the generator

Implements bpp::TransitionModel.

Definition at line 156 of file AbstractWrappedModel.h.

References bpp::TransitionModel::computeFrequencies(), and bpp::WrappedModel::getModel().

Referenced by bpp::YN98::YN98().

void bpp::AbstractTotallyWrappedModel::computeFrequencies ( bool  yn)
inlinevirtualinherited
Returns
Set if equilibrium frequencies should be computed from the generator

Implements bpp::TransitionModel.

Definition at line 166 of file AbstractWrappedModel.h.

References bpp::TransitionModel::computeFrequencies(), and bpp::WrappedModel::getModel().

double bpp::AbstractTotallyWrappedModel::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::TransitionModel.

Definition at line 121 of file AbstractWrappedModel.h.

References bpp::TransitionModel::d2Pij_dt2(), and bpp::WrappedModel::getModel().

double bpp::AbstractTotallyWrappedModel::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::TransitionModel.

Definition at line 120 of file AbstractWrappedModel.h.

References bpp::TransitionModel::dPij_dt(), and bpp::WrappedModel::getModel().

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

Set if eigenValues and Vectors must be computed.

Implements bpp::SubstitutionModel.

Definition at line 232 of file AbstractWrappedModel.h.

bool bpp::AbstractTotallyWrappedSubstitutionModel::enableEigenDecomposition ( )
inlinevirtualinherited

Tell if eigenValues and Vectors must be computed.

Implements bpp::SubstitutionModel.

Definition at line 234 of file AbstractWrappedModel.h.

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

Implements bpp::TransitionModel.

Definition at line 117 of file AbstractWrappedModel.h.

References bpp::TransitionModel::freq(), and bpp::WrappedModel::getModel().

const Alphabet* bpp::AbstractWrappedModel::getAlphabet ( ) const
inlinevirtualinherited
Returns
Get the alphabet associated to this model.

Implements bpp::TransitionModel.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 82 of file AbstractWrappedModel.h.

References bpp::TransitionModel::getAlphabet(), and bpp::WrappedModel::getModel().

Referenced by bpp::RegisterRatesSubstitutionModel::getAlphabet().

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

Implements bpp::TransitionModel.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 75 of file AbstractWrappedModel.h.

References bpp::TransitionModel::getAlphabetStateAsChar(), and bpp::WrappedModel::getModel().

Referenced by bpp::RegisterRatesSubstitutionModel::getAlphabetStateAsChar().

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

Implements bpp::TransitionModel.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 73 of file AbstractWrappedModel.h.

References bpp::TransitionModel::getAlphabetStateAsInt(), and bpp::WrappedModel::getModel().

Referenced by bpp::RegisterRatesSubstitutionModel::getAlphabetStateAsInt().

const std::vector<int>& bpp::AbstractWrappedModel::getAlphabetStates ( ) const
inlinevirtualinherited
double bpp::GY94::getCodonsMulRate ( size_t  i,
size_t  j 
) const
inline

Definition at line 110 of file GY94.h.

const Matrix<double>& bpp::AbstractTotallyWrappedSubstitutionModel::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 246 of file AbstractWrappedModel.h.

const Matrix<double>& bpp::AbstractTotallyWrappedModel::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::TransitionModel.

Definition at line 129 of file AbstractWrappedModel.h.

References bpp::TransitionModel::getd2Pij_dt2(), and bpp::WrappedModel::getModel().

const Matrix<double>& bpp::AbstractTotallyWrappedModel::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::TransitionModel.

Definition at line 127 of file AbstractWrappedModel.h.

References bpp::TransitionModel::getdPij_dt(), and bpp::WrappedModel::getModel().

const Vdouble& bpp::AbstractTotallyWrappedSubstitutionModel::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 240 of file AbstractWrappedModel.h.

const Matrix<double>& bpp::AbstractTotallyWrappedSubstitutionModel::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 228 of file AbstractWrappedModel.h.

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

Implements bpp::TransitionModel.

Definition at line 123 of file AbstractWrappedModel.h.

References bpp::TransitionModel::getFrequencies(), and bpp::WrappedModel::getModel().

Vdouble& bpp::AbstractTotallyWrappedModel::getFrequencies_ ( )
inlineprotectedvirtualinherited
const FrequenciesSet* bpp::AbstractWrappedModel::getFrequenciesSet ( ) const
inlinevirtualinherited

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

Reimplemented from bpp::TransitionModel.

Reimplemented in bpp::OneChangeRegisterTransitionModel, bpp::KCM, bpp::YN98, bpp::MG94, and bpp::OneChangeTransitionModel.

Definition at line 86 of file AbstractWrappedModel.h.

References bpp::TransitionModel::getFrequenciesSet(), and bpp::WrappedModel::getModel().

const Matrix<double>& bpp::AbstractTotallyWrappedSubstitutionModel::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 226 of file AbstractWrappedModel.h.

const GeneticCode* bpp::GY94::getGeneticCode ( ) const
inline

Definition at line 108 of file GY94.h.

const Vdouble& bpp::AbstractTotallyWrappedSubstitutionModel::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 242 of file AbstractWrappedModel.h.

double bpp::AbstractTotallyWrappedModel::getInitValue ( size_t  i,
int  state 
) const
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::TransitionModel.

Definition at line 131 of file AbstractWrappedModel.h.

References bpp::TransitionModel::getInitValue(), and bpp::WrappedModel::getModel().

virtual TransitionModel& bpp::WrappedModel::getModel ( )
protectedpure virtualinherited
TransitionModel& bpp::AbstractWrappedSubstitutionModel::getModel ( )
inlineprotectedvirtualinherited

Implements bpp::WrappedModel.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 202 of file AbstractWrappedModel.h.

std::vector<size_t> bpp::AbstractWrappedModel::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::TransitionModel.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 77 of file AbstractWrappedModel.h.

References bpp::WrappedModel::getModel(), and bpp::TransitionModel::getModelStates().

Referenced by bpp::RegisterRatesSubstitutionModel::getModelStates().

std::vector<size_t> bpp::AbstractWrappedModel::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::TransitionModel.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 79 of file AbstractWrappedModel.h.

References bpp::WrappedModel::getModel(), and bpp::TransitionModel::getModelStates().

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

Get the name of the model.

Returns
The name of this model.

Implements bpp::TransitionModel.

Definition at line 104 of file GY94.h.

size_t bpp::AbstractWrappedModel::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::TransitionModel.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 84 of file AbstractWrappedModel.h.

References bpp::WrappedModel::getModel(), and bpp::TransitionModel::getNumberOfStates().

std::string AbstractBiblioSubstitutionModel::getParNameFromPmodel ( const std::string &  name) const
inherited
const Matrix<double>& bpp::AbstractTotallyWrappedModel::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::TransitionModel.

Definition at line 125 of file AbstractWrappedModel.h.

References bpp::WrappedModel::getModel(), and bpp::TransitionModel::getPij_t().

const Matrix<double>& bpp::AbstractTotallyWrappedSubstitutionModel::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 244 of file AbstractWrappedModel.h.

double bpp::AbstractTotallyWrappedSubstitutionModel::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 274 of file AbstractWrappedModel.h.

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

Implements bpp::TransitionModel.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 71 of file AbstractWrappedModel.h.

References bpp::WrappedModel::getModel(), and bpp::TransitionModel::getStateMap().

Referenced by bpp::RegisterRatesSubstitutionModel::getStateMap().

const SubstitutionModel& bpp::GY94::getSubstitutionModel ( ) const
inlinevirtual

Implements bpp::WrappedSubstitutionModel.

Definition at line 106 of file GY94.h.

SubstitutionModel& bpp::GY94::getSubstitutionModel ( )
inlineprotectedvirtual

Implements bpp::WrappedSubstitutionModel.

Definition at line 113 of file GY94.h.

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

Implements bpp::SubstitutionModel.

Definition at line 236 of file AbstractWrappedModel.h.

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

Implements bpp::SubstitutionModel.

Definition at line 238 of file AbstractWrappedModel.h.

bool bpp::AbstractTotallyWrappedSubstitutionModel::isScalable ( ) const
inlinevirtualinherited

returns if model is scalable

Implements bpp::SubstitutionModel.

Definition at line 254 of file AbstractWrappedModel.h.

void bpp::AbstractTotallyWrappedSubstitutionModel::normalize ( )
inlinevirtualinherited

Normalize the generator.

Implements bpp::SubstitutionModel.

Definition at line 264 of file AbstractWrappedModel.h.

GY94 & GY94::operator= ( const GY94 gy94)

Definition at line 78 of file GY94.cpp.

References bpp::AbstractBiblioSubstitutionModel::operator=(), and pmodel_.

double bpp::AbstractTotallyWrappedModel::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::TransitionModel.

Definition at line 119 of file AbstractWrappedModel.h.

References bpp::WrappedModel::getModel(), and bpp::TransitionModel::Pij_t().

double bpp::AbstractTotallyWrappedSubstitutionModel::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 224 of file AbstractWrappedModel.h.

void bpp::AbstractTotallyWrappedSubstitutionModel::setDiagonal ( )
inlinevirtualinherited

set the diagonal of the generator such that sum on each line equals 0.

Implements bpp::SubstitutionModel.

Definition at line 269 of file AbstractWrappedModel.h.

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::TransitionModel.

Definition at line 143 of file AbstractBiblioSubstitutionModel.cpp.

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

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

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

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

Parameters
ratemust be positive.

Implements bpp::TransitionModel.

Definition at line 141 of file AbstractWrappedModel.h.

References bpp::WrappedModel::getModel(), and bpp::TransitionModel::setRate().

void bpp::AbstractTotallyWrappedSubstitutionModel::setScalable ( bool  scalable)
inlinevirtualinherited

sets if model is scalable, ie scale can be changed. Default : true, set to false to avoid normalization for example.

Implements bpp::SubstitutionModel.

Definition at line 259 of file AbstractWrappedModel.h.

void bpp::AbstractTotallyWrappedSubstitutionModel::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 276 of file AbstractWrappedModel.h.

double bpp::AbstractTotallyWrappedSubstitutionModel::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 230 of file AbstractWrappedModel.h.

Member Data Documentation

GranthamAAChemicalDistance bpp::GY94::gacd_
private

Definition at line 88 of file GY94.h.

std::unique_ptr<CodonDistanceFrequenciesSubstitutionModel> bpp::GY94::pmodel_
private

Definition at line 89 of file GY94.h.

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


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