bpp-phyl3  3.0.0
bpp::GCPositionSubstitutionRegister Class Reference

Distinguishes AT->GC vs GC->AT on given codon position (0, 1, or 2) More...

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

+ Inheritance diagram for bpp::GCPositionSubstitutionRegister:
+ Collaboration diagram for bpp::GCPositionSubstitutionRegister:

Public Member Functions

 GCPositionSubstitutionRegister (std::shared_ptr< const StateMapInterface > stateMap, std::shared_ptr< const GeneticCode > genCode, size_t pos, bool within=false)
 
 GCPositionSubstitutionRegister (const GCPositionSubstitutionRegister &reg)
 
GCPositionSubstitutionRegisteroperator= (const GCPositionSubstitutionRegister &reg)
 
GCPositionSubstitutionRegisterclone () 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_
 
size_t pos_
 

Detailed Description

Distinguishes AT->GC vs GC->AT on given codon position (0, 1, or 2)

This register has two substitution types, mapped as:

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

Multiple substitutions are forbidden.

Definition at line 378 of file CategorySubstitutionRegister.h.

Constructor & Destructor Documentation

◆ GCPositionSubstitutionRegister() [1/2]

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

Definition at line 386 of file CategorySubstitutionRegister.h.

References genCode_, and pos_.

Referenced by clone().

◆ GCPositionSubstitutionRegister() [2/2]

bpp::GCPositionSubstitutionRegister::GCPositionSubstitutionRegister ( const GCPositionSubstitutionRegister reg)
inline

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

GCPositionSubstitutionRegister* bpp::GCPositionSubstitutionRegister::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::GCPositionSubstitutionRegister::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 433 of file CategorySubstitutionRegister.h.

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

◆ getTypeName()

std::string bpp::GCPositionSubstitutionRegister::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 461 of file CategorySubstitutionRegister.h.

References pos_, and bpp::TextTools::toString().

◆ isStationary()

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

◆ operator=()

GCPositionSubstitutionRegister& bpp::GCPositionSubstitutionRegister::operator= ( const GCPositionSubstitutionRegister 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_

◆ categoryNames_

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

◆ genCode_

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

◆ index_

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

◆ name_

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

◆ nbCategories_

◆ pos_

size_t bpp::GCPositionSubstitutionRegister::pos_
private

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