bpp-phyl  2.2.0
bpp::SubstitutionCount Class Referenceabstract

The SubstitutionsCount interface. More...

#include <Bpp/Phyl/Mapping/SubstitutionCount.h>

+ Inheritance diagram for bpp::SubstitutionCount:
+ Collaboration diagram for bpp::SubstitutionCount:

Public Member Functions

 SubstitutionCount ()
 
virtual ~SubstitutionCount ()
 
virtual SubstitutionCountclone () const =0
 
virtual bool hasSubstitutionRegister () const =0
 
virtual const SubstitutionRegistergetSubstitutionRegister () const =0
 
virtual SubstitutionRegistergetSubstitutionRegister ()=0
 
virtual void setSubstitutionRegister (SubstitutionRegister *reg)=0
 
virtual size_t getNumberOfSubstitutionTypes () const
 Short cut function, equivalent to getSubstitutionRegister().getNumberOfSubstitutionTypes(). More...
 
virtual const Alphabet * getAlphabet () const
 Short cut function, equivalent to getSubstitutionRegister()->getAlphabet(). More...
 
virtual size_t getNumberOfStates () const
 Short cut function, equivalent to getSubstitutionRegister()->getAlphabet()->getSize(). More...
 
virtual double getNumberOfSubstitutions (size_t initialState, size_t finalState, double length, size_t type) const =0
 Get the number of susbstitutions on a branch, given the initial and final states, and the branch length. More...
 
virtual Matrix< double > * getAllNumbersOfSubstitutions (double length, size_t type) const =0
 Get the numbers of susbstitutions on a branch, for each initial and final states, and given the branch length. More...
 
virtual std::vector< double > getNumberOfSubstitutionsForEachType (size_t initialState, size_t finalState, double length) const =0
 Get the numbers of susbstitutions on a branch for all types, for an initial and final states, given the branch length. More...
 
virtual void setSubstitutionModel (const SubstitutionModel *model)=0
 Set the substitution model associated with this count, if relevent. More...
 

Detailed Description

The SubstitutionsCount interface.

Provide a method to compute the $n_{x,y}(t)$ function, namely the number of substitutions on a branch of length $t$, with initial state $x$ and final state $y$.

The new implementation offers to perform several counts simultaneously, distinguishing between different types of substitutions. Therefore substitution count object takes as input a SubstitutionRegister, which describes all types of substitutions and associate them with an index. All counts can be retrieved in one go as a vector, the type serving as an indice.

Author
Julien Dutheil

See: Dutheil J, Pupko T, Jean-Marie A, Galtier N. A model-based approach for detecting coevolving positions in a molecule. Mol Biol Evol. 2005 Sep;22(9):1919-28. Epub 2005 Jun 8.

Definition at line 70 of file SubstitutionCount.h.

Constructor & Destructor Documentation

◆ SubstitutionCount()

bpp::SubstitutionCount::SubstitutionCount ( )
inline

Definition at line 74 of file SubstitutionCount.h.

◆ ~SubstitutionCount()

virtual bpp::SubstitutionCount::~SubstitutionCount ( )
inlinevirtual

Definition at line 75 of file SubstitutionCount.h.

Member Function Documentation

◆ clone()

◆ getAllNumbersOfSubstitutions()

virtual Matrix<double>* bpp::SubstitutionCount::getAllNumbersOfSubstitutions ( double  length,
size_t  type 
) const
pure virtual

Get the numbers of susbstitutions on a branch, for each initial and final states, and given the branch length.

Parameters
lengthThe length of the branch.
typeThe type of susbstitution to count.
Returns
A matrix with all numbers of substitutions for each initial and final states.

Implemented in bpp::LabelSubstitutionCount, bpp::DecompositionSubstitutionCount, bpp::UniformizationSubstitutionCount, bpp::NaiveSubstitutionCount, bpp::LaplaceSubstitutionCount, and bpp::OneJumpSubstitutionCount.

◆ getAlphabet()

virtual const Alphabet* bpp::SubstitutionCount::getAlphabet ( ) const
inlinevirtual

Short cut function, equivalent to getSubstitutionRegister()->getAlphabet().

Returns
The alphabet associated to this substitution count.

Definition at line 112 of file SubstitutionCount.h.

References bpp::SubstitutionRegister::getAlphabet(), and getSubstitutionRegister().

◆ getNumberOfStates()

virtual size_t bpp::SubstitutionCount::getNumberOfStates ( ) const
inlinevirtual

Short cut function, equivalent to getSubstitutionRegister()->getAlphabet()->getSize().

Returns
The number of states in the model/alphabet.

Definition at line 119 of file SubstitutionCount.h.

References bpp::SubstitutionRegister::getAlphabet(), and getSubstitutionRegister().

◆ getNumberOfSubstitutions()

virtual double bpp::SubstitutionCount::getNumberOfSubstitutions ( size_t  initialState,
size_t  finalState,
double  length,
size_t  type 
) const
pure virtual

Get the number of susbstitutions on a branch, given the initial and final states, and the branch length.

Parameters
initialStateThe initial state.
finalStateThe final state.
lengthThe length of the branch.
typeThe type of substitution to count.
Returns
The number of substitutions on a branch of specified length and according to initial and final states.

Implemented in bpp::LabelSubstitutionCount, bpp::DecompositionSubstitutionCount, bpp::UniformizationSubstitutionCount, bpp::LaplaceSubstitutionCount, bpp::NaiveSubstitutionCount, and bpp::OneJumpSubstitutionCount.

◆ getNumberOfSubstitutionsForEachType()

virtual std::vector<double> bpp::SubstitutionCount::getNumberOfSubstitutionsForEachType ( size_t  initialState,
size_t  finalState,
double  length 
) const
pure virtual

Get the numbers of susbstitutions on a branch for all types, for an initial and final states, given the branch length.

Parameters
initialStateThe initial state.
finalStateThe final state.
lengthThe length of the branch.
Returns
A matrix with all numbers of substitutions for each initial and final states.

Implemented in bpp::LabelSubstitutionCount, bpp::DecompositionSubstitutionCount, bpp::UniformizationSubstitutionCount, bpp::NaiveSubstitutionCount, bpp::LaplaceSubstitutionCount, and bpp::OneJumpSubstitutionCount.

◆ getNumberOfSubstitutionTypes()

◆ getSubstitutionRegister() [1/2]

virtual const SubstitutionRegister* bpp::SubstitutionCount::getSubstitutionRegister ( ) const
pure virtual
Returns
The SubstitutionRegister object associated to this instance. The register contains the description of the various substitutions types that are mapped.

Implemented in bpp::AbstractSubstitutionCount.

Referenced by getAlphabet(), getNumberOfStates(), and getNumberOfSubstitutionTypes().

◆ getSubstitutionRegister() [2/2]

virtual SubstitutionRegister* bpp::SubstitutionCount::getSubstitutionRegister ( )
pure virtual
Returns
The SubstitutionRegister object associated to this instance. The register contains the description of the various substitutions types that are mapped.

Implemented in bpp::AbstractSubstitutionCount.

◆ hasSubstitutionRegister()

virtual bool bpp::SubstitutionCount::hasSubstitutionRegister ( ) const
pure virtual
Returns
Tell if a substitution register has been attached to this class.

Implemented in bpp::AbstractSubstitutionCount.

◆ setSubstitutionModel()

virtual void bpp::SubstitutionCount::setSubstitutionModel ( const SubstitutionModel model)
pure virtual

Set the substitution model associated with this count, if relevent.

Parameters
modelThe substitution model to use with this count.

Implemented in bpp::LabelSubstitutionCount, bpp::DecompositionSubstitutionCount, bpp::NaiveSubstitutionCount, bpp::UniformizationSubstitutionCount, bpp::LaplaceSubstitutionCount, and bpp::OneJumpSubstitutionCount.

◆ setSubstitutionRegister()

virtual void bpp::SubstitutionCount::setSubstitutionRegister ( SubstitutionRegister reg)
pure virtual
Parameters
regThe new SubstitutionRegister object to be associated to this instance. The register contains the description of the various substitutions types that are mapped.

Implemented in bpp::AbstractSubstitutionCount, bpp::LabelSubstitutionCount, bpp::LaplaceSubstitutionCount, and bpp::OneJumpSubstitutionCount.


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