bpp-phyl  2.2.0
bpp::MarkovModulatedStateMap Class Reference

This class implements a state map for Markov modulated models. More...

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

+ Inheritance diagram for bpp::MarkovModulatedStateMap:
+ Collaboration diagram for bpp::MarkovModulatedStateMap:

Public Member Functions

 MarkovModulatedStateMap (const StateMap &unitMap, unsigned int nbClasses)
 
virtual MarkovModulatedStateMapclone () const
 
virtual const Alphabet * getAlphabet () const
 
virtual size_t getNumberOfModelStates () const
 
virtual const std::vector< int > & getAlphabetStates () const
 
virtual int getAlphabetStateAsInt (size_t index) const
 
virtual std::string getAlphabetStateAsChar (size_t index) const
 
virtual std::vector< size_t > getModelStates (int code) const
 
virtual std::vector< size_t > getModelStates (const std::string &code) const
 

Protected Attributes

const Alphabet * alphabet_
 
std::vector< int > states_
 

Detailed Description

This class implements a state map for Markov modulated models.

For nucleotides with two classes, the underlying states are for instance: A (0), C (1), G (2), T/U (3), A (4), C (5), G (6), T/U (7).

Definition at line 185 of file StateMap.h.

Constructor & Destructor Documentation

◆ MarkovModulatedStateMap()

MarkovModulatedStateMap::MarkovModulatedStateMap ( const StateMap unitMap,
unsigned int  nbClasses 
)

Member Function Documentation

◆ clone()

virtual MarkovModulatedStateMap* bpp::MarkovModulatedStateMap::clone ( ) const
inlinevirtual

Implements bpp::StateMap.

Definition at line 190 of file StateMap.h.

References MarkovModulatedStateMap().

◆ getAlphabet()

virtual const Alphabet* bpp::AbstractStateMap::getAlphabet ( ) const
inlinevirtualinherited
Returns
The associated alphabet.

Implements bpp::StateMap.

Definition at line 141 of file StateMap.h.

References bpp::AbstractStateMap::alphabet_.

◆ getAlphabetStateAsChar()

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

Implements bpp::StateMap.

Definition at line 145 of file StateMap.h.

References bpp::AbstractStateMap::alphabet_, and bpp::AbstractStateMap::states_.

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

◆ getAlphabetStateAsInt()

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

Implements bpp::StateMap.

Definition at line 144 of file StateMap.h.

References bpp::AbstractStateMap::states_.

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

◆ getAlphabetStates()

virtual const std::vector<int>& bpp::AbstractStateMap::getAlphabetStates ( ) const
inlinevirtualinherited
Returns
A vector with the corresponding alphabet states for each model state. the size of the vector is the number of model states, not the number of supported alphabet states, as distinct model states can correspond to a single alphabet state.

Implements bpp::StateMap.

Definition at line 143 of file StateMap.h.

References bpp::AbstractStateMap::states_.

Referenced by bpp::MarkovModulatedSubstitutionModel::getAlphabetStates().

◆ getModelStates() [1/2]

virtual std::vector<size_t> bpp::AbstractStateMap::getModelStates ( int  code) const
inlinevirtualinherited
Parameters
codeThe int code of the alphabet state to check.
Returns
The corresponding model states, is any.

Implements bpp::StateMap.

Definition at line 146 of file StateMap.h.

References bpp::AbstractStateMap::states_.

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

◆ getModelStates() [2/2]

virtual std::vector<size_t> bpp::AbstractStateMap::getModelStates ( const std::string &  code) const
inlinevirtualinherited
Parameters
codeThe character code of the alphabet state to check.
Returns
The corresponding model states, is any.

Implements bpp::StateMap.

Definition at line 149 of file StateMap.h.

References bpp::AbstractStateMap::alphabet_, and bpp::AbstractStateMap::states_.

◆ getNumberOfModelStates()

virtual size_t bpp::AbstractStateMap::getNumberOfModelStates ( ) const
inlinevirtualinherited
Returns
The number of states supported by the model.

Implements bpp::StateMap.

Definition at line 142 of file StateMap.h.

References bpp::AbstractStateMap::states_.

Member Data Documentation

◆ alphabet_

const Alphabet* bpp::AbstractStateMap::alphabet_
protectedinherited

◆ states_


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