bpp-phyl
2.2.0
|
Gather states into defined categories, and count the changes between categories. More...
#include <Bpp/Phyl/Mapping/SubstitutionRegister.h>
Public Member Functions | |
CategorySubstitutionRegister (const SubstitutionModel *model, bool within=false) | |
Build a new substitution register with categories. This class is meant to be inherited. 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 |
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 SubstitutionModel * | getSubstitutionModel () const |
const Alphabet * | getAlphabet () const |
virtual SubstitutionRegister * | clone () const =0 |
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 SubstitutionModel * | model_ |
Gather states into defined categories, and count the changes between categories.
Optionally allows for within categories substitutions.
Definition at line 155 of file SubstitutionRegister.h.
|
inline |
Build a new substitution register with categories. This class is meant to be inherited.
model | The model defining the states. |
within | Specifies if within categories substitutions should be counted as well. |
Definition at line 173 of file SubstitutionRegister.h.
|
inlinevirtual |
Definition at line 289 of file SubstitutionRegister.h.
References within_.
|
pure virtualinherited |
Implemented in bpp::GCSynonymousSubstitutionRegister, bpp::DnDsSubstitutionRegister, bpp::TsTvSubstitutionRegister, bpp::GCSubstitutionRegister, bpp::AAExteriorSubstitutionRegister, bpp::AAInteriorSubstitutionRegister, bpp::SelectedSubstitutionRegister, bpp::GeneralSubstitutionRegister, bpp::ComprehensiveSubstitutionRegister, bpp::CompleteSubstitutionRegister, and bpp::TotalSubstitutionRegister.
Referenced by bpp::SubstitutionMappingTools::getCountsPerBranch(), bpp::CompleteSubstitutionRegister::operator=(), bpp::SubstitutionMappingTools::outputIndividualCountsPerBranchPerSite(), and bpp::SubstitutionMappingTools::outputTotalCountsPerBranchPerSite().
|
inlinevirtualinherited |
Implements bpp::SubstitutionRegister.
Definition at line 147 of file SubstitutionRegister.h.
References bpp::SubstitutionModel::getAlphabet(), and bpp::AbstractSubstitutionRegister::model_.
|
inlinevirtual |
Definition at line 248 of file SubstitutionRegister.h.
References categories_, bpp::SubstitutionModel::getAlphabetStateAsInt(), and bpp::AbstractSubstitutionRegister::model_.
Referenced by bpp::SubstitutionMappingTools::getRelativeCountsPerBranch().
|
inlinevirtual |
Definition at line 254 of file SubstitutionRegister.h.
References nbCategories_, revIndex_, and within_.
Referenced by bpp::SubstitutionMappingTools::getRelativeCountsPerBranch(), and getTypeName().
|
inlinevirtual |
Definition at line 284 of file SubstitutionRegister.h.
References categoryNames_.
Referenced by getTypeName().
|
inlinevirtual |
Definition at line 269 of file SubstitutionRegister.h.
References nbCategories_, revIndex_, and within_.
Referenced by getTypeName().
|
inline |
Definition at line 291 of file SubstitutionRegister.h.
References nbCategories_.
Referenced by bpp::SubstitutionMappingTools::getRelativeCountsPerBranch().
|
inlinevirtual |
Implements bpp::SubstitutionRegister.
Reimplemented in bpp::GCSynonymousSubstitutionRegister.
Definition at line 293 of file SubstitutionRegister.h.
References nbCategories_, and within_.
|
inlinevirtualinherited |
Implements bpp::SubstitutionRegister.
Definition at line 145 of file SubstitutionRegister.h.
References bpp::AbstractSubstitutionRegister::model_.
|
inlinevirtual |
Get the substitution type far a given pair of model states.
fromState | Initial state (should be a state supported by the specified alphabet). |
toState | Final state (should be a state supported by the specified alphabet). |
Implements bpp::SubstitutionRegister.
Reimplemented in bpp::GCSynonymousSubstitutionRegister.
Definition at line 295 of file SubstitutionRegister.h.
References categories_, bpp::SubstitutionModel::getAlphabetStateAsInt(), index_, and bpp::AbstractSubstitutionRegister::model_.
|
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.
type | Index of the substitution (should be an size_t contained in the register). |
Implements bpp::SubstitutionRegister.
Reimplemented in bpp::GCSynonymousSubstitutionRegister.
Definition at line 305 of file SubstitutionRegister.h.
References getCategoryFrom(), getCategoryName(), and getCategoryTo().
|
inlineprotected |
Definition at line 185 of file SubstitutionRegister.h.
References categories_, categoryNames_, bpp::SubstitutionModel::getAlphabet(), bpp::SubstitutionModel::getAlphabetStates(), index_, bpp::AbstractSubstitutionRegister::model_, nbCategories_, revIndex_, and within_.
|
mutableprotected |
Definition at line 161 of file SubstitutionRegister.h.
Referenced by getCategory(), getType(), bpp::GCSynonymousSubstitutionRegister::getType(), and setCategories().
|
protected |
Definition at line 162 of file SubstitutionRegister.h.
Referenced by getCategoryName(), and setCategories().
|
protected |
Definition at line 163 of file SubstitutionRegister.h.
Referenced by getType(), bpp::GCSynonymousSubstitutionRegister::getType(), and setCategories().
|
protectedinherited |
Definition at line 125 of file SubstitutionRegister.h.
Referenced by bpp::AbstractSubstitutionRegister::getAlphabet(), getCategory(), bpp::AbstractSubstitutionRegister::getSubstitutionModel(), getType(), bpp::TsTvSubstitutionRegister::getType(), bpp::DnDsSubstitutionRegister::getType(), bpp::GCSynonymousSubstitutionRegister::getType(), bpp::AbstractSubstitutionRegister::operator=(), bpp::SelectedSubstitutionRegister::SelectedSubstitutionRegister(), and setCategories().
|
protected |
Definition at line 160 of file SubstitutionRegister.h.
Referenced by getCategoryFrom(), getCategoryTo(), getNumberOfCategories(), getNumberOfSubstitutionTypes(), and setCategories().
|
protected |
Definition at line 164 of file SubstitutionRegister.h.
Referenced by getCategoryFrom(), getCategoryTo(), and setCategories().
|
protected |
Definition at line 159 of file SubstitutionRegister.h.
Referenced by allowWithin(), getCategoryFrom(), getCategoryTo(), getNumberOfSubstitutionTypes(), and setCategories().