Utilitary methods that work with TreeLikelihood objects.
More...
#include <Bpp/Phyl/Likelihood/TreeLikelihoodTools.h>
|
static void | getAncestralFrequencies (const TreeLikelihood &tl, size_t site, std::map< int, std::vector< double > > &frequencies, bool alsoForLeaves=false) throw (Exception) |
| 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 TreeLikelihood &tl, std::map< int, std::vector< double > > &frequencies, bool alsoForLeaves=false) throw (Exception) |
| 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 TreeLikelihood &tl, size_t siteIndex, int parentId, const std::vector< double > &ancestralFrequencies, std::map< int, std::vector< double > > &frequencies, bool alsoForLeaves) throw (Exception) |
| Recursive method, for internal use only. More...
|
|
Utilitary methods that work with TreeLikelihood objects.
Definition at line 55 of file TreeLikelihoodTools.h.
◆ TreeLikelihoodTools()
bpp::TreeLikelihoodTools::TreeLikelihoodTools |
( |
| ) |
|
|
inline |
◆ ~TreeLikelihoodTools()
virtual bpp::TreeLikelihoodTools::~TreeLikelihoodTools |
( |
| ) |
|
|
inlinevirtual |
◆ getAncestralFrequencies() [1/2]
void TreeLikelihoodTools::getAncestralFrequencies |
( |
const TreeLikelihood & |
tl, |
|
|
size_t |
site, |
|
|
std::map< int, std::vector< double > > & |
frequencies, |
|
|
bool |
alsoForLeaves = false |
|
) |
| |
throw | ( | Exception |
| ) | | |
|
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.
- Parameters
-
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. |
- Exceptions
-
Exception | In case something bad happens, like an unvalid model set. |
Definition at line 45 of file TreeLikelihoodTools.cpp.
◆ getAncestralFrequencies() [2/2]
void TreeLikelihoodTools::getAncestralFrequencies |
( |
const TreeLikelihood & |
tl, |
|
|
std::map< int, std::vector< double > > & |
frequencies, |
|
|
bool |
alsoForLeaves = false |
|
) |
| |
throw | ( | Exception |
| ) | | |
|
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.
- Parameters
-
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. |
- Exceptions
-
Exception | In case something bad happens, like an unvalid model set. |
Definition at line 56 of file TreeLikelihoodTools.cpp.
◆ getAncestralFrequencies_()
void TreeLikelihoodTools::getAncestralFrequencies_ |
( |
const TreeLikelihood & |
tl, |
|
|
size_t |
siteIndex, |
|
|
int |
parentId, |
|
|
const std::vector< double > & |
ancestralFrequencies, |
|
|
std::map< int, std::vector< double > > & |
frequencies, |
|
|
bool |
alsoForLeaves |
|
) |
| |
throw | ( | Exception |
| ) | | |
|
staticprivate |
The documentation for this class was generated from the following files: