bpp-phyl
2.2.0
|
Provide methods to compute reward mappings. More...
#include <Bpp/Phyl/Mapping/RewardMappingTools.h>
Public Member Functions | |
RewardMappingTools () | |
virtual | ~RewardMappingTools () |
Static Public Member Functions | |
static ProbabilisticRewardMapping * | computeRewardVectors (const DRTreeLikelihood &drtl, const std::vector< int > &nodeIds, Reward &reward, bool verbose=true) throw (Exception) |
Compute the reward vectors for a particular dataset using the double-recursive likelihood computation. More... | |
static void | writeToStream (const ProbabilisticRewardMapping &rewards, const SiteContainer &sites, std::ostream &out) throw (IOException) |
Write the reward vectors to a stream. More... | |
static void | readFromStream (std::istream &in, ProbabilisticRewardMapping &rewards) throw (IOException) |
Read the reward vectors from a stream. More... | |
static double | computeSumForBranch (const RewardMapping &smap, size_t branchIndex) |
Sum all rewards of a given branch (specified by its index). More... | |
static double | computeSumForSite (const RewardMapping &smap, size_t siteIndex) |
Sum all substitutions for each type of a given site (specified by its index). More... | |
Provide methods to compute reward mappings.
For now, 4 methods are implemented, and provide reward mappings.
See: Minin, V.N. and Suchard, M.A., Fast, accurate and simulation-free stochastic mapping Philosophical Transactions of the Royal Society B 2008 363:3985-95.
Definition at line 62 of file RewardMappingTools.h.
|
inline |
Definition at line 65 of file RewardMappingTools.h.
|
inlinevirtual |
Definition at line 66 of file RewardMappingTools.h.
|
static |
Compute the reward vectors for a particular dataset using the double-recursive likelihood computation.
drtl | A DRTreeLikelihood object. |
nodeIds | The Ids of the nodes the reward vectors are computed on. |
reward | The Reward to use. |
verbose | Print info to screen. |
Exception | If the likelihood object is not initialized. |
Definition at line 58 of file RewardMappingTools.cpp.
References bpp::Node::getDistanceToFather(), bpp::Node::getFather(), bpp::Node::getId(), bpp::TreeLikelihood::ConstBranchModelDescription::getModel(), bpp::TreeLikelihood::ConstBranchModelDescription::getNewSiteIterator(), bpp::TreeTemplate< N >::getNodes(), bpp::Node::getNumberOfSons(), bpp::Node::getSon(), bpp::Node::hasFather(), bpp::TreeLikelihood::ConstBranchModelIterator::hasNext(), and bpp::TreeLikelihood::ConstBranchModelIterator::next().
Referenced by bpp::SubstitutionMappingTools::getNormalizationsPerBranch().
|
static |
Sum all rewards of a given branch (specified by its index).
smap | The reward map to use. |
branchIndex | The index of the reward vector for which the counts should be computed. |
Definition at line 423 of file RewardMappingTools.cpp.
References bpp::Mapping::getNumberOfSites().
|
static |
Sum all substitutions for each type of a given site (specified by its index).
smap | The substitution map to use. |
siteIndex | The index of the substitution vector for which the counts should be computed. |
Definition at line 436 of file RewardMappingTools.cpp.
References bpp::Mapping::getNumberOfBranches().
|
static |
Read the reward vectors from a stream.
in | The input stream where to read the vectors. |
rewards | The mapping object to fill. |
IOException | If an input error happens. |
Definition at line 379 of file RewardMappingTools.cpp.
|
static |
Write the reward vectors to a stream.
rewards | The reward vectors to write. |
sites | The dataset associated to the vectors (needed to know the position of each site in the dataset). |
out | The output stream where to write the vectors. |
IOException | If an output error happens. |
Definition at line 350 of file RewardMappingTools.cpp.