bpp-phyl3  3.0.0
bpp::KrKcSubstitutionRegister Class Reference

Count conservative and radical amino-acid substitutions. More...

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

+ Inheritance diagram for bpp::KrKcSubstitutionRegister:
+ Collaboration diagram for bpp::KrKcSubstitutionRegister:

Public Member Functions

 KrKcSubstitutionRegister (std::shared_ptr< const StateMapInterface > stateMap)
 
 KrKcSubstitutionRegister (std::shared_ptr< const StateMapInterface > stateMap, std::shared_ptr< const GeneticCode > genCode)
 
 KrKcSubstitutionRegister (const KrKcSubstitutionRegister &kreg)
 
KrKcSubstitutionRegisteroperator= (const KrKcSubstitutionRegister &kreg)
 
void init ()
 
KrKcSubstitutionRegisterclone () 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::vector< std::vector< bool > > types_
 
std::shared_ptr< const GeneticCodegenCode_
 

Detailed Description

Count conservative and radical amino-acid substitutions.

Categories are defined as in Sainudiin et al (2005).

  • 1 a conservative (C) substitution
  • 2 a radical (R) substitution
Author
Jonathan Romiguier, Emeric Figuet, Julien Dutheil

Definition at line 1074 of file SubstitutionRegister.h.

Constructor & Destructor Documentation

◆ KrKcSubstitutionRegister() [1/3]

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

Definition at line 1084 of file SubstitutionRegister.h.

References init().

Referenced by clone().

◆ KrKcSubstitutionRegister() [2/3]

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

Definition at line 1092 of file SubstitutionRegister.h.

References init().

◆ KrKcSubstitutionRegister() [3/3]

bpp::KrKcSubstitutionRegister::KrKcSubstitutionRegister ( const KrKcSubstitutionRegister kreg)
inline

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

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

Implements bpp::SubstitutionRegisterInterface.

Definition at line 1222 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::KrKcSubstitutionRegister::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 1224 of file SubstitutionRegister.h.

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

◆ getTypeName()

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

◆ init()

void bpp::KrKcSubstitutionRegister::init ( )
inline

Definition at line 1117 of file SubstitutionRegister.h.

References types_.

Referenced by KrKcSubstitutionRegister().

◆ operator=()

KrKcSubstitutionRegister& bpp::KrKcSubstitutionRegister::operator= ( const KrKcSubstitutionRegister kreg)
inline

◆ stateMap()

Member Data Documentation

◆ genCode_

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

Definition at line 1081 of file SubstitutionRegister.h.

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

◆ name_

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

◆ stateMap_

◆ types_

std::vector< std::vector<bool> > bpp::KrKcSubstitutionRegister::types_
private

Definition at line 1078 of file SubstitutionRegister.h.

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


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