bpp-phyl3  3.0.0
bpp::DnDsSubstitutionRegister Class Reference

Distinguishes synonymous from non-synonymous substitutions. More...

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

+ Inheritance diagram for bpp::DnDsSubstitutionRegister:
+ Collaboration diagram for bpp::DnDsSubstitutionRegister:

Public Member Functions

 DnDsSubstitutionRegister (std::shared_ptr< const StateMapInterface > stateMap, std::shared_ptr< const GeneticCode > genCode, bool countMultiple=false)
 
 DnDsSubstitutionRegister (const DnDsSubstitutionRegister &reg)
 
DnDsSubstitutionRegisteroperator= (const DnDsSubstitutionRegister &reg)
 
DnDsSubstitutionRegisterclone () 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_
 
bool countMultiple_
 

Detailed Description

Distinguishes synonymous from non-synonymous substitutions.

This register has two substitution types, mapped as:

  • 0 not a substitution
  • 1 a synonymous substitution
  • 2 a non-synonymous substitution

Definition at line 980 of file SubstitutionRegister.h.

Constructor & Destructor Documentation

◆ DnDsSubstitutionRegister() [1/2]

bpp::DnDsSubstitutionRegister::DnDsSubstitutionRegister ( std::shared_ptr< const StateMapInterface stateMap,
std::shared_ptr< const GeneticCode genCode,
bool  countMultiple = false 
)
inline

Definition at line 988 of file SubstitutionRegister.h.

Referenced by clone().

◆ DnDsSubstitutionRegister() [2/2]

bpp::DnDsSubstitutionRegister::DnDsSubstitutionRegister ( const DnDsSubstitutionRegister reg)
inline

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

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

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

Implements bpp::SubstitutionRegisterInterface.

Definition at line 1014 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::DnDsSubstitutionRegister::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 1016 of file SubstitutionRegister.h.

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

◆ getTypeName()

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

◆ operator=()

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

◆ stateMap()

Member Data Documentation

◆ countMultiple_

bool bpp::DnDsSubstitutionRegister::countMultiple_
private

Definition at line 985 of file SubstitutionRegister.h.

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

◆ genCode_

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

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