bpp-phyl3
3.0.0
|
This class implements a state map where all resolved states are modeled. More...
#include <Bpp/Phyl/Model/StateMap.h>
Public Member Functions | |
CanonicalStateMap (std::shared_ptr< const Alphabet > alphabet, bool includeGaps) | |
CanonicalStateMap (const StateMapInterface &sm, bool includeGaps) | |
this constructors takes an existing StateMap and adds one model states for gaps. If the original StateMap already had a state for gaps, a new one will be appended. More... | |
virtual CanonicalStateMap * | clone () const |
virtual std::string | getStateDescription (size_t index) const |
const Alphabet & | alphabet () const override |
std::shared_ptr< const Alphabet > | getAlphabet () const override |
size_t | getNumberOfModelStates () const override |
const std::vector< int > & | getAlphabetStates () const override |
int | getAlphabetStateAsInt (size_t index) const override |
std::string | getAlphabetStateAsChar (size_t index) const override |
std::vector< size_t > | getModelStates (int code) const override |
std::vector< size_t > | getModelStates (const std::string &code) const override |
bool | operator== (const StateMapInterface &sm) const override |
Comparison operator==. More... | |
bool | operator!= (const StateMapInterface &sm) const override |
Comparison operator!=. More... | |
Protected Attributes | |
std::shared_ptr< const Alphabet > | alphabet_ |
std::vector< int > | states_ |
This class implements a state map where all resolved states are modeled.
For nucleotides, the underlying states are for instance: A (0), C (1), G (2), T/U (3). Optionally, gaps can be modeled.
Definition at line 166 of file StateMap.h.
CanonicalStateMap::CanonicalStateMap | ( | std::shared_ptr< const Alphabet > | alphabet, |
bool | includeGaps | ||
) |
Definition at line 10 of file StateMap.cpp.
References bpp::AbstractStateMap::alphabet(), bpp::Alphabet::getGapCharacterCode(), bpp::Alphabet::getIntCodeAt(), bpp::Alphabet::getSize(), bpp::Alphabet::isGap(), and bpp::AbstractStateMap::states_.
Referenced by clone().
CanonicalStateMap::CanonicalStateMap | ( | const StateMapInterface & | sm, |
bool | includeGaps | ||
) |
this constructors takes an existing StateMap and adds one model states for gaps. If the original StateMap already had a state for gaps, a new one will be appended.
Definition at line 25 of file StateMap.cpp.
References bpp::StateMapInterface::getAlphabet(), bpp::StateMapInterface::getAlphabetStateAsInt(), bpp::StateMapInterface::getNumberOfModelStates(), and bpp::AbstractStateMap::states_.
|
inlineoverridevirtualinherited |
Implements bpp::StateMapInterface.
Definition at line 130 of file StateMap.h.
References bpp::AbstractStateMap::alphabet_.
Referenced by CanonicalStateMap().
|
inlinevirtual |
Implements bpp::StateMapInterface.
Definition at line 178 of file StateMap.h.
References CanonicalStateMap().
|
inlineoverridevirtualinherited |
Implements bpp::StateMapInterface.
Definition at line 131 of file StateMap.h.
References bpp::AbstractStateMap::alphabet_.
|
inlineoverridevirtualinherited |
index | The model state. |
Implements bpp::StateMapInterface.
Definition at line 135 of file StateMap.h.
References bpp::AbstractStateMap::alphabet_, and bpp::AbstractStateMap::states_.
Referenced by getStateDescription(), and bpp::MarkovModulatedStateMap::getStateDescription().
|
inlineoverridevirtualinherited |
index | The model state. |
Implements bpp::StateMapInterface.
Definition at line 134 of file StateMap.h.
References bpp::AbstractStateMap::states_.
|
inlineoverridevirtualinherited |
Implements bpp::StateMapInterface.
Definition at line 133 of file StateMap.h.
References bpp::AbstractStateMap::states_.
|
inlineoverridevirtualinherited |
code | The character code of the alphabet state to check. |
Implements bpp::StateMapInterface.
Definition at line 140 of file StateMap.h.
References bpp::AbstractStateMap::alphabet_, bpp::AbstractStateMap::states_, and bpp::VectorTools::whichAll().
|
inlineoverridevirtualinherited |
code | The int code of the alphabet state to check. |
Implements bpp::StateMapInterface.
Definition at line 136 of file StateMap.h.
References bpp::AbstractStateMap::states_, and bpp::VectorTools::whichAll().
|
inlineoverridevirtualinherited |
Implements bpp::StateMapInterface.
Definition at line 132 of file StateMap.h.
References bpp::AbstractStateMap::states_.
|
inlinevirtual |
index | The state index. |
Implements bpp::StateMapInterface.
Definition at line 180 of file StateMap.h.
References bpp::AbstractStateMap::getAlphabetStateAsChar().
|
inlineoverridevirtualinherited |
Comparison operator!=.
Two StateMaps are not identical if they do not share the same alphabet or states.
Implements bpp::StateMapInterface.
Definition at line 152 of file StateMap.h.
References bpp::StateMapInterface::alphabet(), bpp::AbstractStateMap::alphabet_, bpp::StateMapInterface::getAlphabetStates(), bpp::Alphabet::getAlphabetType(), and bpp::AbstractStateMap::states_.
|
inlineoverridevirtualinherited |
Comparison operator==.
Two StateMaps are identical if they share the same alphabet and states.
Implements bpp::StateMapInterface.
Definition at line 145 of file StateMap.h.
References bpp::StateMapInterface::alphabet(), bpp::AbstractStateMap::alphabet_, bpp::StateMapInterface::getAlphabetStates(), bpp::Alphabet::getAlphabetType(), and bpp::AbstractStateMap::states_.
|
protectedinherited |
Definition at line 108 of file StateMap.h.
Referenced by bpp::AbstractStateMap::alphabet(), bpp::AbstractStateMap::getAlphabet(), bpp::AbstractStateMap::getAlphabetStateAsChar(), bpp::AbstractStateMap::getModelStates(), bpp::AbstractStateMap::operator!=(), bpp::AbstractStateMap::operator=(), and bpp::AbstractStateMap::operator==().
|
protectedinherited |
Definition at line 109 of file StateMap.h.
Referenced by CanonicalStateMap(), bpp::AbstractStateMap::getAlphabetStateAsChar(), bpp::AbstractStateMap::getAlphabetStateAsInt(), bpp::AbstractStateMap::getAlphabetStates(), bpp::AbstractStateMap::getModelStates(), bpp::AbstractStateMap::getNumberOfModelStates(), bpp::MarkovModulatedStateMap::MarkovModulatedStateMap(), bpp::AbstractStateMap::operator!=(), bpp::AbstractStateMap::operator=(), and bpp::AbstractStateMap::operator==().