bpp-phyl3
3.0.0
|
Naive substitution count. More...
#include <Bpp/Phyl/Mapping/NaiveSubstitutionCount.h>
Public Member Functions | |
NaiveSubstitutionCount (std::shared_ptr< const SubstitutionModelInterface > model, std::shared_ptr< const SubstitutionRegisterInterface > reg, bool allowSelf=false, std::shared_ptr< const AlphabetIndex2 > weights=nullptr) | |
Build a new simple substitution count. More... | |
NaiveSubstitutionCount (std::shared_ptr< const StateMapInterface > stateMap, std::shared_ptr< const SubstitutionRegisterInterface > reg, bool allowSelf=false, std::shared_ptr< const AlphabetIndex2 > weights=nullptr) | |
virtual | ~NaiveSubstitutionCount () |
NaiveSubstitutionCount * | clone () const override |
double | getNumberOfSubstitutions (size_t initialState, size_t finalState, double length, size_t type=1) const override |
Get the number of susbstitutions on a branch, given the initial and final states, and the branch length. More... | |
std::unique_ptr< Matrix< double > > | getAllNumbersOfSubstitutions (double length, size_t type=1) const override |
Get the numbers of susbstitutions on a branch, for each initial and final states, and given the branch length. More... | |
void | storeAllNumbersOfSubstitutions (double length, size_t type, Eigen::MatrixXd &mat) const override |
Stores the numbers of susbstitutions on a branch, for each initial and final states, and given the branch length. More... | |
std::vector< double > | getNumberOfSubstitutionsPerType (size_t initialState, size_t finalState, double length) const override |
Get the numbers of susbstitutions on a branch for all types, for an initial and final states, given the branch length. More... | |
void | setSubstitutionModel (std::shared_ptr< const SubstitutionModelInterface > model) override |
Set the substitution model associated with this count, if relevant. More... | |
bool | hasSubstitutionRegister () const |
void | setSubstitutionRegister (std::shared_ptr< const SubstitutionRegisterInterface > reg) |
attribution of a SubstitutionRegister More... | |
std::shared_ptr< const SubstitutionRegisterInterface > | getSubstitutionRegister () const |
virtual size_t | getNumberOfSubstitutionTypes () const |
Short cut function, equivalent to getSubstitutionRegister().getNumberOfSubstitutionTypes(). More... | |
virtual std::shared_ptr< const Alphabet > | getAlphabet () const |
Short cut function, equivalent to getSubstitutionRegister()->getAlphabet(). More... | |
virtual size_t | getNumberOfStates () const |
Short cut function, equivalent to getSubstitutionRegister()->getAlphabet()->getSize(). More... | |
void | setWeights (std::shared_ptr< const AlphabetIndex2 > weights) |
bool | hasWeights () const |
std::shared_ptr< const AlphabetIndex2 > | getWeights () const |
Protected Attributes | |
std::shared_ptr< const SubstitutionRegisterInterface > | register_ |
std::shared_ptr< const AlphabetIndex2 > | weights_ |
Private Member Functions | |
void | substitutionRegisterHasChanged () override |
void | weightsHaveChanged () override |
Private Attributes | |
bool | allowSelf_ |
std::vector< int > | supportedChars_ |
Naive substitution count.
This substitution count is defined as follow:
Reference (for instance): Tufféry P, Darlu P. Exploring a phylogenetic approach for the detection of correlated substitutions in proteins. Mol Biol Evol. 2000 Nov;17(11):1753-9
Definition at line 28 of file NaiveSubstitutionCount.h.
|
inline |
Build a new simple substitution count.
model | The substitution model for which this substitution count is parametrized. The model is not used in the calculation, only for specifying the modeled states. |
reg | A pointer toward a substitution register object which describes the type of substitutions to map. |
allowSelf | Tells if "self" mutations, from X to X should be counted together with the ones of type X to Y where X and Y are in the same category, if relevant. The default is "no", to be consistent with other types of substitution counts which account for multiple substitutions, in which case it does not make sense to count "X to X". |
weights | the weights of the counts |
Definition at line 47 of file NaiveSubstitutionCount.h.
Referenced by clone().
|
inline |
Definition at line 57 of file NaiveSubstitutionCount.h.
|
inlinevirtual |
Definition at line 67 of file NaiveSubstitutionCount.h.
|
inlineoverridevirtual |
Implements bpp::SubstitutionCountInterface.
Definition at line 69 of file NaiveSubstitutionCount.h.
References NaiveSubstitutionCount().
|
overridevirtual |
Get the numbers of susbstitutions on a branch, for each initial and final states, and given the branch length.
length | The length of the branch. |
type | The type of susbstitution to count. |
Implements bpp::SubstitutionCountInterface.
Definition at line 10 of file NaiveSubstitutionCount.cpp.
|
inlinevirtualinherited |
Short cut function, equivalent to getSubstitutionRegister()->getAlphabet().
Definition at line 78 of file SubstitutionCount.h.
References bpp::SubstitutionCountInterface::getSubstitutionRegister().
|
inlinevirtualinherited |
Short cut function, equivalent to getSubstitutionRegister()->getAlphabet()->getSize().
Definition at line 85 of file SubstitutionCount.h.
References bpp::SubstitutionCountInterface::getSubstitutionRegister().
|
inlineoverridevirtual |
Get the number of susbstitutions on a branch, given the initial and final states, and the branch length.
initialState | The initial state. |
finalState | The final state. |
length | The length of the branch. |
type | The type of substitution to count. |
Implements bpp::SubstitutionCountInterface.
Definition at line 75 of file NaiveSubstitutionCount.h.
References allowSelf_, bpp::AbstractSubstitutionCount::register_, supportedChars_, and bpp::AbstractWeightedSubstitutionCount::weights_.
Referenced by getNumberOfSubstitutionsPerType().
|
inlineoverridevirtual |
Get the numbers of susbstitutions on a branch for all types, for an initial and final states, given the branch length.
initialState | The initial state. |
finalState | The final state. |
length | The length of the branch. |
Implements bpp::SubstitutionCountInterface.
Definition at line 91 of file NaiveSubstitutionCount.h.
References getNumberOfSubstitutions(), and bpp::SubstitutionCountInterface::getNumberOfSubstitutionTypes().
|
inlinevirtualinherited |
Short cut function, equivalent to getSubstitutionRegister().getNumberOfSubstitutionTypes().
Definition at line 71 of file SubstitutionCount.h.
References bpp::SubstitutionCountInterface::getSubstitutionRegister().
Referenced by bpp::SubstitutionMappingTools::computeCounts(), bpp::DecompositionSubstitutionCount::getNumberOfSubstitutionsPerType(), getNumberOfSubstitutionsPerType(), and bpp::UniformizationSubstitutionCount::getNumberOfSubstitutionsPerType().
|
inlinevirtualinherited |
Implements bpp::SubstitutionCountInterface.
Definition at line 170 of file SubstitutionCount.h.
References bpp::AbstractSubstitutionCount::register_.
|
inlinevirtualinherited |
Implements bpp::WeightedSubstitutionCount.
Definition at line 66 of file WeightedSubstitutionCount.h.
References bpp::AbstractWeightedSubstitutionCount::weights_.
|
inlinevirtualinherited |
Implements bpp::SubstitutionCountInterface.
Definition at line 156 of file SubstitutionCount.h.
References bpp::AbstractSubstitutionCount::register_.
|
inlinevirtualinherited |
Implements bpp::WeightedSubstitutionCount.
Definition at line 65 of file WeightedSubstitutionCount.h.
References bpp::AbstractWeightedSubstitutionCount::weights_.
|
inlineoverridevirtual |
Set the substitution model associated with this count, if relevant.
model | The substitution model to use with this count. |
Implements bpp::SubstitutionCountInterface.
Definition at line 101 of file NaiveSubstitutionCount.h.
References supportedChars_.
|
inlinevirtualinherited |
attribution of a SubstitutionRegister
reg | pointer to a SubstitutionRegister |
Implements bpp::SubstitutionCountInterface.
Definition at line 164 of file SubstitutionCount.h.
References bpp::AbstractSubstitutionCount::register_, and bpp::AbstractSubstitutionCount::substitutionRegisterHasChanged().
|
virtualinherited |
Implements bpp::WeightedSubstitutionCount.
Definition at line 9 of file WeightedSubstitutionCount.cpp.
References bpp::AbstractWeightedSubstitutionCount::weights_, and bpp::AbstractWeightedSubstitutionCount::weightsHaveChanged().
|
overridevirtual |
Stores the numbers of susbstitutions on a branch, for each initial and final states, and given the branch length.
length | The length of the branch. |
type | The type of susbstitution to count. |
mat | The matrix filled with all numbers of substitutions for each initial and final states. |
Implements bpp::SubstitutionCountInterface.
Definition at line 24 of file NaiveSubstitutionCount.cpp.
|
inlineoverrideprivatevirtual |
Implements bpp::AbstractSubstitutionCount.
Definition at line 108 of file NaiveSubstitutionCount.h.
|
inlineoverrideprivatevirtual |
Implements bpp::AbstractWeightedSubstitutionCount.
Definition at line 109 of file NaiveSubstitutionCount.h.
|
private |
Definition at line 33 of file NaiveSubstitutionCount.h.
Referenced by getNumberOfSubstitutions().
|
protectedinherited |
Definition at line 146 of file SubstitutionCount.h.
Referenced by bpp::UniformizationSubstitutionCount::computeCounts_(), bpp::DecompositionSubstitutionCount::distancesHaveChanged(), bpp::UniformizationSubstitutionCount::distancesHaveChanged(), bpp::DecompositionSubstitutionCount::fillBMatrices_(), bpp::UniformizationSubstitutionCount::fillBMatrices_(), getNumberOfSubstitutions(), bpp::AbstractSubstitutionCount::getSubstitutionRegister(), bpp::AbstractSubstitutionCount::hasSubstitutionRegister(), bpp::UniformizationSubstitutionCount::initBMatrices_(), bpp::DecompositionSubstitutionCount::initCounts_(), bpp::UniformizationSubstitutionCount::resetBMatrices_(), bpp::DecompositionSubstitutionCount::setDistanceBMatrices_(), bpp::UniformizationSubstitutionCount::setDistanceBMatrices_(), bpp::DecompositionSubstitutionCount::setSubstitutionModel(), bpp::UniformizationSubstitutionCount::setSubstitutionModel(), bpp::AbstractSubstitutionCount::setSubstitutionRegister(), bpp::DecompositionSubstitutionCount::substitutionRegisterHasChanged(), bpp::UniformizationSubstitutionCount::substitutionRegisterHasChanged(), bpp::DecompositionSubstitutionCount::weightsHaveChanged(), and bpp::UniformizationSubstitutionCount::weightsHaveChanged().
|
private |
Definition at line 34 of file NaiveSubstitutionCount.h.
Referenced by getNumberOfSubstitutions(), and setSubstitutionModel().
|
protectedinherited |
Definition at line 42 of file WeightedSubstitutionCount.h.
Referenced by bpp::DecompositionSubstitutionCount::computeCounts_(), bpp::UniformizationSubstitutionCount::computeCounts_(), getNumberOfSubstitutions(), bpp::AbstractWeightedSubstitutionCount::getWeights(), bpp::AbstractWeightedSubstitutionCount::hasWeights(), bpp::AbstractWeightedSubstitutionCount::operator=(), bpp::AbstractWeightedSubstitutionCount::setWeights(), bpp::DecompositionSubstitutionCount::weightsHaveChanged(), and bpp::UniformizationSubstitutionCount::weightsHaveChanged().