|
bpp-phyl
2.1.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 (const SubstitutionModel *model, int cutOff) | |
| LaplaceSubstitutionCount (const LaplaceSubstitutionCount &asc) | |
| LaplaceSubstitutionCount & | operator= (const LaplaceSubstitutionCount &asc) |
| virtual | ~LaplaceSubstitutionCount () |
| LaplaceSubstitutionCount * | clone () const |
| double | getNumberOfSubstitutions (int initialState, int 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. | |
| 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. | |
| std::vector< double > | getNumberOfSubstitutionsForEachType (int initialState, int 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. | |
| void | setSubstitutionModel (const SubstitutionModel *model) |
| Set the substitution model associated with this count, if relevent. | |
| void | setSubstitutionRegister (SubstitutionRegister *reg) throw (Exception) |
| bool | hasSubstitutionRegister () const |
| const SubstitutionRegister * | getSubstitutionRegister () const |
| SubstitutionRegister * | getSubstitutionRegister () |
| virtual size_t | getNumberOfSubstitutionTypes () const |
| Short cut function, equivalent to getSubstitutionRegister().getNumberOfSubstitutionTypes(). | |
| virtual const Alphabet * | getAlphabet () const |
| Short cut function, equivalent to getSubstitutionRegister()->getAlphabet(). | |
| virtual size_t | getNumberOfStates () const |
| Short cut function, equivalent to getSubstitutionRegister()->getAlphabet()->getSize(). | |
Protected Member Functions | |
| void | computeCounts (double length) const |
| void | substitutionRegisterHasChanged () |
Protected Attributes | |
| SubstitutionRegister * | register_ |
Private Attributes | |
| const SubstitutionModel * | model_ |
| int | 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 61 of file LaplaceSubstitutionCount.h.
| bpp::LaplaceSubstitutionCount::LaplaceSubstitutionCount | ( | const SubstitutionModel * | model, |
| int | cutOff | ||
| ) | [inline] |
Definition at line 71 of file LaplaceSubstitutionCount.h.
Referenced by clone().
| bpp::LaplaceSubstitutionCount::LaplaceSubstitutionCount | ( | const LaplaceSubstitutionCount & | asc | ) | [inline] |
Definition at line 79 of file LaplaceSubstitutionCount.h.
| virtual bpp::LaplaceSubstitutionCount::~LaplaceSubstitutionCount | ( | ) | [inline, virtual] |
Definition at line 97 of file LaplaceSubstitutionCount.h.
| LaplaceSubstitutionCount* bpp::LaplaceSubstitutionCount::clone | ( | ) | const [inline, virtual] |
Implements bpp::SubstitutionCount.
Definition at line 99 of file LaplaceSubstitutionCount.h.
References LaplaceSubstitutionCount().
| void LaplaceSubstitutionCount::computeCounts | ( | double | length | ) | const [protected] |
Definition at line 48 of file LaplaceSubstitutionCount.cpp.
References bpp::MatrixTools::add(), cutOff_, bpp::NumTools::fact(), bpp::MatrixTools::fill(), bpp::SubstitutionModel::getGenerator(), bpp::RowMatrix< Scalar >::getNumberOfRows(), bpp::SubstitutionModel::getPij_t(), m_, model_, bpp::MatrixTools::mult(), bpp::MatrixTools::pow(), and bpp::MatrixTools::scale().
Referenced by getAllNumbersOfSubstitutions(), getNumberOfSubstitutions(), and setSubstitutionModel().
| Matrix< double > * LaplaceSubstitutionCount::getAllNumbersOfSubstitutions | ( | double | length, |
| size_t | type = 1 |
||
| ) | const [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 110 of file LaplaceSubstitutionCount.cpp.
References computeCounts(), currentLength_, bpp::SubstitutionModel::getAlphabet(), bpp::Alphabet::getSize(), m_, and model_.
| virtual const Alphabet* bpp::SubstitutionCount::getAlphabet | ( | ) | const [inline, virtual, inherited] |
Short cut function, equivalent to getSubstitutionRegister()->getAlphabet().
Definition at line 112 of file SubstitutionCount.h.
References bpp::SubstitutionRegister::getAlphabet(), and bpp::SubstitutionCount::getSubstitutionRegister().
| virtual size_t bpp::SubstitutionCount::getNumberOfStates | ( | ) | const [inline, virtual, inherited] |
Short cut function, equivalent to getSubstitutionRegister()->getAlphabet()->getSize().
Definition at line 119 of file SubstitutionCount.h.
References bpp::SubstitutionRegister::getAlphabet(), bpp::Alphabet::getSize(), and bpp::SubstitutionCount::getSubstitutionRegister().
| double LaplaceSubstitutionCount::getNumberOfSubstitutions | ( | int | initialState, |
| int | finalState, | ||
| double | length, | ||
| size_t | type = 1 |
||
| ) | const [virtual] |
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 95 of file LaplaceSubstitutionCount.cpp.
References computeCounts(), currentLength_, and m_.
Referenced by getNumberOfSubstitutionsForEachType().
| std::vector<double> bpp::LaplaceSubstitutionCount::getNumberOfSubstitutionsForEachType | ( | int | initialState, |
| int | finalState, | ||
| double | length | ||
| ) | const [inline, virtual] |
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 104 of file LaplaceSubstitutionCount.h.
References getNumberOfSubstitutions().
| virtual size_t bpp::SubstitutionCount::getNumberOfSubstitutionTypes | ( | ) | const [inline, virtual, inherited] |
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 bpp::NaiveSubstitutionCount::getNumberOfSubstitutionsForEachType(), bpp::UniformizationSubstitutionCount::getNumberOfSubstitutionsForEachType(), bpp::DecompositionSubstitutionCount::getNumberOfSubstitutionsForEachType(), and bpp::ProbabilisticSubstitutionMapping::getNumberOfSubstitutionTypes().
| const SubstitutionRegister* bpp::AbstractSubstitutionCount::getSubstitutionRegister | ( | ) | const [inline, virtual, inherited] |
Implements bpp::SubstitutionCount.
Definition at line 209 of file SubstitutionCount.h.
References bpp::AbstractSubstitutionCount::register_.
| SubstitutionRegister* bpp::AbstractSubstitutionCount::getSubstitutionRegister | ( | ) | [inline, virtual, inherited] |
Implements bpp::SubstitutionCount.
Definition at line 211 of file SubstitutionCount.h.
References bpp::AbstractSubstitutionCount::register_.
| bool bpp::AbstractSubstitutionCount::hasSubstitutionRegister | ( | ) | const [inline, virtual, inherited] |
Implements bpp::SubstitutionCount.
Definition at line 194 of file SubstitutionCount.h.
References bpp::AbstractSubstitutionCount::register_.
| LaplaceSubstitutionCount& bpp::LaplaceSubstitutionCount::operator= | ( | const LaplaceSubstitutionCount & | asc | ) | [inline] |
Definition at line 87 of file LaplaceSubstitutionCount.h.
References currentLength_, cutOff_, m_, and model_.
| void LaplaceSubstitutionCount::setSubstitutionModel | ( | const SubstitutionModel * | model | ) | [virtual] |
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 138 of file LaplaceSubstitutionCount.cpp.
References computeCounts(), currentLength_, bpp::SubstitutionModel::getAlphabet(), bpp::Alphabet::getSize(), m_, model_, and bpp::RowMatrix< Scalar >::resize().
| void bpp::LaplaceSubstitutionCount::setSubstitutionRegister | ( | SubstitutionRegister * | reg | ) | throw (Exception) [inline, virtual] |
| reg | The new SubstitutionRegister object to be associated to this instance. The register contains the description of the various substitutions types that are mapped. |
Reimplemented from bpp::AbstractSubstitutionCount.
Definition at line 117 of file LaplaceSubstitutionCount.h.
| void bpp::LaplaceSubstitutionCount::substitutionRegisterHasChanged | ( | ) | [inline, protected, virtual] |
Implements bpp::AbstractSubstitutionCount.
Definition at line 123 of file LaplaceSubstitutionCount.h.
double bpp::LaplaceSubstitutionCount::currentLength_ [mutable, private] |
Definition at line 67 of file LaplaceSubstitutionCount.h.
Referenced by getAllNumbersOfSubstitutions(), getNumberOfSubstitutions(), operator=(), and setSubstitutionModel().
int bpp::LaplaceSubstitutionCount::cutOff_ [private] |
Definition at line 66 of file LaplaceSubstitutionCount.h.
Referenced by computeCounts(), and operator=().
RowMatrix<double> bpp::LaplaceSubstitutionCount::m_ [mutable, private] |
Definition at line 68 of file LaplaceSubstitutionCount.h.
Referenced by computeCounts(), getAllNumbersOfSubstitutions(), getNumberOfSubstitutions(), operator=(), and setSubstitutionModel().
const SubstitutionModel* bpp::LaplaceSubstitutionCount::model_ [private] |
Definition at line 65 of file LaplaceSubstitutionCount.h.
Referenced by computeCounts(), getAllNumbersOfSubstitutions(), operator=(), and setSubstitutionModel().
SubstitutionRegister* bpp::AbstractSubstitutionCount::register_ [protected, inherited] |
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_(), bpp::NaiveSubstitutionCount::getAllNumbersOfSubstitutions(), bpp::NaiveSubstitutionCount::getNumberOfSubstitutions(), bpp::AbstractSubstitutionCount::getSubstitutionRegister(), bpp::AbstractSubstitutionCount::hasSubstitutionRegister(), bpp::UniformizationSubstitutionCount::initBMatrices_(), bpp::DecompositionSubstitutionCount::initBMatrices_(), bpp::LabelSubstitutionCount::LabelSubstitutionCount(), 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(), bpp::DecompositionSubstitutionCount::weightsHaveChanged(), and bpp::AbstractSubstitutionCount::~AbstractSubstitutionCount().