bpp-phyl3 3.0.0
bpp::AbstractLkTransitionModel Class Referenceabstract

Partial implementation of the TransitionModel interface, with function for likelihood computations. More...

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

+ Inheritance diagram for bpp::AbstractLkTransitionModel:
+ Collaboration diagram for bpp::AbstractLkTransitionModel:

Public Member Functions

 AbstractLkTransitionModel ()
 
virtual ~AbstractLkTransitionModel ()
 
const Eigen::VectorXd & Lik_t (const Eigen::VectorXd &values, double t) const override
 
const Eigen::VectorXd & dLik_dt (const Eigen::VectorXd &values, double t) const override
 
const Eigen::VectorXd & d2Lik_dt2 (const Eigen::VectorXd &values, double t) const override
 
TransitionModelInterfaceclone () const =0
 
virtual double freq (size_t i) const =0
 
virtual double Pij_t (size_t i, size_t j, double t) const =0
 
virtual double dPij_dt (size_t i, size_t j, double t) const =0
 
virtual double d2Pij_dt2 (size_t i, size_t j, double t) const =0
 
virtual const VdoublegetFrequencies () const =0
 
virtual bool computeFrequencies () const =0
 
virtual void computeFrequencies (bool yn)=0
 Set if equilibrium frequencies should be computed. More...
 
virtual const Matrix< double > & getPij_t (double t) const =0
 
virtual const Matrix< double > & getdPij_dt (double t) const =0
 
virtual const Matrix< double > & getd2Pij_dt2 (double t) const =0
 
virtual void setFreqFromData (const SequenceDataInterface &data, double pseudoCount=0)=0
 Set equilibrium frequencies equal to the frequencies estimated from the data. More...
 
virtual void setFreq (std::map< int, double > &frequencies)=0
 Set equilibrium frequencies. More...
 
virtual std::string getName () const =0
 Get the name of the model. More...
 
virtual const std::vector< int > & getAlphabetStates () const =0
 
virtual const StateMapInterfacestateMap () const =0
 
virtual std::shared_ptr< const StateMapInterfacegetStateMap () const =0
 
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...
 
virtual int getAlphabetStateAsInt (size_t index) const =0
 
virtual std::string getAlphabetStateAsChar (size_t index) const =0
 
virtual const Alphabetalphabet () const =0
 
virtual std::shared_ptr< const AlphabetgetAlphabet () const =0
 
virtual const FrequencySetInterfacefrequencySet () const =0
 
virtual size_t getNumberOfStates () const =0
 Get the number of states. More...
 
virtual double getInitValue (size_t i, int state) const =0
 
virtual double getRate () const =0
 Get the rate. More...
 
virtual void setRate (double rate)=0
 Set the rate of the model (must be positive). More...
 
virtual void addRateParameter ()=0
 
virtual size_t getNumberOfIndependentParameters () const=0
 
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
 
virtual void unaliasParameters (const std::string &p1, const std::string &p2)=0
 
virtual const ParameterListgetIndependentParameters () const=0
 
virtual std::vector< std::string > getAlias (const std::string &name) const=0
 
virtual std::map< std::string, std::string > getAliases () const=0
 
virtual bool hasParameter (const std::string &name) const=0
 
virtual const ParameterListgetParameters () const=0
 
virtual const Parameterparameter (const std::string &name) const=0
 
virtual double getParameterValue (const std::string &name) const=0
 
virtual void setAllParametersValues (const ParameterList &parameters)=0
 
virtual void setParameterValue (const std::string &name, double value)=0
 
virtual void setParametersValues (const ParameterList &parameters)=0
 
virtual bool matchParametersValues (const ParameterList &parameters)=0
 
virtual void removeConstraint (const std::string &name)=0
 
virtual void setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint)=0
 
virtual size_t getNumberOfParameters () const=0
 
virtual void setNamespace (const std::string &prefix)=0
 
virtual std::string getNamespace () const=0
 
virtual std::string getParameterNameWithoutNamespace (const std::string &name) const=0
 

Protected Member Functions

virtual VdoublegetFrequencies_ ()=0
 
virtual ParameterListgetParameters_ ()=0
 

Private Attributes

Eigen::VectorXd lik_
 

Friends

class AbstractTotallyWrappedTransitionModel
 
class AbstractFromSubstitutionModelTransitionModel
 
class InMixedSubstitutionModel
 

Detailed Description

Partial implementation of the TransitionModel interface, with function for likelihood computations.

Definition at line 19 of file AbstractSubstitutionModel.h.

Constructor & Destructor Documentation

◆ AbstractLkTransitionModel()

bpp::AbstractLkTransitionModel::AbstractLkTransitionModel ( )
inline

Definition at line 26 of file AbstractSubstitutionModel.h.

◆ ~AbstractLkTransitionModel()

virtual bpp::AbstractLkTransitionModel::~AbstractLkTransitionModel ( )
inlinevirtual

Definition at line 27 of file AbstractSubstitutionModel.h.

Member Function Documentation

◆ addRateParameter()

◆ alphabet()

◆ clone()

TransitionModelInterface * bpp::TransitionModelInterface::clone ( ) const
pure virtualinherited

Implements bpp::BranchModelInterface.

Implemented in bpp::BinarySubstitutionModel, bpp::CodonDistanceSubstitutionModel, bpp::F84, bpp::HKY85, bpp::LG10_EX_EHO::EmbeddedModel, bpp::LG10_EX_EHO, bpp::TwoParameterBinarySubstitutionModel, bpp::AnonymousSubstitutionModel, bpp::CodonAdHocSubstitutionModel, bpp::CodonDistanceFrequenciesSubstitutionModel, bpp::CodonDistancePhaseFrequenciesSubstitutionModel, bpp::CodonSameAARateSubstitutionModel, bpp::DFP07, bpp::DFPDistanceFrequenciesSubstitutionModel, bpp::GY94, bpp::KCM, bpp::KroneckerCodonDistanceFrequenciesSubstitutionModel, bpp::KroneckerCodonDistanceSubstitutionModel, bpp::MG94, bpp::RELAX, bpp::SENCA, bpp::TripletSubstitutionModel, bpp::YN98, bpp::YNGP_M1, bpp::YNGP_M10, bpp::YNGP_M2, bpp::YNGP_M3, bpp::YNGP_M7, bpp::YNGP_M8, bpp::YNGP_M9, bpp::D1WalkSubstitutionModel, bpp::EquiprobableSubstitutionModel, bpp::FromMixtureSubstitutionModel, bpp::G2001, bpp::InMixedSubstitutionModel, bpp::KroneckerWordSubstitutionModel, bpp::MixtureOfASubstitutionModel, bpp::MixtureOfATransitionModel, bpp::MixtureOfSubstitutionModels, bpp::MixtureOfTransitionModels, bpp::F81, bpp::gBGC, bpp::GTR, bpp::JCnuc, bpp::K80, bpp::L95, bpp::RN95, bpp::RN95s, bpp::SSR, bpp::T92, bpp::TN93, bpp::YpR_Sym, bpp::YpR_Gen, bpp::OneChangeRegisterTransitionModel, bpp::OneChangeTransitionModel, bpp::POMO, bpp::Coala, bpp::DSO78, bpp::JCprot, bpp::JTT92, bpp::LG08, bpp::LGL08_CAT::EmbeddedModel, bpp::LGL08_CAT, bpp::LLG08_EHO::EmbeddedModel, bpp::LLG08_EHO, bpp::LLG08_EX2::EmbeddedModel, bpp::LLG08_EX2, bpp::LLG08_EX3::EmbeddedModel, bpp::LLG08_EX3, bpp::LLG08_UL2::EmbeddedModel, bpp::LLG08_UL2, bpp::LLG08_UL3::EmbeddedModel, bpp::LLG08_UL3, bpp::UserProteinSubstitutionModel, bpp::WAG01, bpp::RE08, bpp::RE08Nucleotide, bpp::RE08Protein, bpp::RE08Codon, bpp::RegisterRatesSubstitutionModel, bpp::TS98, bpp::WordSubstitutionModel, bpp::AbstractMixedTransitionModel, bpp::AbstractReversibleSubstitutionModel, bpp::AbstractCodonSubstitutionModel, bpp::AbstractDFPSubstitutionModel, bpp::AbstractKroneckerCodonSubstitutionModel, bpp::CodonSubstitutionModelInterface, bpp::CodonReversibleSubstitutionModelInterface, bpp::YNGP_M, bpp::MarkovModulatedSubstitutionModel, bpp::MixedTransitionModelInterface, bpp::NucleotideSubstitutionModelInterface, bpp::NucleotideReversibleSubstitutionModelInterface, bpp::AbstractNucleotideSubstitutionModel, bpp::AbstractReversibleNucleotideSubstitutionModel, bpp::ProteinSubstitutionModelInterface, bpp::ProteinReversibleSubstitutionModelInterface, bpp::AbstractProteinSubstitutionModel, bpp::AbstractReversibleProteinSubstitutionModel, bpp::SubstitutionModelInterface, and bpp::ReversibleSubstitutionModelInterface.

