bpp-phyl  2.2.0
bpp::GCSubstitutionRegister Class Reference

Distinguishes AT<->GC from GC<->AT. More...

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

+ Inheritance diagram for bpp::GCSubstitutionRegister:
+ Collaboration diagram for bpp::GCSubstitutionRegister:

Public Member Functions

 GCSubstitutionRegister (const NucleotideSubstitutionModel *model, bool within=false)
 
GCSubstitutionRegisterclone () const
 
virtual size_t getCategory (size_t state) const
 
virtual size_t getCategoryFrom (size_t type) const
 
virtual size_t getCategoryTo (size_t type) const
 
virtual std::string getCategoryName (size_t category) const
 
virtual bool allowWithin () const
 
size_t getNumberOfCategories () const
 
size_t getNumberOfSubstitutionTypes () const
 
virtual 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 Member Functions

template<class T >
void setCategories (const std::map< int, T > &categories)
 

Protected Attributes

bool within_
 
size_t nbCategories_
 
std::map< int, size_t > categories_
 
std::vector< std::string > categoryNames_
 
std::vector< std::vector< size_t > > index_
 
std::vector< std::vector< size_t > > revIndex_
 
const SubstitutionModelmodel_
 

Detailed Description

Distinguishes AT<->GC from GC<->AT.

This register has two substitution types, mapped as:

  • 0 not a substitution
  • 1 a AT->GC substitution
  • 2 a GC->AT substitution

Definition at line 780 of file SubstitutionRegister.h.

Constructor & Destructor Documentation

◆ GCSubstitutionRegister()

bpp::GCSubstitutionRegister::GCSubstitutionRegister ( const NucleotideSubstitutionModel model,
bool  within = false 
)
inline

Definition at line 784 of file SubstitutionRegister.h.

Referenced by clone().

Member Function Documentation

◆ allowWithin()

virtual bool bpp::CategorySubstitutionRegister::allowWithin ( ) const
inlinevirtualinherited

◆ clone()

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

Implements bpp::SubstitutionRegister.

Definition at line 795 of file SubstitutionRegister.h.

References GCSubstitutionRegister().

◆ 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_.

◆ getCategory()

virtual size_t bpp::CategorySubstitutionRegister::getCategory ( size_t  state) const
inlinevirtualinherited

◆ getCategoryFrom()

virtual size_t bpp::CategorySubstitutionRegister::getCategoryFrom ( size_t  type) const
inlinevirtualinherited

◆ getCategoryName()

virtual std::string bpp::CategorySubstitutionRegister::getCategoryName ( size_t  category) const
inlinevirtualinherited

◆ getCategoryTo()

virtual size_t bpp::CategorySubstitutionRegister::getCategoryTo ( size_t  type) const
inlinevirtualinherited

◆ getNumberOfCategories()

size_t bpp::CategorySubstitutionRegister::getNumberOfCategories ( ) const
inlineinherited

◆ getNumberOfSubstitutionTypes()

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

Implements bpp::SubstitutionRegister.

Reimplemented in bpp::GCSynonymousSubstitutionRegister.

Definition at line 293 of file SubstitutionRegister.h.

References bpp::CategorySubstitutionRegister::nbCategories_, and bpp::CategorySubstitutionRegister::within_.

◆ 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()

virtual size_t bpp::CategorySubstitutionRegister::getType ( size_t  fromState,
size_t  toState 
) const
inlinevirtualinherited

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.

Reimplemented in bpp::GCSynonymousSubstitutionRegister.

Definition at line 295 of file SubstitutionRegister.h.

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

◆ getTypeName()

std::string bpp::CategorySubstitutionRegister::getTypeName ( size_t  type) const
inlinevirtualinherited

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.

Reimplemented in bpp::GCSynonymousSubstitutionRegister.

Definition at line 305 of file SubstitutionRegister.h.

References bpp::CategorySubstitutionRegister::getCategoryFrom(), bpp::CategorySubstitutionRegister::getCategoryName(), and bpp::CategorySubstitutionRegister::getCategoryTo().

◆ setCategories()

Member Data Documentation

◆ categories_

std::map<int, size_t> bpp::CategorySubstitutionRegister::categories_
mutableprotectedinherited

◆ categoryNames_

std::vector<std::string> bpp::CategorySubstitutionRegister::categoryNames_
protectedinherited

◆ index_

std::vector< std::vector<size_t> > bpp::CategorySubstitutionRegister::index_
protectedinherited

◆ model_

◆ nbCategories_

◆ revIndex_

std::vector< std::vector<size_t> > bpp::CategorySubstitutionRegister::revIndex_
protectedinherited

◆ within_


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