bpp-phyl  2.2.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 (const NucleotideSubstitutionModel *model)
 
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 SubstitutionModelgetSubstitutionModel () const
 
const Alphabet * getAlphabet () const
 

Protected Attributes

const SubstitutionModelmodel_
 

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 806 of file SubstitutionRegister.h.

Constructor & Destructor Documentation

◆ TsTvSubstitutionRegister()

bpp::TsTvSubstitutionRegister::TsTvSubstitutionRegister ( const NucleotideSubstitutionModel model)
inline

Definition at line 810 of file SubstitutionRegister.h.

Referenced by clone().

Member Function Documentation

◆ clone()

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

Implements bpp::SubstitutionRegister.

Definition at line 814 of file SubstitutionRegister.h.

References TsTvSubstitutionRegister().

◆ getAlphabet()

const Alphabet* bpp::AbstractSubstitutionRegister::getAlphabet ( ) const
inlinevirtualinherited
Returns
The alphabet associated to this instance.

Implements bpp::SubstitutionRegister.

Definition at line 147 of file SubstitutionRegister.h.

References bpp::SubstitutionModel::getAlphabet(), and bpp::AbstractSubstitutionRegister::model_.

◆ getNumberOfSubstitutionTypes()

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

Implements bpp::SubstitutionRegister.

Definition at line 817 of file SubstitutionRegister.h.

◆ getSubstitutionModel()

const SubstitutionModel* bpp::AbstractSubstitutionRegister::getSubstitutionModel ( ) const
inlinevirtualinherited
Returns
The substitution model associated to this instance.

Implements bpp::SubstitutionRegister.

Definition at line 145 of file SubstitutionRegister.h.

References bpp::AbstractSubstitutionRegister::model_.

◆ 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::SubstitutionRegister.

Definition at line 819 of file SubstitutionRegister.h.

References bpp::SubstitutionModel::getAlphabetStateAsInt(), and bpp::AbstractSubstitutionRegister::model_.

◆ 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::SubstitutionRegister.

Definition at line 833 of file SubstitutionRegister.h.

Member Data Documentation

◆ model_


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