bpp-phyl  2.4.0
bpp::TransitionModel Class Referenceabstract

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

+ Inheritance diagram for bpp::TransitionModel:
+ Collaboration diagram for bpp::TransitionModel:

Public Member Functions

 TransitionModel ()
 
virtual ~TransitionModel ()
 
TransitionModelclone () const =0
 
virtual std::string getName () const =0
 Get the name of the model. More...
 
virtual const std::vector< int > & getAlphabetStates () const =0
 
virtual const StateMapgetStateMap () 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 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
 
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 const AlphabetgetAlphabet () 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 void setFreqFromData (const SequenceContainer &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 const FrequenciesSetgetFrequenciesSet () const
 If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0. More...
 
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 ParametergetParameter (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 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
 

Friends

class AbstractTotallyWrappedModel
 
class AbstractFromSubstitutionModelTransitionModel
 
class InMixedSubstitutionModel
 

Detailed Description

Definition at line 122 of file SubstitutionModel.h.

Constructor & Destructor Documentation

bpp::TransitionModel::TransitionModel ( )
inline

Definition at line 126 of file SubstitutionModel.h.

virtual bpp::TransitionModel::~TransitionModel ( )
inlinevirtual

Definition at line 127 of file SubstitutionModel.h.

Member Function Documentation

TransitionModel* bpp::TransitionModel::clone ( ) const
pure virtual

Implements bpp::ParameterAliasable.

Implemented in bpp::ReversibleSubstitutionModel, bpp::AbstractReversibleSubstitutionModel, bpp::SubstitutionModel, bpp::RE08Codon, bpp::YpR_Gen, bpp::RE08Protein, bpp::AbstractSubstitutionModel, bpp::RE08Nucleotide, bpp::YpR_Sym, bpp::HKY85, bpp::F84, bpp::MarkovModulatedSubstitutionModel, bpp::KroneckerCodonDistanceFrequenciesSubstitutionModel, bpp::JCprot, bpp::AbstractKroneckerCodonSubstitutionModel, bpp::T92, bpp::KroneckerCodonDistanceSubstitutionModel, bpp::K80, bpp::MixtureOfSubstitutionModels, bpp::GTR, bpp::RE08, bpp::RN95, bpp::TN93, bpp::OneChangeRegisterTransitionModel, bpp::AbstractCodonSubstitutionModel, bpp::CodonDistanceFrequenciesSubstitutionModel, bpp::JCnuc, bpp::RegisterRatesSubstitutionModel, bpp::RN95s, bpp::BinarySubstitutionModel, bpp::KroneckerWordSubstitutionModel, bpp::AbstractReversibleNucleotideSubstitutionModel, bpp::CodonAdHocSubstitutionModel, bpp::AbstractReversibleProteinSubstitutionModel, bpp::CodonDistancePhaseFrequenciesSubstitutionModel, bpp::MixtureOfASubstitutionModel, bpp::UserProteinSubstitutionModel, bpp::SSR, bpp::CodonDistanceSubstitutionModel, bpp::WAG01, bpp::G2001, bpp::L95, bpp::AbstractMixedSubstitutionModel, bpp::LLG08_EX3, bpp::WordSubstitutionModel, bpp::DSO78, bpp::JTT92, bpp::LLG08_EHO, bpp::LLG08_UL3, bpp::CodonReversibleSubstitutionModel, bpp::LG08, bpp::SENCA, bpp::YN98, bpp::AbstractNucleotideSubstitutionModel, bpp::gBGC, bpp::LGL08_CAT, bpp::LLG08_EX2, bpp::LLG08_UL2, bpp::LG10_EX_EHO, bpp::KCM, bpp::GY94, bpp::AbstractProteinSubstitutionModel, bpp::TS98, bpp::TripletSubstitutionModel, bpp::InMixedSubstitutionModel, bpp::MG94, bpp::LLG08_EX3::EmbeddedModel, bpp::LLG08_EHO::EmbeddedModel, bpp::LLG08_UL3::EmbeddedModel, bpp::YNGP_M, bpp::Coala, bpp::AbstractFromSubstitutionModelTransitionModel, bpp::CodonSubstitutionModel, bpp::LGL08_CAT::EmbeddedModel, bpp::LLG08_EX2::EmbeddedModel, bpp::LLG08_UL2::EmbeddedModel, bpp::LG10_EX_EHO::EmbeddedModel, bpp::YNGP_M10, bpp::YNGP_M9, bpp::FromMixtureSubstitutionModel, bpp::YNGP_M8, bpp::NucleotideReversibleSubstitutionModel, bpp::AbstractBiblioSubstitutionModel, bpp::ProteinReversibleSubstitutionModel, bpp::YNGP_M1, bpp::YNGP_M7, bpp::YNGP_M2, bpp::OneChangeTransitionModel, bpp::YNGP_M3, bpp::AnonymousSubstitutionModel, bpp::AbstractBiblioMixedSubstitutionModel, bpp::MixedSubstitutionModel, bpp::NucleotideSubstitutionModel, and bpp::ProteinSubstitutionModel.

Referenced by bpp::OptimizationTools::buildDistanceTree(), bpp::SubstitutionModelSetTools::createNonHomogeneousModelSet(), bpp::NonHomogeneousSequenceSimulator::NonHomogeneousSequenceSimulator(), and bpp::FromModelFrequenciesSet::operator=().

virtual void bpp::TransitionModel::computeFrequencies ( bool  yn)
pure virtual
virtual double bpp::TransitionModel::d2Pij_dt2 ( size_t  i,
size_t  j,
double  t 
) const
pure virtual
virtual const Alphabet* bpp::TransitionModel::getAlphabet ( ) const
pure virtual
Returns
Get the alphabet associated to this model.

Implemented in bpp::RE08Protein, bpp::AbstractSubstitutionModel, bpp::RE08Nucleotide, bpp::MarkovModulatedSubstitutionModel, bpp::RegisterRatesSubstitutionModel, bpp::AbstractReversibleNucleotideSubstitutionModel, bpp::AbstractReversibleProteinSubstitutionModel, bpp::AbstractNucleotideSubstitutionModel, bpp::AbstractProteinSubstitutionModel, bpp::AbstractWrappedModel, bpp::NucleotideSubstitutionModel, and bpp::ProteinSubstitutionModel.

Referenced by bpp::SubstitutionModelSet::addModel(), bpp::DecompositionReward::alphabetIndexHasChanged(), bpp::YpR::check_model(), bpp::ComprehensiveSubstitutionRegister::ComprehensiveSubstitutionRegister(), bpp::SubstitutionMappingTools::computeCountsPerSitePerBranchPerType(), bpp::SubstitutionMappingTools::computeCountsPerSitePerType(), bpp::SubstitutionMappingTools::computeCountsPerTypePerBranch(), bpp::SubstitutionModelSetTools::createHomogeneousModelSet(), bpp::SubstitutionModelSetTools::createNonHomogeneousModelSet(), bpp::DecompositionReward::DecompositionReward(), bpp::DecompositionSubstitutionCount::DecompositionSubstitutionCount(), bpp::LaplaceSubstitutionCount::getAllNumbersOfSubstitutions(), bpp::AbstractWrappedModel::getAlphabet(), bpp::AbstractSubstitutionRegister::getAlphabet(), bpp::MarkovModulatedSubstitutionModel::getAlphabet(), bpp::MarkovModulatedSubstitutionModel::getInitValue(), bpp::SubstitutionMappingTools::getNormalizationsPerBranch(), bpp::PhylogeneticsApplicationTools::getSubstitutionRegister(), bpp::DRASRTreeLikelihoodData::initLikelihoods(), bpp::DRASDRTreeLikelihoodData::initLikelihoods(), bpp::SENCA::setFreq(), bpp::AbstractHomogeneousTreeLikelihood::setModel(), bpp::DecompositionSubstitutionCount::setSubstitutionModel(), bpp::DecompositionReward::setSubstitutionModel(), bpp::LaplaceSubstitutionCount::setSubstitutionModel(), bpp::UniformizationSubstitutionCount::setSubstitutionModel(), bpp::DecompositionSubstitutionCount::substitutionRegisterHasChanged(), bpp::UniformizationSubstitutionCount::substitutionRegisterHasChanged(), bpp::TwoTreeLikelihood::TwoTreeLikelihood(), bpp::UniformizationSubstitutionCount::UniformizationSubstitutionCount(), bpp::YpR::updateMatrices(), bpp::AAInteriorSubstitutionRegister::updateMatrix_(), bpp::AAExteriorSubstitutionRegister::updateMatrix_(), and bpp::BppOSubstitutionModelFormat::writeMixed_().

virtual std::string bpp::TransitionModel::getAlphabetStateAsChar ( size_t  index) const
pure virtual
virtual double bpp::TransitionModel::getInitValue ( size_t  i,
int  state 
) const
pure virtual

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, bpp::OneChangeRegisterTransitionModel, bpp::InMixedSubstitutionModel, bpp::AbstractTotallyWrappedModel, and bpp::OneChangeTransitionModel.

Referenced by bpp::OneChangeTransitionModel::getInitValue(), bpp::AbstractTotallyWrappedModel::getInitValue(), bpp::InMixedSubstitutionModel::getInitValue(), bpp::DRASRTreeLikelihoodData::initLikelihoods(), bpp::DRASDRTreeLikelihoodData::initLikelihoods(), bpp::DRASRTreeLikelihoodData::initLikelihoodsWithPatterns(), and bpp::TwoTreeLikelihood::initTreeLikelihoods().

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

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, bpp::RegisterRatesSubstitutionModel, and bpp::AbstractWrappedModel.

virtual std::string bpp::TransitionModel::getName ( ) const
pure virtual

Get the name of the model.

Returns
The name of this model.

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

Referenced by bpp::YpR::check_model(), bpp::AbstractWrappedModel::getName(), bpp::FromMixtureSubstitutionModel::getName(), bpp::MixtureOfSubstitutionModels::getSubmodelNumbers(), bpp::PhylogeneticsApplicationTools::getSubstitutionRegister(), bpp::BppOSubstitutionModelFormat::read(), bpp::BppOSubstitutionModelFormat::readMixed_(), and bpp::BppOSubstitutionModelFormat::write().

virtual size_t bpp::TransitionModel::getNumberOfStates ( ) const
pure virtual

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.

Implemented in bpp::RE08Codon, bpp::RE08Protein, bpp::RE08Nucleotide, bpp::AbstractWordSubstitutionModel, bpp::RegisterRatesSubstitutionModel, bpp::AbstractMixedSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, bpp::RE08, bpp::YpR, bpp::BinarySubstitutionModel, bpp::gBGC, bpp::AbstractWrappedModel, bpp::AnonymousSubstitutionModel, bpp::NucleotideSubstitutionModel, and bpp::ProteinSubstitutionModel.

Referenced by bpp::SubstitutionModelSet::addModel(), bpp::OneJumpSubstitutionCount::getAllNumbersOfSubstitutions(), bpp::AbstractWrappedModel::getNumberOfStates(), bpp::TwoTreeLikelihood::getNumberOfStates(), bpp::AbstractHomogeneousTreeLikelihood::getNumberOfStates(), bpp::RegisterRatesSubstitutionModel::getNumberOfStates(), bpp::DRASRTreeLikelihoodData::initLikelihoods(), bpp::DRASDRTreeLikelihoodData::initLikelihoods(), bpp::BranchLikelihood::initModel(), bpp::RE08::RE08(), bpp::AbstractHomogeneousTreeLikelihood::setModel(), bpp::CategorySubstitutionRegister::setModelCategories(), bpp::UniformizationSubstitutionCount::setSubstitutionModel(), bpp::DecompositionMethods::setSubstitutionModel(), bpp::SimpleMutationProcess::SimpleMutationProcess(), bpp::TwoTreeLikelihood::TwoTreeLikelihood(), bpp::MarkovModulatedSubstitutionModel::updateMatrices(), and bpp::AbstractSubstitutionModel::updateMatrices().

Friends And Related Function Documentation

Definition at line 322 of file SubstitutionModel.h.

friend class AbstractTotallyWrappedModel
friend

Definition at line 321 of file SubstitutionModel.h.

friend class InMixedSubstitutionModel
friend

Definition at line 323 of file SubstitutionModel.h.


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