|
bpp-phyl3 3.0.0
|
Laplace estimate of the substitution count. More...
#include <Bpp/Phyl/Mapping/LaplaceSubstitutionCount.h>
Inheritance diagram for bpp::LaplaceSubstitutionCount:
Collaboration diagram for bpp::LaplaceSubstitutionCount:Public Member Functions | |
| LaplaceSubstitutionCount (std::shared_ptr< const SubstitutionModelInterface > model, size_t cutOff) | |
| LaplaceSubstitutionCount (std::shared_ptr< const StateMapInterface > stateMap, size_t cutOff) | |
| LaplaceSubstitutionCount (const LaplaceSubstitutionCount &asc) | |
| LaplaceSubstitutionCount & | operator= (const LaplaceSubstitutionCount &asc) |
| virtual | ~LaplaceSubstitutionCount () |
| LaplaceSubstitutionCount * | 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... | |
| void | setSubstitutionRegister (std::shared_ptr< const SubstitutionRegisterInterface > reg) override |
| bool | hasSubstitutionRegister () const |
| 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... | |
Protected Member Functions | |
| void | computeCounts (double length) const |
| void | substitutionRegisterHasChanged () override |
Protected Attributes | |
| std::shared_ptr< const SubstitutionRegisterInterface > | register_ |
Private Attributes | |
| std::shared_ptr< const SubstitutionModelInterface > | model_ |
| size_t | cutOff_ |
| double | currentLength_ |
| RowMatrix< double > | m_ |
Laplace estimate of the substitution count.
This method uses Laplace transforms, as described in Dutheil J, Pupko T, Jean-Marie A, Galtier N. A model-based approach for detecting coevolving positions in a molecule. Mol Biol Evol. 2005 Sep;22(9):1919-28.
Definition at line 26 of file LaplaceSubstitutionCount.h.
|
inline |
Definition at line 36 of file LaplaceSubstitutionCount.h.
Referenced by clone().
|
inline |
Definition at line 46 of file LaplaceSubstitutionCount.h.
|
inline |
Definition at line 54 of file LaplaceSubstitutionCount.h.
|
inlinevirtual |
Definition at line 72 of file LaplaceSubstitutionCount.h.
|
inlineoverridevirtual |
Implements bpp::SubstitutionCountInterface.
Definition at line 74 of file LaplaceSubstitutionCount.h.
References LaplaceSubstitutionCount().
|
protected |
Definition at line 14 of file LaplaceSubstitutionCount.cpp.
References bpp::MatrixTools::add(), cutOff_, bpp::NumTools::fact(), bpp::MatrixTools::fill(), RowMatrix< double >::getNumberOfRows(), m_, model_, bpp::MatrixTools::mult(), bpp::pow(), bpp::MatrixTools::pow(), and bpp::MatrixTools::scale().
Referenced by getAllNumbersOfSubstitutions(), getNumberOfSubstitutions(), setSubstitutionModel(), and storeAllNumbersOfSubstitutions().
|
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 79 of file LaplaceSubstitutionCount.cpp.
References computeCounts(), currentLength_, m_, and model_.
|
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().
|
overridevirtual |
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 61 of file LaplaceSubstitutionCount.cpp.
References computeCounts(), currentLength_, m_, and model_.
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 83 of file LaplaceSubstitutionCount.h.
References getNumberOfSubstitutions().
|
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(), bpp::NaiveSubstitutionCount::getNumberOfSubstitutionsPerType(), and bpp::UniformizationSubstitutionCount::getNumberOfSubstitutionsPerType().
|
inlinevirtualinherited |
Implements bpp::SubstitutionCountInterface.
Definition at line 170 of file SubstitutionCount.h.
References bpp::AbstractSubstitutionCount::register_.
|
inlinevirtualinherited |
Implements bpp::SubstitutionCountInterface.
Definition at line 156 of file SubstitutionCount.h.
References bpp::AbstractSubstitutionCount::register_.
|
inline |
Definition at line 62 of file LaplaceSubstitutionCount.h.
References currentLength_, cutOff_, m_, and model_.
|
overridevirtual |
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 150 of file LaplaceSubstitutionCount.cpp.
References computeCounts(), currentLength_, m_, model_, and RowMatrix< double >::resize().
|
inlineoverridevirtual |
| reg | The new SubstitutionRegister object to be associated to this instance. The register contains the description of the various substitutions types that are mapped. |
Implements bpp::SubstitutionCountInterface.
Definition at line 96 of file LaplaceSubstitutionCount.h.
|
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 110 of file LaplaceSubstitutionCount.cpp.
References computeCounts(), currentLength_, m_, and model_.
|
inlineoverrideprotectedvirtual |
Implements bpp::AbstractSubstitutionCount.
Definition at line 103 of file LaplaceSubstitutionCount.h.
|
mutableprivate |
Definition at line 32 of file LaplaceSubstitutionCount.h.
Referenced by getAllNumbersOfSubstitutions(), getNumberOfSubstitutions(), operator=(), setSubstitutionModel(), and storeAllNumbersOfSubstitutions().
|
private |
Definition at line 31 of file LaplaceSubstitutionCount.h.
Referenced by computeCounts(), and operator=().
|
mutableprivate |
Definition at line 33 of file LaplaceSubstitutionCount.h.
Referenced by computeCounts(), getAllNumbersOfSubstitutions(), getNumberOfSubstitutions(), operator=(), setSubstitutionModel(), and storeAllNumbersOfSubstitutions().
|
private |
Definition at line 30 of file LaplaceSubstitutionCount.h.
Referenced by computeCounts(), getAllNumbersOfSubstitutions(), getNumberOfSubstitutions(), operator=(), setSubstitutionModel(), and storeAllNumbersOfSubstitutions().
|
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_(), bpp::NaiveSubstitutionCount::getAllNumbersOfSubstitutions(), bpp::NaiveSubstitutionCount::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::NaiveSubstitutionCount::storeAllNumbersOfSubstitutions(), bpp::DecompositionSubstitutionCount::substitutionRegisterHasChanged(), bpp::UniformizationSubstitutionCount::substitutionRegisterHasChanged(), bpp::DecompositionSubstitutionCount::weightsHaveChanged(), and bpp::UniformizationSubstitutionCount::weightsHaveChanged().