bpp-phyl3  3.0.0
bpp::SimpleSubstitutionProcess Class Referenceabstract

Space and time homogeneous substitution process, without mixture. More...

#include <Bpp/Phyl/Likelihood/SimpleSubstitutionProcess.h>

+ Inheritance diagram for bpp::SimpleSubstitutionProcess:
+ Collaboration diagram for bpp::SimpleSubstitutionProcess:

Public Member Functions

 SimpleSubstitutionProcess (std::shared_ptr< BranchModelInterface > model, std::shared_ptr< const PhyloTree > tree=nullptr, std::shared_ptr< FrequencySetInterface > rootFrequencies=nullptr)
 
 SimpleSubstitutionProcess (std::shared_ptr< BranchModelInterface > model, std::shared_ptr< ParametrizablePhyloTree > tree, std::shared_ptr< FrequencySetInterface > rootFrequencies=nullptr)
 
 SimpleSubstitutionProcess (const SimpleSubstitutionProcess &ssp)
 
SimpleSubstitutionProcessoperator= (const SimpleSubstitutionProcess &ssp)
 
SimpleSubstitutionProcessclone () const override
 
const StateMapInterfacestateMap () const override
 
std::shared_ptr< const StateMapInterfacegetStateMap () const override
 
size_t getNumberOfModels () const override
 
std::vector< size_t > getModelNumbers () const override
 
const BranchModelInterfacemodel (unsigned int nodeId, size_t classIndex) const override
 Get the substitution model corresponding to a certain branch, site pattern, and model class. More...
 
std::shared_ptr< const BranchModelInterfacegetModel (unsigned int nodeId, size_t classIndex) const override
 Get the substitution model corresponding to a certain branch, site pattern, and model class. More...
 
const BranchModelInterfacemodel (size_t n) const override
 
std::shared_ptr< const BranchModelInterfacegetModel (size_t n) const override
 
const std::vector< unsigned int > getNodesWithModel (size_t i) const override
 Get a list of nodes id for which the given model is associated. More...
 
size_t getModelNumberForNode (unsigned int nodeId) const override
 Get the number of the model associated to a particular node id. More...
 
virtual std::shared_ptr< const BranchModelInterfacegetModelForNode (unsigned int nodeId) const override
 Get the model associated to a particular node id. More...
 
std::shared_ptr< const DiscreteDistributionInterfacegetRateDistribution () const override
 Get a pointer to the rate distribution (or null if there is no rate distribution). More...
 
std::shared_ptr< DiscreteDistributionInterfacegetRateDistribution () override
 Get a pointer to the rate distribution (or null if there is no rate distribution). More...
 
const DiscreteDistributionInterfacerateDistribution () const override
 Get the rate distribution. More...
 
DiscreteDistributionInterfacerateDistribution () override
 Get the rate distribution. More...
 
ParameterList getSubstitutionModelParameters (bool independent) const override
 Methods to retrieve the parameters of specific objects. More...
 
ParameterList getRateDistributionParameters (bool independent) const override
 
ParameterList getBranchLengthParameters (bool independent) const override
 
const std::vector< double > & getRootFrequencies () const override
 Get the values of the frequencies for each state in the alphabet at the root node. More...
 
void setModelScenario (std::shared_ptr< ModelScenario > modelpath) override
 Set the modelPath, after checking it is valid (ie modelpath has only the model of the process). More...
 
double getProbabilityForModel (size_t classIndex) const override
 
Vdouble getClassProbabilities () const override
 
double getRateForModel (size_t classIndex) const override
 
void setPhyloTree (const PhyloTree &phyloTree)
 sets the ParametrizablePhyloTree. More...
 
const ParametrizablePhyloTreeparametrizablePhyloTree () const
 
std::shared_ptr< const ParametrizablePhyloTreegetParametrizablePhyloTree () const
 
bool hasRootFrequencySet () const
 
const FrequencySetInterfacerootFrequencySet () const
 
FrequencySetInterfacerootFrequencySet ()
 
std::shared_ptr< const FrequencySetInterfacegetRootFrequencySet () const
 
std::shared_ptr< FrequencySetInterfacegetRootFrequencySet ()
 
void setRootFrequencySet (std::shared_ptr< FrequencySetInterface > rootfrequency)
 set the RootFrequency. More...
 
ParameterList getRootFrequenciesParameters (bool independent) const
 Get the parameters corresponding to the root frequencies. More...
 
std::shared_ptr< const ModelScenariogetModelScenario () const
 get the ModelScenario. More...
 
virtual bool isCompatibleWith (const AlignmentDataInterface &data) const =0
 
