bpp-phyl3  3.0.0
bpp::GCSynonymousSubstitutionRegister Class Reference

Distinguishes AT->GC vs GC->AT inside synonymous substitutions on third codon position. More...

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

+ Inheritance diagram for bpp::GCSynonymousSubstitutionRegister:
+ Collaboration diagram for bpp::GCSynonymousSubstitutionRegister:

Public Member Functions

 GCSynonymousSubstitutionRegister (std::shared_ptr< const StateMapInterface > stateMap, std::shared_ptr< const GeneticCode > genCode, bool within=false)
 
 GCSynonymousSubstitutionRegister (const GCSynonymousSubstitutionRegister &reg)
 
GCSynonymousSubstitutionRegisteroperator= (const GCSynonymousSubstitutionRegister &reg)
 
GCSynonymousSubstitutionRegisterclone () 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...
 
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
 
bool isStationary () const
 
void setStationarity (bool stat)
 
size_t getNumberOfCategories () const
 
size_t getNumberOfSubstitutionTypes () const
 
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 Member Functions

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

Protected Attributes

bool within_
 
size_t nbCategories_
 
std::map< size_t, size_t > categories_
 
std::vector< std::string > categoryNames_
 
std::vector< std::vector< size_t > > index_
 
std::vector< std::vector< size_t > > revIndex_
 
bool stationarity_
 
std::shared_ptr< const StateMapInterfacestateMap_
 
std::string name_
 

Private Attributes

std::shared_ptr< const GeneticCodegenCode_
 

Detailed Description

Distinguishes AT->GC vs GC->AT inside synonymous substitutions on third codon position.

This register has two substitution types, mapped as:

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

Multiple substitutions are forbidden.

Definition at line 275 of file CategorySubstitutionRegister.h.

Constructor & Destructor Documentation

◆ GCSynonymousSubstitutionRegister() [1/2]

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

Definition at line 282 of file CategorySubstitutionRegister.h.

References genCode_.

Referenced by clone().

◆ GCSynonymousSubstitutionRegister() [2/2]

bpp::GCSynonymousSubstitutionRegister::GCSynonymousSubstitutionRegister ( const GCSynonymousSubstitutionRegister reg)
inline

Definition at line 307 of file CategorySubstitutionRegister.h.

Member Function Documentation

◆ allowWithin()

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

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

GCSynonymousSubstitutionRegister* bpp::GCSynonymousSubstitutionRegister::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_.

◆ 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

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

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

Definition at line 191 of file CategorySubstitutionRegister.h.

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

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

Reimplemented from bpp::CategorySubstitutionRegister.

Definition at line 322 of file CategorySubstitutionRegister.h.

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

◆ getTypeName()

std::string bpp::GCSynonymousSubstitutionRegister::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.

Reimplemented from bpp::CategorySubstitutionRegister.

Definition at line 347 of file CategorySubstitutionRegister.h.

◆ isStationary()

bool bpp::CategorySubstitutionRegister::isStationary ( ) const
inlineinherited

◆ operator=()

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

◆ setAlphabetCategories()

template<class T >
void bpp::CategorySubstitutionRegister::setAlphabetCategories ( const std::map< int, T > &  categories)
inlineprotectedinherited

◆ setModelCategories()

◆ setStationarity()

void bpp::CategorySubstitutionRegister::setStationarity ( bool  stat)
inlineinherited

◆ stateMap()

Member Data Documentation

◆ categories_

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

◆ categoryNames_

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

◆ genCode_

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

◆ index_

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

◆ name_

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

◆ nbCategories_

◆ revIndex_

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

◆ stateMap_

◆ stationarity_

bool bpp::CategorySubstitutionRegister::stationarity_
protectedinherited

◆ within_


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