bpp-phyl
2.2.0
|
Naive substitution count. More...
#include <Bpp/Phyl/Mapping/NaiveSubstitutionCount.h>
Public Member Functions | |
NaiveSubstitutionCount (const SubstitutionModel *model, SubstitutionRegister *reg, bool allowSelf=false, const AlphabetIndex2 *weights=0) | |
Build a new simple substitution count. More... | |
virtual | ~NaiveSubstitutionCount () |
NaiveSubstitutionCount * | clone () const |
double | getNumberOfSubstitutions (size_t initialState, size_t finalState, double length, size_t type=1) const |
Get the number of susbstitutions on a branch, given the initial and final states, and the branch length. More... | |
Matrix< double > * | getAllNumbersOfSubstitutions (double length, size_t type=1) const |
Get the numbers of susbstitutions on a branch, for each initial and final states, and given the branch length. More... | |
std::vector< double > | getNumberOfSubstitutionsForEachType (size_t initialState, size_t finalState, double length) const |
Get the numbers of susbstitutions on a branch for all types, for an initial and final states, given the branch length. More... | |
void | setSubstitutionModel (const SubstitutionModel *model) |
Set the substitution model associated with this count, if relevent. More... | |
bool | hasSubstitutionRegister () const |
void | setSubstitutionRegister (SubstitutionRegister *reg) |
attribution of a SubstitutionRegister More... | |
const SubstitutionRegister * | getSubstitutionRegister () const |
SubstitutionRegister * | getSubstitutionRegister () |
virtual size_t | getNumberOfSubstitutionTypes () const |
Short cut function, equivalent to getSubstitutionRegister().getNumberOfSubstitutionTypes(). More... | |
virtual 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 (const AlphabetIndex2 *weights, bool ownWeights) |
bool | hasWeights () const |
const AlphabetIndex2 * | getWeights () const |
Protected Attributes | |
std::auto_ptr< SubstitutionRegister > | register_ |
const AlphabetIndex2 * | weights_ |
bool | ownWeights_ |
Private Member Functions | |
void | substitutionRegisterHasChanged () |
void | weightsHaveChanged () |
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 64 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 discribes 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 relevent. 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 83 of file NaiveSubstitutionCount.h.
Referenced by clone().
|
inlinevirtual |
Definition at line 89 of file NaiveSubstitutionCount.h.
|
inlinevirtual |
Implements bpp::SubstitutionCount.
Definition at line 91 of file NaiveSubstitutionCount.h.
References NaiveSubstitutionCount().
|
virtual |
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::SubstitutionCount.
Definition at line 44 of file NaiveSubstitutionCount.cpp.
References bpp::AbstractSubstitutionCount::register_, supportedChars_, and bpp::AbstractWeightedSubstitutionCount::weights_.
|
inlinevirtualinherited |
Short cut function, equivalent to getSubstitutionRegister()->getAlphabet().
Definition at line 112 of file SubstitutionCount.h.
References bpp::SubstitutionRegister::getAlphabet(), and bpp::SubstitutionCount::getSubstitutionRegister().
|
inlinevirtualinherited |
Short cut function, equivalent to getSubstitutionRegister()->getAlphabet()->getSize().
Definition at line 119 of file SubstitutionCount.h.
References bpp::SubstitutionRegister::getAlphabet(), and bpp::SubstitutionCount::getSubstitutionRegister().
|
inlinevirtual |
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::SubstitutionCount.
Definition at line 94 of file NaiveSubstitutionCount.h.
References allowSelf_, bpp::AbstractSubstitutionCount::register_, supportedChars_, and bpp::AbstractWeightedSubstitutionCount::weights_.
Referenced by getNumberOfSubstitutionsForEachType().
|
inlinevirtual |
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::SubstitutionCount.
Definition at line 107 of file NaiveSubstitutionCount.h.
References getNumberOfSubstitutions(), and bpp::SubstitutionCount::getNumberOfSubstitutionTypes().
|
inlinevirtualinherited |
Short cut function, equivalent to getSubstitutionRegister().getNumberOfSubstitutionTypes().
Definition at line 105 of file SubstitutionCount.h.
References bpp::SubstitutionRegister::getNumberOfSubstitutionTypes(), and bpp::SubstitutionCount::getSubstitutionRegister().
Referenced by getNumberOfSubstitutionsForEachType(), bpp::UniformizationSubstitutionCount::getNumberOfSubstitutionsForEachType(), bpp::DecompositionSubstitutionCount::getNumberOfSubstitutionsForEachType(), and bpp::ProbabilisticSubstitutionMapping::getNumberOfSubstitutionTypes().
|
inlinevirtualinherited |
Implements bpp::SubstitutionCount.
Definition at line 206 of file SubstitutionCount.h.
References bpp::AbstractSubstitutionCount::register_.
|
inlinevirtualinherited |
Implements bpp::SubstitutionCount.
Definition at line 208 of file SubstitutionCount.h.
References bpp::AbstractSubstitutionCount::register_.
|
inlinevirtualinherited |
Implements bpp::WeightedSubstitutionCount.
Definition at line 106 of file WeightedSubstitutionCount.h.
References bpp::AbstractWeightedSubstitutionCount::weights_.
|
inlinevirtualinherited |
Implements bpp::SubstitutionCount.
Definition at line 192 of file SubstitutionCount.h.
References bpp::AbstractSubstitutionCount::register_.
|
inlinevirtualinherited |
Implements bpp::WeightedSubstitutionCount.
Definition at line 105 of file WeightedSubstitutionCount.h.
References bpp::AbstractWeightedSubstitutionCount::weights_.
|
inlinevirtual |
Set the substitution model associated with this count, if relevent.
model | The substitution model to use with this count. |
Implements bpp::SubstitutionCount.
Definition at line 116 of file NaiveSubstitutionCount.h.
References bpp::SubstitutionModel::getAlphabetStates(), and supportedChars_.
|
inlinevirtualinherited |
attribution of a SubstitutionRegister
reg | pointer to a SubstitutionRegister |
Implements bpp::SubstitutionCount.
Definition at line 201 of file SubstitutionCount.h.
References bpp::AbstractSubstitutionCount::register_, and bpp::AbstractSubstitutionCount::substitutionRegisterHasChanged().
|
virtualinherited |
Implements bpp::WeightedSubstitutionCount.
Definition at line 44 of file WeightedSubstitutionCount.cpp.
References bpp::AbstractWeightedSubstitutionCount::ownWeights_, bpp::AbstractWeightedSubstitutionCount::weights_, and bpp::AbstractWeightedSubstitutionCount::weightsHaveChanged().
|
inlineprivatevirtual |
Implements bpp::AbstractSubstitutionCount.
Definition at line 122 of file NaiveSubstitutionCount.h.
|
inlineprivatevirtual |
Implements bpp::AbstractWeightedSubstitutionCount.
Definition at line 123 of file NaiveSubstitutionCount.h.
|
private |
Definition at line 69 of file NaiveSubstitutionCount.h.
Referenced by getNumberOfSubstitutions().
|
protectedinherited |
Definition at line 72 of file WeightedSubstitutionCount.h.
Referenced by bpp::AbstractWeightedSubstitutionCount::AbstractWeightedSubstitutionCount(), bpp::AbstractWeightedSubstitutionCount::operator=(), bpp::AbstractWeightedSubstitutionCount::setWeights(), and bpp::AbstractWeightedSubstitutionCount::~AbstractWeightedSubstitutionCount().
|
protectedinherited |
Definition at line 170 of file SubstitutionCount.h.
Referenced by bpp::UniformizationSubstitutionCount::computeCounts_(), bpp::DecompositionSubstitutionCount::computeCounts_(), bpp::DecompositionSubstitutionCount::computeProducts_(), bpp::UniformizationSubstitutionCount::fillBMatrices_(), bpp::DecompositionSubstitutionCount::fillBMatrices_(), getAllNumbersOfSubstitutions(), getNumberOfSubstitutions(), bpp::AbstractSubstitutionCount::getSubstitutionRegister(), bpp::AbstractSubstitutionCount::hasSubstitutionRegister(), bpp::UniformizationSubstitutionCount::initBMatrices_(), bpp::DecompositionSubstitutionCount::initBMatrices_(), bpp::AbstractSubstitutionCount::operator=(), bpp::UniformizationSubstitutionCount::resetBMatrices_(), bpp::DecompositionSubstitutionCount::resetBMatrices_(), bpp::UniformizationSubstitutionCount::setSubstitutionModel(), bpp::DecompositionSubstitutionCount::setSubstitutionModel(), bpp::AbstractSubstitutionCount::setSubstitutionRegister(), bpp::UniformizationSubstitutionCount::substitutionRegisterHasChanged(), bpp::DecompositionSubstitutionCount::substitutionRegisterHasChanged(), bpp::UniformizationSubstitutionCount::weightsHaveChanged(), and bpp::DecompositionSubstitutionCount::weightsHaveChanged().
|
private |
Definition at line 70 of file NaiveSubstitutionCount.h.
Referenced by getAllNumbersOfSubstitutions(), getNumberOfSubstitutions(), and setSubstitutionModel().
|
protectedinherited |
Definition at line 71 of file WeightedSubstitutionCount.h.
Referenced by bpp::AbstractWeightedSubstitutionCount::AbstractWeightedSubstitutionCount(), bpp::UniformizationSubstitutionCount::computeCounts_(), bpp::DecompositionSubstitutionCount::computeCounts_(), getAllNumbersOfSubstitutions(), getNumberOfSubstitutions(), bpp::AbstractWeightedSubstitutionCount::getWeights(), bpp::AbstractWeightedSubstitutionCount::hasWeights(), bpp::AbstractWeightedSubstitutionCount::operator=(), bpp::AbstractWeightedSubstitutionCount::setWeights(), bpp::UniformizationSubstitutionCount::weightsHaveChanged(), bpp::DecompositionSubstitutionCount::weightsHaveChanged(), and bpp::AbstractWeightedSubstitutionCount::~AbstractWeightedSubstitutionCount().