bool isCompatibleWith (const AlignmentDataInterface &data) const
 
virtual size_t getNumberOfClasses () const =0
 
size_t getNumberOfClasses () const
 
virtual size_t getNumberOfStates () const =0
 
size_t getNumberOfStates () const
 
virtual ParameterList getNonDerivableParameters () const =0
 
ParameterList getNonDerivableParameters () const
 get NonDerivable parameters 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
 
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 override
 
virtual const ParameterListgetParameters () const=0
 
const ParameterListgetParameters () const override
 
virtual const Parameterparameter (const std::string &name) const=0
 
const Parameterparameter (const std::string &name) const override
 
virtual double getParameterValue (const std::string &name) const=0
 
double getParameterValue (const std::string &name) const override
 
virtual void setAllParametersValues (const ParameterList &parameters)=0
 
void setAllParametersValues (const ParameterList &parameters) override
 
virtual void setParameterValue (const std::string &name, double value)=0
 
void setParameterValue (const std::string &name, double value) override
 
virtual void setParametersValues (const ParameterList &parameters)=0
 
void setParametersValues (const ParameterList &parameters) override
 
virtual bool matchParametersValues (const ParameterList &parameters)=0
 
bool matchParametersValues (const ParameterList &parameters) override
 
virtual void removeConstraint (const std::string &name)=0
 
void removeConstraint (const std::string &name) override
 
virtual void setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint)=0
 
void setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override
 
virtual size_t getNumberOfParameters () const=0
 
size_t getNumberOfParameters () const override
 
virtual void setNamespace (const std::string &prefix)=0
 
void setNamespace (const std::string &prefix)
 
virtual std::string getNamespace () const=0
 
std::string getNamespace () const override
 
virtual std::string getParameterNameWithoutNamespace (const std::string &name) const=0
 
std::string getParameterNameWithoutNamespace (const std::string &name) const override
 
std::shared_ptr< const AlphabetgetAlphabet () 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 > & getParameter (const std::string &name) const
 

Protected Member Functions

void fireParameterChanged (const ParameterList &pl) override
 AbsractParametrizable interface. More...
 
virtual ParameterListgetParameters_ ()=0
 
ParameterListgetParameters_ () override
 
const std::shared_ptr< Parameter > & getParameter (size_t i) const
 
std::shared_ptr< Parameter > & getParameter (size_t i)
 
void addParameter_ (Parameter *parameter)
 
void addParameters_ (const ParameterList &parameters)
 
void shareParameter_ (const std::shared_ptr< Parameter > &parameter)
 