Referenced by bpp::AbstractSinglePhyloSubstitutionMapping::addModel(), bpp::MixtureOfATransitionModel::MixtureOfATransitionModel(), and bpp::AbstractMixedTransitionModel::operator=().

◆ computeFrequencies() [1/2]

◆ computeFrequencies() [2/2]

virtual void bpp::TransitionModelInterface::computeFrequencies ( bool  yn)
pure virtualinherited

◆ d2Lik_dt2()

const Eigen::VectorXd & bpp::AbstractLkTransitionModel::d2Lik_dt2 ( const Eigen::VectorXd &  values,
double  t 
) const
inlineoverridevirtual

◆ d2Pij_dt2()

◆ dLik_dt()

const Eigen::VectorXd & bpp::AbstractLkTransitionModel::dLik_dt ( const Eigen::VectorXd &  values,
double  t 
) const
inlineoverridevirtual

◆ dPij_dt()

◆ freq()

◆ frequencySet()

◆ getAlphabet()

◆ getAlphabetStateAsChar()

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

◆ getAlphabetStateAsInt()

virtual int bpp::BranchModelInterface::getAlphabetStateAsInt ( size_t  index) const
pure virtualinherited

◆ getAlphabetStates()

virtual const std::vector< int > & bpp::BranchModelInterface::getAlphabetStates ( ) const
pure virtualinherited

◆ getd2Pij_dt2()

◆ getdPij_dt()

◆ getFrequencies()

◆ getFrequencies_()

◆ getInitValue()

virtual double bpp::BranchModelInterface::getInitValue ( size_t  i,
int  state 
) const
pure virtualinherited

This method is used to initialize likelihoods in recursions. It typically sends 1 if i = state, 0 otherwise, where i is one of the possible states of the alphabet allowed in the model and state is the observed state in the considered sequence/site.

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::AbstractTransitionModel, bpp::AbstractTotallyWrappedTransitionModel, bpp::InMixedSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, bpp::MultinomialFromTransitionModel, bpp::OneChangeRegisterTransitionModel, bpp::OneChangeTransitionModel, bpp::RE08, and bpp::TransitionFromTransitionModel.

Referenced by bpp::AbstractTotallyWrappedTransitionModel::getInitValue(), bpp::InMixedSubstitutionModel::getInitValue(), bpp::MultinomialFromTransitionModel::getInitValue(), bpp::OneChangeRegisterTransitionModel::getInitValue(), bpp::OneChangeTransitionModel::getInitValue(), and bpp::TransitionFromTransitionModel::getInitValue().

◆ getModelStates() [1/2]

virtual std::vector< size_t > bpp::BranchModelInterface::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::AbstractTransitionModel, bpp::AbstractWrappedModel, bpp::MarkovModulatedSubstitutionModel, and bpp::RegisterRatesSubstitutionModel.

◆ getModelStates() [2/2]

virtual std::vector< size_t > bpp::BranchModelInterface::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::AbstractTransitionModel, bpp::AbstractWrappedModel, bpp::MarkovModulatedSubstitutionModel, and bpp::RegisterRatesSubstitutionModel.

Referenced by bpp::SubstitutionModelSet::getModelStates(), and bpp::AbstractWrappedModel::getModelStates().

◆ getName()

virtual std::string bpp::BranchModelInterface::getName ( ) const
pure virtualinherited

Get the name of the model.

Returns
The name of this model.

