bpp-phyl3  3.0.0
bpp::TsTvSubstitutionRegister Class Reference

Distinguishes transitions from transversions. More...

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

+ Inheritance diagram for bpp::TsTvSubstitutionRegister:
+ Collaboration diagram for bpp::TsTvSubstitutionRegister:

Public Member Functions

 TsTvSubstitutionRegister (std::shared_ptr< const StateMapInterface > stateMap)
 
 TsTvSubstitutionRegister (std::shared_ptr< const StateMapInterface > stateMap, std::shared_ptr< const GeneticCode > genCode)
 
 TsTvSubstitutionRegister (const TsTvSubstitutionRegister &reg)
 
TsTvSubstitutionRegisteroperator= (const TsTvSubstitutionRegister &reg)
 
TsTvSubstitutionRegisterclone () const
 
size_t getNumberOfSubstitutionTypes () const
 
size_t getType (size_t fromState, size_t toState) const
 Get the substitution type far a given pair of model states. More...
 
std::string getTypeName (size_t type) const
 Get the name of a given substitution type. More...
 
const StateMapInterfacestateMap () const override
 
std::shared_ptr< const StateMapInterfacegetStateMap () const override
 
const Alphabetalphabet () const override
 
std::shared_ptr< const AlphabetgetAlphabet () const override
 
const std::string & getName () const override
 Get the name of the register. More...
 

Protected Attributes

std::shared_ptr< const StateMapInterfacestateMap_
 
std::string name_
 

Private Attributes

std::shared_ptr< const GeneticCodegenCode_
 useful for codon alphabet More...
 

Detailed Description

Distinguishes transitions from transversions.

This register has two substitution types, mapped as:

  • 0 not a substitution
  • 1 a transition
  • 2 a transversion

Definition at line 740 of file SubstitutionRegister.h.

Constructor & Destructor Documentation

◆ TsTvSubstitutionRegister() [1/3]

bpp::TsTvSubstitutionRegister::TsTvSubstitutionRegister ( std::shared_ptr< const StateMapInterface stateMap)
inline

Definition at line 750 of file SubstitutionRegister.h.

Referenced by clone().

◆ TsTvSubstitutionRegister() [2/3]

bpp::TsTvSubstitutionRegister::TsTvSubstitutionRegister ( std::shared_ptr< const StateMapInterface stateMap,
std::shared_ptr< const GeneticCode genCode 
)
inline

Definition at line 755 of file SubstitutionRegister.h.

◆ TsTvSubstitutionRegister() [3/3]

bpp::TsTvSubstitutionRegister::TsTvSubstitutionRegister ( const TsTvSubstitutionRegister reg)
inline

Definition at line 760 of file SubstitutionRegister.h.

Member Function Documentation

◆ alphabet()

const Alphabet& bpp::AbstractSubstitutionRegister::alphabet ( ) const
inlineoverridevirtualinherited
Returns
The alphabet associated to this instance.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 133 of file SubstitutionRegister.h.

References bpp::AbstractSubstitutionRegister::stateMap_.

◆ clone()

TsTvSubstitutionRegister* bpp::TsTvSubstitutionRegister::clone ( ) const
inlinevirtual

Implements bpp::SubstitutionRegisterInterface.

Definition at line 772 of file SubstitutionRegister.h.

References TsTvSubstitutionRegister().

◆ getAlphabet()

std::shared_ptr<const Alphabet> bpp::AbstractSubstitutionRegister::getAlphabet ( ) const
inlineoverridevirtualinherited
Returns
A shared_ptr toward the alphabet associated to this instance.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 135 of file SubstitutionRegister.h.

References bpp::AbstractSubstitutionRegister::stateMap_.

◆ getName()

const std::string& bpp::AbstractSubstitutionRegister::getName ( ) const
inlineoverridevirtualinherited

Get the name of the register.

Returns
A string describing the register.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 137 of file SubstitutionRegister.h.

References bpp::AbstractSubstitutionRegister::name_.

◆ getNumberOfSubstitutionTypes()

size_t bpp::TsTvSubstitutionRegister::getNumberOfSubstitutionTypes ( ) const
inlinevirtual
Returns
The number of substitution types supported by this class.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 775 of file SubstitutionRegister.h.

◆ getStateMap()

std::shared_ptr<const StateMapInterface> bpp::AbstractSubstitutionRegister::getStateMap ( ) const
inlineoverridevirtualinherited
Returns
A shared_ptr toward the state map associated to this instance.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 131 of file SubstitutionRegister.h.

References bpp::AbstractSubstitutionRegister::stateMap_.

◆ getType()

size_t bpp::TsTvSubstitutionRegister::getType ( size_t  fromState,
size_t  toState 
) const
inlinevirtual

Get the substitution type far a given pair of model states.

Parameters
fromStateInitial state (should be a state supported by the specified alphabet).
toStateFinal state (should be a state supported by the specified alphabet).
Returns
The index of the corresponding substitution type, ranging from 0 to 'getNumberOfSubstitutionTypes' + 1, as non-substitution (that is when fromState == toState) will always return 0.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 777 of file SubstitutionRegister.h.

References bpp::abs(), genCode_, bpp::StateMapInterface::getAlphabetStateAsInt(), and bpp::AbstractSubstitutionRegister::stateMap().

◆ getTypeName()

std::string bpp::TsTvSubstitutionRegister::getTypeName ( size_t  type) const
inlinevirtual

Get the name of a given substitution type.

This method is only used for user-friendlyness purposes, not computational goal. I can therefore be left unimplemented in some cases.

Parameters
typeIndex of the substitution (should be an size_t contained in the register).
Returns
A string describing the substitution type.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 818 of file SubstitutionRegister.h.

◆ operator=()

TsTvSubstitutionRegister& bpp::TsTvSubstitutionRegister::operator= ( const TsTvSubstitutionRegister reg)
inline

◆ stateMap()

Member Data Documentation

◆ genCode_

std::shared_ptr<const GeneticCode> bpp::TsTvSubstitutionRegister::genCode_
private

useful for codon alphabet

Definition at line 747 of file SubstitutionRegister.h.

Referenced by getType(), and operator=().

◆ name_

std::string bpp::AbstractSubstitutionRegister::name_
protectedinherited

◆ stateMap_


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