void shareParameters_ (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_ ()
 
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
 

Protected Attributes

std::shared_ptr< BranchModelInterfacemodel_
 
std::shared_ptr< ParametrizablePhyloTreepTree_
 
std::shared_ptr< FrequencySetInterfacerootFrequencies_
 Root frequencies. More...
 
std::shared_ptr< ModelScenariomodelScenario_
 

Private Attributes

ParameterList independentParameters_
 
std::map< std::string, std::shared_ptr< AliasParameterListener > > aliasListenersRegister_
 
ParameterList parameters_
 
std::string prefix_
 

Detailed Description

Space and time homogeneous substitution process, without mixture.

Definition at line 19 of file SimpleSubstitutionProcess.h.

Constructor & Destructor Documentation

◆ SimpleSubstitutionProcess() [1/3]

SimpleSubstitutionProcess::SimpleSubstitutionProcess ( std::shared_ptr< BranchModelInterface model,
std::shared_ptr< const PhyloTree tree = nullptr,
std::shared_ptr< FrequencySetInterface rootFrequencies = nullptr 
)

◆ SimpleSubstitutionProcess() [2/3]

SimpleSubstitutionProcess::SimpleSubstitutionProcess ( std::shared_ptr< BranchModelInterface model,
std::shared_ptr< ParametrizablePhyloTree tree,
std::shared_ptr< FrequencySetInterface rootFrequencies = nullptr 
)

◆ SimpleSubstitutionProcess() [3/3]

SimpleSubstitutionProcess::SimpleSubstitutionProcess ( const SimpleSubstitutionProcess ssp)

Member Function Documentation

◆ clone()

SimpleSubstitutionProcess* bpp::SimpleSubstitutionProcess::clone ( ) const
inlineoverridevirtual

◆ fireParameterChanged()

void SimpleSubstitutionProcess::fireParameterChanged ( const ParameterList pl)
overrideprotectedvirtual

AbsractParametrizable interface.

Reimplemented from bpp::AbstractAutonomousSubstitutionProcess.

Definition at line 81 of file SimpleSubstitutionProcess.cpp.

References bpp::AbstractAutonomousSubstitutionProcess::fireParameterChanged(), and model_.

◆ getAlphabet()

◆ getBranchLengthParameters()

ParameterList bpp::SimpleSubstitutionProcess::getBranchLengthParameters ( bool  independent) const
inlineoverridevirtual

◆ getClassProbabilities()

Vdouble bpp::SimpleSubstitutionProcess::getClassProbabilities ( ) const
inlineoverridevirtual
Returns
The vector of the probabilities associated to the classes.

Implements bpp::SubstitutionProcessInterface.

Definition at line 162 of file SimpleSubstitutionProcess.h.

◆ getModel() [1/2]

std::shared_ptr<const BranchModelInterface> bpp::SimpleSubstitutionProcess::getModel ( size_t  i) const
inlineoverridevirtual
Returns
A shared pointer toward the model with given index.

Implements bpp::SubstitutionProcessInterface.

Definition at line 75 of file SimpleSubstitutionProcess.h.

References model_.

◆ getModel() [2/2]

std::shared_ptr<const BranchModelInterface> bpp::SimpleSubstitutionProcess::getModel ( unsigned int  nodeId,
size_t  classIndex 
) const
inlineoverridevirtual

Get the substitution model corresponding to a certain branch, site pattern, and model class.

Parameters
nodeIdThe id of the node.
classIndexThe model class index.
Returns
A shared pointer toward the model with given index.

Implements bpp::SubstitutionProcessInterface.

Definition at line 65 of file SimpleSubstitutionProcess.h.

References model_.

◆ getModelForNode()

virtual std::shared_ptr<const BranchModelInterface> bpp::SimpleSubstitutionProcess::getModelForNode ( unsigned int  nodeId) const
inlineoverridevirtual

Get the model associated to a particular node id.

Parameters
nodeIdThe id of the query node.
Returns
A pointer toward the corresponding model.
Exceptions
ExceptionIf no model is found for this node.

Implements bpp::SubstitutionProcessInterface.

Definition at line 91 of file SimpleSubstitutionProcess.h.

References model_.

◆ getModelNumberForNode()

size_t bpp::SimpleSubstitutionProcess::getModelNumberForNode ( unsigned int  nodeId) const
inlineoverridevirtual

Get the number of the model associated to a particular node id.

Parameters
nodeIdThe id of the query node.
Returns
The number of the model associated to the given node.
Exceptions
ExceptionIf no model is found for this node.

Implements bpp::SubstitutionProcessInterface.

Definition at line 86 of file SimpleSubstitutionProcess.h.

◆ getModelNumbers()

std::vector<size_t> bpp::SimpleSubstitutionProcess::getModelNumbers ( ) const
inlineoverridevirtual
Returns
The current indexes of models used in the process

Implements bpp::SubstitutionProcessInterface.

Definition at line 55 of file SimpleSubstitutionProcess.h.

◆ getModelScenario()

std::shared_ptr<const ModelScenario> bpp::AbstractAutonomousSubstitutionProcess::getModelScenario ( ) const
inlinevirtualinherited

◆ getNodesWithModel()

const std::vector<unsigned int> bpp::SimpleSubstitutionProcess::getNodesWithModel ( size_t  i) const
inlineoverridevirtual

Get a list of nodes id for which the given model is associated.

Parameters
iThe index of the model in the set.
Returns
A vector with the ids of the node associated to this model.
Exceptions
IndexOutOfBoundsExceptionIf the index is not valid.

Implements bpp::SubstitutionProcessInterface.

Definition at line 80 of file SimpleSubstitutionProcess.h.

◆ getNonDerivableParameters() [1/2]

ParameterList AbstractSubstitutionProcess::getNonDerivableParameters ( ) const
virtualinherited

get NonDerivable parameters

Implements bpp::SubstitutionProcessInterface.

Reimplemented in bpp::SubstitutionProcessCollectionMember.

Definition at line 10 of file AbstractSubstitutionProcess.cpp.

References bpp::ParameterList::includeParameters().

◆ getNonDerivableParameters() [2/2]

virtual ParameterList bpp::SubstitutionProcessInterface::getNonDerivableParameters ( ) const
pure virtualinherited

◆ getNumberOfClasses() [1/2]

size_t bpp::AbstractSubstitutionProcess::getNumberOfClasses ( ) const
inlinevirtualinherited

◆ getNumberOfClasses() [2/2]

virtual size_t bpp::SubstitutionProcessInterface::getNumberOfClasses ( ) const
pure virtualinherited

◆ getNumberOfModels()

size_t bpp::SimpleSubstitutionProcess::getNumberOfModels ( ) const
inlineoverridevirtual
Returns
The current number of distinct models.

Implements bpp::SubstitutionProcessInterface.

Definition at line 53 of file SimpleSubstitutionProcess.h.

◆ getNumberOfStates() [1/2]

size_t bpp::AbstractSubstitutionProcess::getNumberOfStates ( ) const
inlinevirtualinherited

◆ getNumberOfStates() [2/2]

virtual size_t bpp::SubstitutionProcessInterface::getNumberOfStates ( ) const
pure virtualinherited

◆ getParametrizablePhyloTree()

◆ getProbabilityForModel()

double bpp::SimpleSubstitutionProcess::getProbabilityForModel ( size_t  classIndex) const
inlineoverridevirtual
Returns
The probability associated to the given model class.
Parameters
classIndexThe model class index.

Implements bpp::SubstitutionProcessInterface.

Definition at line 155 of file SimpleSubstitutionProcess.h.

◆ getRateDistribution() [1/2]

std::shared_ptr<const DiscreteDistributionInterface> bpp::SimpleSubstitutionProcess::getRateDistribution ( ) const
inlineoverridevirtual

Get a pointer to the rate distribution (or null if there is no rate distribution).

Implements bpp::SubstitutionProcessInterface.

Definition at line 96 of file SimpleSubstitutionProcess.h.

◆ getRateDistribution() [2/2]

std::shared_ptr<DiscreteDistributionInterface> bpp::SimpleSubstitutionProcess::getRateDistribution ( )
inlineoverridevirtual

Get a pointer to the rate distribution (or null if there is no rate distribution).

Implements bpp::SubstitutionProcessInterface.

Definition at line 101 of file SimpleSubstitutionProcess.h.

◆ getRateDistributionParameters()

ParameterList bpp::SimpleSubstitutionProcess::getRateDistributionParameters ( bool  independent) const
inlineoverridevirtual

Implements bpp::SubstitutionProcessInterface.

Definition at line 121 of file SimpleSubstitutionProcess.h.

◆ getRateForModel()

double bpp::SimpleSubstitutionProcess::getRateForModel ( size_t  classIndex) const
inlineoverridevirtual
Returns
The substitution rate associated to the given model class.
Parameters
classIndexThe model class index.

Implements bpp::SubstitutionProcessInterface.

Definition at line 167 of file SimpleSubstitutionProcess.h.

◆ getRootFrequencies()

const std::vector<double>& bpp::SimpleSubstitutionProcess::getRootFrequencies ( ) const
inlineoverridevirtual

Get the values of the frequencies for each state in the alphabet at the root node.

For reversible models, these are the equilibrium frequencies. For non-reversible models, these usually are distinct parameters.

Returns
A vector with ancestral frequencies for each state in the alphabet;

Implements bpp::SubstitutionProcessInterface.

Definition at line 134 of file SimpleSubstitutionProcess.h.

References bpp::AbstractAutonomousSubstitutionProcess::getRootFrequencySet(), bpp::AbstractAutonomousSubstitutionProcess::hasRootFrequencySet(), and model_.

◆ getRootFrequenciesParameters()

ParameterList bpp::AbstractAutonomousSubstitutionProcess::getRootFrequenciesParameters ( bool  independent) const
inlinevirtualinherited

Get the parameters corresponding to the root frequencies.

Returns
The parameters corresponding to the root frequencies.

Implements bpp::SubstitutionProcessInterface.

Definition at line 130 of file AbstractAutonomousSubstitutionProcess.h.

References bpp::AbstractAutonomousSubstitutionProcess::hasRootFrequencySet(), and bpp::AbstractAutonomousSubstitutionProcess::rootFrequencies_.

◆ getRootFrequencySet() [1/2]

std::shared_ptr<FrequencySetInterface> bpp::AbstractAutonomousSubstitutionProcess::getRootFrequencySet ( )
inlinevirtualinherited
Returns
A pointer toward rhe set of parametrized root frequencies.

Implements bpp::SubstitutionProcessInterface.

Definition at line 106 of file AbstractAutonomousSubstitutionProcess.h.

References bpp::AbstractAutonomousSubstitutionProcess::rootFrequencies_.

◆ getRootFrequencySet() [2/2]

std::shared_ptr<const FrequencySetInterface> bpp::AbstractAutonomousSubstitutionProcess::getRootFrequencySet ( ) const
inlinevirtualinherited

◆ getStateMap()

std::shared_ptr<const StateMapInterface> bpp::SimpleSubstitutionProcess::getStateMap ( ) const
inlineoverridevirtual

Implements bpp::SubstitutionProcessInterface.

Definition at line 48 of file SimpleSubstitutionProcess.h.

References model_.

◆ getSubstitutionModelParameters()

ParameterList bpp::SimpleSubstitutionProcess::getSubstitutionModelParameters ( bool  independent) const
inlineoverridevirtual

Methods to retrieve the parameters of specific objects.

Implements bpp::SubstitutionProcessInterface.

Definition at line 116 of file SimpleSubstitutionProcess.h.

References model_.

◆ hasRootFrequencySet()

bool bpp::AbstractAutonomousSubstitutionProcess::hasRootFrequencySet ( ) const
inlinevirtualinherited

◆ isCompatibleWith() [1/2]

bool bpp::AbstractSubstitutionProcess::isCompatibleWith ( const AlignmentDataInterface data) const
inlinevirtualinherited

◆ isCompatibleWith() [2/2]

virtual bool bpp::SubstitutionProcessInterface::isCompatibleWith ( const AlignmentDataInterface data) const
pure virtualinherited

◆ model() [1/2]

const BranchModelInterface& bpp::SimpleSubstitutionProcess::model ( size_t  i) const
inlineoverridevirtual
Returns
the model with given index.

Implements bpp::SubstitutionProcessInterface.

Definition at line 70 of file SimpleSubstitutionProcess.h.

References model_.

◆ model() [2/2]

const BranchModelInterface& bpp::SimpleSubstitutionProcess::model ( unsigned int  nodeId,
size_t  classIndex 
) const
inlineoverridevirtual

Get the substitution model corresponding to a certain branch, site pattern, and model class.

Parameters
nodeIdThe id of the node.
classIndexThe model class index.
Returns
the model with given index.

Implements bpp::SubstitutionProcessInterface.

Definition at line 60 of file SimpleSubstitutionProcess.h.

References model_.

Referenced by SimpleSubstitutionProcess().

◆ operator=()

◆ parametrizablePhyloTree()

const ParametrizablePhyloTree& bpp::AbstractAutonomousSubstitutionProcess::parametrizablePhyloTree ( ) const
inlinevirtualinherited

◆ rateDistribution() [1/2]

const DiscreteDistributionInterface& bpp::SimpleSubstitutionProcess::rateDistribution ( ) const
inlineoverridevirtual

Get the rate distribution.

Exceptions
NullPointerExceptionif there is no associated rate distribution.

Implements bpp::SubstitutionProcessInterface.

Definition at line 106 of file SimpleSubstitutionProcess.h.

◆ rateDistribution() [2/2]

DiscreteDistributionInterface& bpp::SimpleSubstitutionProcess::rateDistribution ( )
inlineoverridevirtual

Get the rate distribution.

Exceptions
NullPointerExceptionif there is no associated rate distribution.

Implements bpp::SubstitutionProcessInterface.

Definition at line 111 of file SimpleSubstitutionProcess.h.

◆ rootFrequencySet() [1/2]

FrequencySetInterface& bpp::AbstractAutonomousSubstitutionProcess::rootFrequencySet ( )
inlinevirtualinherited
Returns
The set of parametrized root frequencies.

Implements bpp::SubstitutionProcessInterface.

Definition at line 101 of file AbstractAutonomousSubstitutionProcess.h.

References bpp::AbstractAutonomousSubstitutionProcess::rootFrequencies_.

◆ rootFrequencySet() [2/2]

const FrequencySetInterface& bpp::AbstractAutonomousSubstitutionProcess::rootFrequencySet ( ) const
inlinevirtualinherited

◆ setModelScenario()

void SimpleSubstitutionProcess::setModelScenario ( std::shared_ptr< ModelScenario modelpath)
overridevirtual

Set the modelPath, after checking it is valid (ie modelpath has only the model of the process).

Implements bpp::AbstractAutonomousSubstitutionProcess.

Definition at line 61 of file SimpleSubstitutionProcess.cpp.

References model_, and bpp::AbstractAutonomousSubstitutionProcess::modelScenario_.

◆ setPhyloTree()

◆ setRootFrequencySet()

void bpp::AbstractAutonomousSubstitutionProcess::setRootFrequencySet ( std::shared_ptr< FrequencySetInterface rootfrequency)
inlinevirtualinherited

◆ stateMap()

const StateMapInterface& bpp::SimpleSubstitutionProcess::stateMap ( ) const
inlineoverridevirtual
Returns
The state map associated with the models of this process

Implements bpp::SubstitutionProcessInterface.

Definition at line 43 of file SimpleSubstitutionProcess.h.

References model_.

Member Data Documentation

◆ model_

◆ modelScenario_

◆ pTree_

◆ rootFrequencies_


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