Implemented in bpp::BinarySubstitutionModel, bpp::CodonDistanceSubstitutionModel, bpp::F84, bpp::HKY85, bpp::LG10_EX_EHO::EmbeddedModel, bpp::LG10_EX_EHO, bpp::TwoParameterBinarySubstitutionModel, bpp::AbstractWrappedModel, bpp::AnonymousSubstitutionModel, bpp::CodonAdHocSubstitutionModel, bpp::CodonDistanceFrequenciesSubstitutionModel, bpp::CodonDistancePhaseFrequenciesSubstitutionModel, bpp::CodonSameAARateSubstitutionModel, bpp::DFP07, bpp::DFPDistanceFrequenciesSubstitutionModel, bpp::GY94, bpp::KCM, bpp::KroneckerCodonDistanceFrequenciesSubstitutionModel, bpp::KroneckerCodonDistanceSubstitutionModel, bpp::MG94, bpp::RELAX, bpp::SENCA, bpp::TripletSubstitutionModel, bpp::YN98, bpp::YNGP_M1, bpp::YNGP_M10, bpp::YNGP_M2, bpp::YNGP_M3, bpp::YNGP_M7, bpp::YNGP_M8, bpp::YNGP_M9, bpp::D1WalkSubstitutionModel, bpp::EquiprobableSubstitutionModel, bpp::FromMixtureSubstitutionModel, bpp::G2001, bpp::InMixedSubstitutionModel, bpp::KroneckerWordSubstitutionModel, bpp::MixtureOfATransitionModel, bpp::MixtureOfTransitionModels, bpp::MultinomialFromTransitionModel, bpp::F81, bpp::gBGC, bpp::GTR, bpp::JCnuc, bpp::K80, bpp::L95, bpp::RN95, bpp::RN95s, bpp::SSR, bpp::T92, bpp::TN93, bpp::YpR_Sym, bpp::YpR_Gen, bpp::OneChangeRegisterTransitionModel, bpp::OneChangeTransitionModel, bpp::POMO, bpp::Coala, bpp::DSO78, bpp::JCprot, bpp::JTT92, bpp::LG08, bpp::LGL08_CAT::EmbeddedModel, bpp::LGL08_CAT, bpp::LLG08_EHO::EmbeddedModel, bpp::LLG08_EHO, bpp::LLG08_EX2::EmbeddedModel, bpp::LLG08_EX2, bpp::LLG08_EX3::EmbeddedModel, bpp::LLG08_EX3, bpp::LLG08_UL2::EmbeddedModel, bpp::LLG08_UL2, bpp::LLG08_UL3::EmbeddedModel, bpp::LLG08_UL3, bpp::UserProteinSubstitutionModel, bpp::WAG01, bpp::RE08, bpp::RegisterRatesSubstitutionModel, bpp::TransitionFromTransitionModel, bpp::TS98, and bpp::WordSubstitutionModel.

Referenced by bpp::YpR::checkModel(), bpp::TransitionMatrixFromModel::compute(), bpp::AbstractWrappedModel::getName(), bpp::FromMixtureSubstitutionModel::getName(), bpp::AbstractSubstitutionModel::getPij_t(), bpp::BppOSubstitutionModelFormat::initialize_(), bpp::MixtureOfSubstitutionModels::MixtureOfSubstitutionModels(), bpp::MixtureOfATransitionModel::model(), bpp::SubstitutionProcessCollectionMember::setModelScenario(), bpp::LegacyPhylogeneticsApplicationTools::setSubstitutionModelParametersInitialValuesWithAliases(), bpp::ModelPath::toString(), and bpp::BppOSubstitutionModelFormat::write().

◆ getNumberOfStates()

◆ getPij_t()

◆ getRate()

◆ getStateMap()

virtual std::shared_ptr< const StateMapInterface > bpp::BranchModelInterface::getStateMap ( ) const
pure virtualinherited

◆ Lik_t()

const Eigen::VectorXd & bpp::AbstractLkTransitionModel::Lik_t ( const Eigen::VectorXd &  values,
double  t 
) const
inlineoverridevirtual

This method is used to compute likelihoods in recursions. It computes the probability of a vector given a start state.

Parameters
valuesAn vector of states on the site.
tthe branch length

Implements bpp::TransitionModelInterface.

Definition at line 30 of file AbstractSubstitutionModel.h.

References bpp::TransitionModelInterface::getPij_t(), and lik_.

◆ Pij_t()

◆ setFreq()

virtual void bpp::TransitionModelInterface::setFreq ( std::map< int, double > &  frequencies)
pure virtualinherited

◆ setFreqFromData()

virtual void bpp::TransitionModelInterface::setFreqFromData ( const SequenceDataInterface data,
double  pseudoCount = 0 
)
pure virtualinherited

◆ setRate()

◆ stateMap()

virtual const StateMapInterface & bpp::BranchModelInterface::stateMap ( ) const
pure virtualinherited

Friends And Related Function Documentation

◆ AbstractFromSubstitutionModelTransitionModel

Definition at line 82 of file AbstractSubstitutionModel.h.

◆ AbstractTotallyWrappedTransitionModel

Definition at line 81 of file AbstractSubstitutionModel.h.

◆ InMixedSubstitutionModel

friend class InMixedSubstitutionModel
friend

Definition at line 83 of file AbstractSubstitutionModel.h.

Referenced by bpp::InMixedSubstitutionModel::clone().

Member Data Documentation

◆ lik_

Eigen::VectorXd bpp::AbstractLkTransitionModel::lik_
mutableprivate

Definition at line 23 of file AbstractSubstitutionModel.h.

Referenced by d2Lik_dt2(), dLik_dt(), and Lik_t().


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