bpp-phyl3
3.0.0
|
Utilitary methods that work with TreeLikelihood objects. More...
#include <Bpp/Phyl/Legacy/Likelihood/TreeLikelihoodTools.h>
Public Member Functions | |
TreeLikelihoodTools () | |
virtual | ~TreeLikelihoodTools () |
Static Public Member Functions | |
static void | getAncestralFrequencies (const TreeLikelihoodInterface &tl, size_t site, std::map< int, std::vector< double >> &frequencies, bool alsoForLeaves=false) |
Compute the expected ancestral frequencies of all states at all (inner) nodes according to a Markov process defined by a given substitution model. More... | |
static void | getAncestralFrequencies (const TreeLikelihoodInterface &tl, std::map< int, std::vector< double >> &frequencies, bool alsoForLeaves=false) |
Compute the expected ancestral frequencies of all states at all (inner) nodes according to a Markov process defined by a given substitution model. More... | |
Static Private Member Functions | |
static void | getAncestralFrequencies_ (const TreeLikelihoodInterface &tl, size_t siteIndex, int parentId, const std::vector< double > &ancestralFrequencies, std::map< int, std::vector< double >> &frequencies, bool alsoForLeaves) |
Recursive method, for internal use only. More... | |
Utilitary methods that work with TreeLikelihood objects.
Definition at line 20 of file TreeLikelihoodTools.h.
|
inline |
Definition at line 23 of file TreeLikelihoodTools.h.
|
inlinevirtual |
Definition at line 24 of file TreeLikelihoodTools.h.
|
static |
Compute the expected ancestral frequencies of all states at all (inner) nodes according to a Markov process defined by a given substitution model.
The computation is performed for a given site. If the likelihood object has no site partition, then the method will return the same result for all positions.
tl | [in] A tree likelihood object. |
site | [in] The site for which the frequencies should be computed. |
frequencies | [out] A map where to store the results, as a vector of double (the size of which being equal to the number of states in the model), and with nodes id as keys. |
alsoForLeaves | [opt] Tell if frequencies should also be estimated for terminal nodes. |
Exception | In case something bad happens, like an invalid model set. |
Definition at line 10 of file TreeLikelihoodTools.cpp.
References bpp::TreeLikelihoodInterface::getRootFrequencies(), bpp::Tree::getRootId(), bpp::TreeLikelihoodInterface::getSiteIndex(), and bpp::TreeLikelihoodInterface::tree().
|
static |
Compute the expected ancestral frequencies of all states at all (inner) nodes according to a Markov process defined by a given substitution model.
The computation is averaged over all sites. If the likelihood object has no site partition, then the method will return the same result as all single site numbers.
tl | [in] A tree likelihood object. |
frequencies | [out] A map where to store the results, as a vector of double (the size of which being equal to the number of states in the model), and with nodes id as keys. |
alsoForLeaves | [opt] Tell if frequencies should also be estimated for terminal nodes. |
Exception | In case something bad happens, like an invalid model set. |
Definition at line 21 of file TreeLikelihoodTools.cpp.
References bpp::TreeLikelihoodData::getNumberOfDistinctSites(), bpp::TreeLikelihoodInterface::getNumberOfStates(), bpp::TreeLikelihoodData::getWeight(), and bpp::TreeLikelihoodInterface::likelihoodData().
|
staticprivate |
Recursive method, for internal use only.
Definition at line 63 of file TreeLikelihoodTools.cpp.
References bpp::TreeLikelihoodInterface::getNumberOfStates(), bpp::Tree::getSonsId(), bpp::TreeLikelihoodInterface::getTransitionProbabilities(), bpp::Tree::isLeaf(), and bpp::TreeLikelihoodInterface::tree().