bpp-phyl3  3.0.0
bpp::SWSubstitutionRegister Class Reference

Distinguishes substitutions given the link between the changed nucleotides : S for strong (GC) and W for weak (AT). More...

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

+ Inheritance diagram for bpp::SWSubstitutionRegister:
+ Collaboration diagram for bpp::SWSubstitutionRegister:

Public Member Functions

 SWSubstitutionRegister (std::shared_ptr< const StateMapInterface > stateMap)
 
 SWSubstitutionRegister (std::shared_ptr< const StateMapInterface > stateMap, std::shared_ptr< const GeneticCode > genCode)
 
 SWSubstitutionRegister (const SWSubstitutionRegister &reg)
 
SWSubstitutionRegisteroperator= (const SWSubstitutionRegister &reg)
 
SWSubstitutionRegisterclone () 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 substitutions given the link between the changed nucleotides : S for strong (GC) and W for weak (AT).

This register has 4 substitution types, mapped as:

  • 0 not a substitution
  • 1 S->S
  • 2 S->W
  • 3 W->S
  • 4 W->W

Definition at line 850 of file SubstitutionRegister.h.

Constructor & Destructor Documentation

◆ SWSubstitutionRegister() [1/3]

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

Definition at line 860 of file SubstitutionRegister.h.

Referenced by clone().

◆ SWSubstitutionRegister() [2/3]

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

Definition at line 865 of file SubstitutionRegister.h.

◆ SWSubstitutionRegister() [3/3]

bpp::SWSubstitutionRegister::SWSubstitutionRegister ( const SWSubstitutionRegister reg)
inline

Definition at line 872 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()

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

Implements bpp::SubstitutionRegisterInterface.

Definition at line 884 of file SubstitutionRegister.h.

References SWSubstitutionRegister().

◆ 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::SWSubstitutionRegister::getNumberOfSubstitutionTypes ( ) const
inlinevirtual
Returns
The number of substitution types supported by this class.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 887 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::SWSubstitutionRegister::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 889 of file SubstitutionRegister.h.

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

◆ getTypeName()

std::string bpp::SWSubstitutionRegister::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 951 of file SubstitutionRegister.h.

◆ operator=()

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

◆ stateMap()

Member Data Documentation

◆ genCode_

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

useful for codon alphabet

Definition at line 857 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: