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

Protected Attributes

const SubstitutionModelmodel_
 

Private Attributes

const GeneticCode * code_
 
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 862 of file SubstitutionRegister.h.

Constructor & Destructor Documentation

◆ DnDsSubstitutionRegister() [1/2]

bpp::DnDsSubstitutionRegister::DnDsSubstitutionRegister ( const CodonSubstitutionModel model,
bool  countMultiple = false 
)
inline

Definition at line 870 of file SubstitutionRegister.h.

Referenced by clone().

◆ DnDsSubstitutionRegister() [2/2]

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

Definition at line 876 of file SubstitutionRegister.h.

Member Function Documentation

◆ clone()

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

Implements bpp::SubstitutionRegister.

Definition at line 890 of file SubstitutionRegister.h.

References DnDsSubstitutionRegister().

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

Implements bpp::SubstitutionRegister.

Definition at line 893 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::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::SubstitutionRegister.

Definition at line 895 of file SubstitutionRegister.h.

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

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

Definition at line 919 of file SubstitutionRegister.h.

◆ operator=()

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

Member Data Documentation

◆ code_

const GeneticCode* bpp::DnDsSubstitutionRegister::code_
private

Definition at line 866 of file SubstitutionRegister.h.

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

◆ countMultiple_

bool bpp::DnDsSubstitutionRegister::countMultiple_
private

Definition at line 867 of file SubstitutionRegister.h.

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

◆ model_


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