bpp-phyl3
3.0.0
|
#include <Bpp/Phyl/Likelihood/DataFlow/LikelihoodCalculationSingleProcess.h>
Classes | |
class | ProcessNodes |
DF Nodes used in the process. ProcessTree is used without any rate multiplier. More... | |
class | RateCategoryTrees |
Public Member Functions | |
LikelihoodCalculationSingleProcess (Context &context, std::shared_ptr< const AlignmentDataInterface > sites, std::shared_ptr< const SubstitutionProcessInterface > process) | |
LikelihoodCalculationSingleProcess (Context &context, std::shared_ptr< const SubstitutionProcessInterface > process) | |
LikelihoodCalculationSingleProcess (std::shared_ptr< CollectionNodes > collection, std::shared_ptr< const AlignmentDataInterface > sites, size_t nProcess) | |
LikelihoodCalculationSingleProcess (std::shared_ptr< CollectionNodes > collection, size_t nProcess) | |
LikelihoodCalculationSingleProcess (const LikelihoodCalculationSingleProcess &lik) | |
LikelihoodCalculationSingleProcess * | clone () const |
void | setData (std::shared_ptr< const AlignmentDataInterface > sites) |
void | setNumericalDerivateConfiguration (double delta, const NumericalDerivativeType &config) |
Set derivation procedure (see DataFlowNumeric.h) More... | |
void | setClockLike (double rate=1) |
void | makeLikelihoods () |
const DAGindexes & | getNodesIds (uint speciesId) const |
Get indexes of the nodes in the Likelihood DAG that have a given species index. More... | |
const DAGindexes & | getEdgesIds (uint speciesId, size_t nCat) const |
Get indexes of the non-empty edges in the Likelihood DAG that have a given species index for a given rate class index. More... | |
size_t | getNumberOfSites () const |
size_t | getNumberOfDistinctSites () const |
const SubstitutionProcessInterface & | substitutionProcess () const |
Return the ref to the SubstitutionProcess. More... | |
std::shared_ptr< const SubstitutionProcessInterface > | getSubstitutionProcess () const |
const AlignmentDataInterface & | data () const |
std::shared_ptr< const AlignmentDataInterface > | getData () const |
const StateMapInterface & | stateMap () const |
std::shared_ptr< const StateMapInterface > | getStateMap () const |
size_t | getRootArrayPosition (size_t currentPosition) const |
const PatternType & | getRootArrayPositions () const |
ValueRef< PatternType > | getRootPatternLinks () const |
const AlignmentDataInterface & | shrunkData () const |
std::shared_ptr< const AlignmentDataInterface > | getShrunkData () const |
ValueRef< RowLik > | expandVector (ValueRef< RowLik > vector) |
ValueRef< MatrixLik > | expandMatrix (ValueRef< MatrixLik > matrix) |
unsigned int | getWeight (size_t pos) const |
std::shared_ptr< SiteWeights > | getRootWeights () |
ValueRef< Eigen::RowVectorXd > | getRootFreqs () |
ConditionalLikelihoodRef | getLikelihoodsAtNode (uint nodeId, bool shrunk=false) |
size_t | getNumberOfClasses () const |
ConditionalLikelihoodRef | getForwardLikelihoodsAtNodeForClass (uint nodeId, size_t nCat) |
ConditionalLikelihoodRef | getBackwardLikelihoodsAtNodeForClass (uint nodeId, size_t nCat) |
ConditionalLikelihoodRef | getBackwardLikelihoodsAtEdgeForClass (uint edgeId, size_t nCat) |
ConditionalLikelihoodRef | getConditionalLikelihoodsAtNodeForClass (uint nodeId, size_t nCat) |
SiteLikelihoodsRef | getLikelihoodsAtNodeForClass (uint nodeId, size_t nCat) |
Get shrunked conditional likelihood matrix at Node (ie just above the node), for a given rate class. More... | |
void | makeLikelihoodsTree () |
make backward likelihood tree (only computed when needed) More... | |
RowLik | getSiteLikelihoodsForAClass (size_t nCat, bool shrunk=false) |
Get site likelihoods for a rate category. More... | |
AllRatesSiteLikelihoods | getSiteLikelihoodsForAllClasses (bool shrunk=false) |
Output array (Classes X Sites) of likelihoods for all sites & classes. More... | |
std::shared_ptr< ProcessTree > | getTreeNode (size_t nCat) |
Get process tree for a rate category. More... | |
std::shared_ptr< ForwardLikelihoodTree > | getForwardLikelihoodTree (size_t nCat) |
std::shared_ptr< BackwardLikelihoodTree > | getBackwardLikelihoodTree (size_t nCat) |
void | cleanAllLikelihoods () |
SiteLikelihoodsRef | getSiteLikelihoods (bool shrunk=false) |
void | setSiteLikelihoods (SiteLikelihoodsRef ll, bool shrunk=false) |
DataLik | getLikelihoodForASite (size_t pos, bool shrunk=false) |
DataLik | getLogLikelihoodForASite (size_t pos, bool shrunk=false) |
VDataLik | getLikelihoodPerSite () |
Get the likelihood for each site. More... | |
ValueRef< DataLik > | getLikelihoodNode () |
virtual bool | isInitialized () const |
const Context & | getContext () const |
void | setLikelihoodNode (ValueRef< DataLik > ll) |
void | setNamespace (const std::string &prefix) |
bool | hasIndependentParameter (const std::string &name) const |
const ParameterList & | getIndependentParameters () const |
size_t | getNumberOfIndependentParameters () const |
void | aliasParameters (const std::string &p1, const std::string &p2) |
void | aliasParameters (std::map< std::string, std::string > &unparsedParams, bool verbose) |
void | unaliasParameters (const std::string &p1, const std::string &p2) |
ParameterList | getAliasedParameters (const ParameterList &pl) const |
ParameterList | getFromParameters (const ParameterList &pl) const |
virtual std::vector< std::string > | getAlias (const std::string &name) const |
virtual std::map< std::string, std::string > | getAliases () const |
std::string | getFrom (const std::string &name) const |
bool | hasParameter (const std::string &name) const override |
const ParameterList & | getParameters () const override |
const Parameter & | parameter (const std::string &name) const override |
const std::shared_ptr< Parameter > & | getParameter (const std::string &name) const |
double | getParameterValue (const std::string &name) const override |
void | setAllParametersValues (const ParameterList ¶meters) override |
void | setParameterValue (const std::string &name, double value) override |
void | setParametersValues (const ParameterList ¶meters) override |
bool | matchParametersValues (const ParameterList ¶meters) override |
void | removeConstraint (const std::string &name) override |
void | setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override |
size_t | getNumberOfParameters () const override |
std::string | getNamespace () const override |
std::string | getParameterNameWithoutNamespace (const std::string &name) const override |
virtual void | fireParameterChanged (const ParameterList ¶meters) |
Protected Member Functions | |
Context & | getContext_ () |
ValueRef< DataLik > | getLikelihoodNode_ () |
const std::shared_ptr< Parameter > & | getParameter (size_t i) const |
std::shared_ptr< Parameter > & | getParameter (size_t i) |
void | addParameter_ (Parameter *parameter) |
void | addParameters_ (const ParameterList ¶meters) |
void | shareParameter_ (const std::shared_ptr< Parameter > ¶meter) |
void | shareParameters_ (const ParameterList ¶meters) |
void | includeParameters_ (const ParameterList ¶meters) |
void | deleteParameter_ (size_t index) |
void | deleteParameter_ (std::string &name) |
void | deleteParameters_ (const std::vector< std::string > &names) |
void | resetParameters_ () |
Parameter & | getParameter_ (const std::string &name) |
Parameter & | getParameter_ (size_t index) |
const Parameter & | getParameter_ (size_t index) const |
Parameter & | getParameterWithNamespace_ (const std::string &name) |
const Parameter & | getParameterWithNamespace_ (const std::string &name) const |
ParameterList & | getParameters_ () override |
Protected Attributes | |
SiteLikelihoodsRef | siteLikelihoods_ |
SiteLikelihoodsRef | patternedSiteLikelihoods_ |
ValueRef< DataLik > | likelihood_ |
Private Member Functions | |
void | setPatterns_ () |
void | makeForwardLikelihoodTree_ () |
void | makeProcessNodes_ () |
void | makeRootFreqs_ () |
void | makeLikelihoodsAtRoot_ () |
void | makeProcessNodes_ (CollectionNodes &pl, size_t nProc) |
make DF nodes of a process in a collection, using ConfiguredParameters defined in a CollectionNodes. More... | |
void | makeLikelihoodsAtNode_ (uint nodeId) |
Compute the likelihood at a given node in the tree, which number may not be the same number in the DAG. More... | |
void | makeLikelihoodsAtDAGNode_ (uint nodeId) |
Compute the likelihood at a given node in the DAG,. More... | |
std::shared_ptr< SiteLikelihoodsTree > | getSiteLikelihoodsTree_ (size_t nCat) |
Private Attributes | |
std::shared_ptr< const SubstitutionProcessInterface > | process_ |
std::shared_ptr< const AlignmentDataInterface > | psites_ |
ValueRef< PatternType > | rootPatternLinks_ |
std::shared_ptr< SiteWeights > | rootWeights_ |
The frequency of each site. More... | |
std::shared_ptr< AlignmentDataInterface > | shrunkData_ |
ProcessNodes | processNodes_ |
ValueRef< Eigen::RowVectorXd > | rFreqs_ |
std::vector< RateCategoryTrees > | vRateCatTrees_ |
ValueRef< Eigen::RowVectorXd > | catProb_ |
std::shared_ptr< ConditionalLikelihoodTree > | condLikelihoodTree_ |
Context & | context_ |
ParameterList | independentParameters_ |
std::map< std::string, std::shared_ptr< AliasParameterListener > > | aliasListenersRegister_ |
ParameterList | parameters_ |
std::string | prefix_ |
Friends | |
class | LikelihoodCalculationOnABranch |
Definition at line 112 of file LikelihoodCalculationSingleProcess.h.
LikelihoodCalculationSingleProcess::LikelihoodCalculationSingleProcess | ( | Context & | context, |
std::shared_ptr< const AlignmentDataInterface > | sites, | ||
std::shared_ptr< const SubstitutionProcessInterface > | process | ||
) |
Definition at line 21 of file LikelihoodCalculationSingleProcess.cpp.
References makeProcessNodes_(), process_, setNumericalDerivateConfiguration(), setPatterns_(), and bpp::ThreePoints.
LikelihoodCalculationSingleProcess::LikelihoodCalculationSingleProcess | ( | Context & | context, |
std::shared_ptr< const SubstitutionProcessInterface > | process | ||
) |
Definition at line 39 of file LikelihoodCalculationSingleProcess.cpp.
References makeProcessNodes_(), process_, setNumericalDerivateConfiguration(), and bpp::ThreePoints.
LikelihoodCalculationSingleProcess::LikelihoodCalculationSingleProcess | ( | std::shared_ptr< CollectionNodes > | collection, |
std::shared_ptr< const AlignmentDataInterface > | sites, | ||
size_t | nProcess | ||
) |
Definition at line 57 of file LikelihoodCalculationSingleProcess.cpp.
References makeProcessNodes_(), process_, setNumericalDerivateConfiguration(), setPatterns_(), and bpp::ThreePoints.
LikelihoodCalculationSingleProcess::LikelihoodCalculationSingleProcess | ( | std::shared_ptr< CollectionNodes > | collection, |
size_t | nProcess | ||
) |
Definition at line 79 of file LikelihoodCalculationSingleProcess.cpp.
References makeProcessNodes_(), setNumericalDerivateConfiguration(), and bpp::ThreePoints.
LikelihoodCalculationSingleProcess::LikelihoodCalculationSingleProcess | ( | const LikelihoodCalculationSingleProcess & | lik | ) |
Definition at line 96 of file LikelihoodCalculationSingleProcess.cpp.
References makeProcessNodes_(), setNumericalDerivateConfiguration(), setPatterns_(), and bpp::ThreePoints.
|
virtual |
Reimplemented from bpp::AlignedLikelihoodCalculation.
Definition at line 806 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::AlignedLikelihoodCalculation::cleanAllLikelihoods(), condLikelihoodTree_, psites_, rootPatternLinks_, rootWeights_, shrunkData_, and vRateCatTrees_.
Referenced by setData().
|
inlinevirtual |
Reimplemented from bpp::AlignedLikelihoodCalculation.
Definition at line 247 of file LikelihoodCalculationSingleProcess.h.
|
inline |
Definition at line 337 of file LikelihoodCalculationSingleProcess.h.
References psites_.
|
inline |
Definition at line 412 of file LikelihoodCalculationSingleProcess.h.
References bpp::CWisePattern< R >::create(), bpp::LikelihoodCalculation::getContext_(), getData(), getNumberOfSites(), and rootPatternLinks_.
Referenced by getLikelihoodsAtNode().
|
inline |
Definition at line 398 of file LikelihoodCalculationSingleProcess.h.
References bpp::CWisePattern< R >::create(), bpp::LikelihoodCalculation::getContext_(), getData(), getNumberOfSites(), and rootPatternLinks_.
Referenced by getSiteLikelihoodsForAClass(), and makeLikelihoodsAtRoot_().
ConditionalLikelihoodRef LikelihoodCalculationSingleProcess::getBackwardLikelihoodsAtEdgeForClass | ( | uint | edgeId, |
size_t | nCat | ||
) |
Definition at line 744 of file LikelihoodCalculationSingleProcess.cpp.
References condLikelihoodTree_, getTreeNode(), makeLikelihoodsAtNode_(), bpp::TextTools::toString(), and vRateCatTrees_.
Referenced by bpp::SubstitutionMappingTools::computeCounts(), bpp::SubstitutionMappingTools::computeNormalizations(), and bpp::RewardMappingTools::computeRewardVectors().
ConditionalLikelihoodRef LikelihoodCalculationSingleProcess::getBackwardLikelihoodsAtNodeForClass | ( | uint | nodeId, |
size_t | nCat | ||
) |
Definition at line 760 of file LikelihoodCalculationSingleProcess.cpp.
References makeLikelihoodsAtDAGNode_(), bpp::TextTools::toString(), and vRateCatTrees_.
std::shared_ptr< BackwardLikelihoodTree > LikelihoodCalculationSingleProcess::getBackwardLikelihoodTree | ( | size_t | nCat | ) |
Definition at line 798 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::TextTools::toString(), and vRateCatTrees_.
ConditionalLikelihoodRef LikelihoodCalculationSingleProcess::getConditionalLikelihoodsAtNodeForClass | ( | uint | nodeId, |
size_t | nCat | ||
) |
Definition at line 717 of file LikelihoodCalculationSingleProcess.cpp.
References makeLikelihoodsAtDAGNode_(), bpp::TextTools::toString(), and vRateCatTrees_.
|
inlineinherited |
Definition at line 76 of file LikelihoodCalculation.h.
References bpp::LikelihoodCalculation::context_.
|
inlineprotectedinherited |
Definition at line 110 of file LikelihoodCalculation.h.
References bpp::LikelihoodCalculation::context_.
Referenced by bpp::LikelihoodCalculation::cleanAllLikelihoods(), bpp::AlignedLikelihoodCalculation::cleanAllLikelihoods(), bpp::LikelihoodCalculationOnABranch::expandMatrix(), expandMatrix(), bpp::LikelihoodCalculationOnABranch::expandVector(), expandVector(), bpp::HmmLikelihood_DF::HmmLikelihood_DF(), makeForwardLikelihoodTree_(), bpp::LikelihoodCalculationOnABranch::makeLikelihoods(), makeLikelihoodsAtDAGNode_(), makeLikelihoodsAtNode_(), makeLikelihoodsAtRoot_(), makeProcessNodes_(), makeRootFreqs_(), setClockLike(), setNumericalDerivateConfiguration(), and setPatterns_().
|
inline |
Definition at line 342 of file LikelihoodCalculationSingleProcess.h.
References psites_.
Referenced by expandMatrix(), expandVector(), and bpp::SingleProcessPhyloLikelihood::getData().
const DAGindexes & LikelihoodCalculationSingleProcess::getEdgesIds | ( | uint | speciesId, |
size_t | nCat | ||
) | const |
Get indexes of the non-empty edges in the Likelihood DAG that have a given species index for a given rate class index.
speciesId | Looked species Index |
nCat | Rate class category |
Definition at line 782 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::TextTools::toString(), and vRateCatTrees_.
Referenced by bpp::SubstitutionMappingTools::computeCounts(), bpp::SubstitutionMappingTools::computeNormalizations(), and bpp::RewardMappingTools::computeRewardVectors().
ConditionalLikelihoodRef LikelihoodCalculationSingleProcess::getForwardLikelihoodsAtNodeForClass | ( | uint | nodeId, |
size_t | nCat | ||
) |
Definition at line 703 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::LikelihoodCalculation::getLikelihoodNode_(), makeLikelihoods(), bpp::TextTools::toString(), and vRateCatTrees_.
Referenced by bpp::SubstitutionMappingTools::computeCounts(), bpp::SubstitutionMappingTools::computeNormalizations(), and bpp::RewardMappingTools::computeRewardVectors().
std::shared_ptr< ForwardLikelihoodTree > LikelihoodCalculationSingleProcess::getForwardLikelihoodTree | ( | size_t | nCat | ) |
Definition at line 790 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::TextTools::toString(), and vRateCatTrees_.
Referenced by bpp::SubstitutionMappingTools::computeCounts(), bpp::SubstitutionMappingTools::computeNormalizations(), and bpp::RewardMappingTools::computeRewardVectors().
|
inlineinherited |
Definition at line 198 of file LikelihoodCalculation.h.
References bpp::AlignedLikelihoodCalculation::makeLikelihoods(), bpp::AlignedLikelihoodCalculation::patternedSiteLikelihoods_, and bpp::AlignedLikelihoodCalculation::siteLikelihoods_.
Referenced by bpp::AbstractAlignedPhyloLikelihood::getLikelihoodForASite(), and bpp::AlignedLikelihoodCalculation::getLogLikelihoodForASite().
Definition at line 63 of file LikelihoodCalculation.h.
References bpp::LikelihoodCalculation::likelihood_, and bpp::LikelihoodCalculation::makeLikelihoods().
Definition at line 115 of file LikelihoodCalculation.h.
References bpp::LikelihoodCalculation::likelihood_.
Referenced by getForwardLikelihoodsAtNodeForClass(), and getSiteLikelihoodsTree_().
|
inlineinherited |
Get the likelihood for each site.
Definition at line 221 of file LikelihoodCalculation.h.
References bpp::copyEigenToBpp(), and bpp::AlignedLikelihoodCalculation::getSiteLikelihoods().
|
inline |
Definition at line 452 of file LikelihoodCalculationSingleProcess.h.
References condLikelihoodTree_, expandMatrix(), and makeLikelihoodsAtNode_().
SiteLikelihoodsRef LikelihoodCalculationSingleProcess::getLikelihoodsAtNodeForClass | ( | uint | nodeId, |
size_t | nCat | ||
) |
Get shrunked conditional likelihood matrix at Node (ie just above the node), for a given rate class.
These likelihoods are multiplied by the probability of the node.
nodeId | Node Index in the forward tree (! ie in the computation tree, not the species tree). |
nCat | Rate class category |
Definition at line 730 of file LikelihoodCalculationSingleProcess.cpp.
References makeLikelihoodsAtDAGNode_(), bpp::TextTools::toString(), and vRateCatTrees_.
Referenced by bpp::SubstitutionMappingTools::computeCounts(), bpp::SubstitutionMappingTools::computeNormalizations(), and bpp::RewardMappingTools::computeRewardVectors().
|
inlineinherited |
Definition at line 209 of file LikelihoodCalculation.h.
References bpp::AlignedLikelihoodCalculation::getLikelihoodForASite(), and bpp::log().
const DAGindexes & LikelihoodCalculationSingleProcess::getNodesIds | ( | uint | speciesId | ) | const |
Get indexes of the nodes in the Likelihood DAG that have a given species index.
speciesId | Looked species Index |
Definition at line 774 of file LikelihoodCalculationSingleProcess.cpp.
References vRateCatTrees_.
|
inline |
Definition at line 466 of file LikelihoodCalculationSingleProcess.h.
References vRateCatTrees_.
|
inline |
Definition at line 316 of file LikelihoodCalculationSingleProcess.h.
References getNumberOfSites(), and shrunkData_.
Referenced by bpp::SubstitutionMappingTools::computeCounts(), bpp::SubstitutionMappingTools::computeNormalizations(), bpp::RewardMappingTools::computeRewardVectors(), bpp::SingleProcessPhyloLikelihood::getNumberOfDistinctSites(), getSiteLikelihoodsForAllClasses(), bpp::LikelihoodCalculationOnABranch::LikelihoodCalculationOnABranch(), makeLikelihoodsAtDAGNode_(), makeLikelihoodsAtNode_(), and makeLikelihoodsAtRoot_().
|
inline |
Definition at line 311 of file LikelihoodCalculationSingleProcess.h.
References psites_.
Referenced by expandMatrix(), expandVector(), getNumberOfDistinctSites(), bpp::SingleProcessPhyloLikelihood::getNumberOfSites(), and getSiteLikelihoodsForAllClasses().
|
inline |
Definition at line 370 of file LikelihoodCalculationSingleProcess.h.
References rootPatternLinks_.
|
inline |
Definition at line 375 of file LikelihoodCalculationSingleProcess.h.
References rootPatternLinks_.
Referenced by bpp::SubstitutionMappingTools::computeCounts(), bpp::SubstitutionMappingTools::computeNormalizations(), and bpp::RewardMappingTools::computeRewardVectors().
|
inline |
Definition at line 435 of file LikelihoodCalculationSingleProcess.h.
References rFreqs_.
|
inline |
Definition at line 377 of file LikelihoodCalculationSingleProcess.h.
References rootPatternLinks_.
|
inline |
Definition at line 430 of file LikelihoodCalculationSingleProcess.h.
References rootWeights_.
|
inline |
Definition at line 387 of file LikelihoodCalculationSingleProcess.h.
References shrunkData_.
Referenced by bpp::SingleProcessPhyloLikelihood::getShrunkData(), and makeForwardLikelihoodTree_().
|
inlineinherited |
Definition at line 165 of file LikelihoodCalculation.h.
References bpp::AlignedLikelihoodCalculation::makeLikelihoods(), bpp::AlignedLikelihoodCalculation::patternedSiteLikelihoods_, and bpp::AlignedLikelihoodCalculation::siteLikelihoods_.
Referenced by bpp::AlignedPhyloLikelihoodMixture::AlignedPhyloLikelihoodMixture(), and bpp::AlignedLikelihoodCalculation::getLikelihoodPerSite().
RowLik LikelihoodCalculationSingleProcess::getSiteLikelihoodsForAClass | ( | size_t | nCat, |
bool | shrunk = false |
||
) |
Get site likelihoods for a rate category.
nCat | : index of the rate category |
shrunk | : if returns on shrunked data (default: false) |
Definition at line 344 of file LikelihoodCalculationSingleProcess.cpp.
References expandVector(), and getSiteLikelihoodsTree_().
Referenced by getSiteLikelihoodsForAllClasses().
AllRatesSiteLikelihoods LikelihoodCalculationSingleProcess::getSiteLikelihoodsForAllClasses | ( | bool | shrunk = false | ) |
Output array (Classes X Sites) of likelihoods for all sites & classes.
shrunk | : if returns on shrunked data (default: false) |
Definition at line 352 of file LikelihoodCalculationSingleProcess.cpp.
References getNumberOfDistinctSites(), getNumberOfSites(), getSiteLikelihoodsForAClass(), and vRateCatTrees_.
|
private |
Definition at line 685 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::LikelihoodCalculation::getLikelihoodNode_(), getTreeNode(), makeLikelihoodsAtNode_(), makeLikelihoodsAtRoot_(), shrunkData_, bpp::TextTools::toString(), and vRateCatTrees_.
Referenced by getSiteLikelihoodsForAClass().
|
inline |
Definition at line 352 of file LikelihoodCalculationSingleProcess.h.
References bpp::LikelihoodCalculationSingleProcess::ProcessNodes::modelNode_, and processNodes_.
Referenced by bpp::SubstitutionMappingTools::computeOneJumpCounts().
|
inline |
Definition at line 332 of file LikelihoodCalculationSingleProcess.h.
References process_.
Referenced by bpp::SingleProcessPhyloLikelihood::getSubstitutionProcess().
|
inline |
Get process tree for a rate category.
nCat | : index of the rate category |
Definition at line 579 of file LikelihoodCalculationSingleProcess.h.
References bpp::TextTools::toString(), and vRateCatTrees_.
Referenced by bpp::SubstitutionMappingTools::computeCounts(), bpp::SubstitutionMappingTools::computeNormalizations(), bpp::RewardMappingTools::computeRewardVectors(), getBackwardLikelihoodsAtEdgeForClass(), and getSiteLikelihoodsTree_().
|
inline |
Definition at line 425 of file LikelihoodCalculationSingleProcess.h.
References rootWeights_.
|
inlinevirtualinherited |
Definition at line 71 of file LikelihoodCalculation.h.
References bpp::LikelihoodCalculation::likelihood_.
Referenced by bpp::SubstitutionMappingTools::computeCounts(), bpp::SubstitutionMappingTools::computeNormalizations(), bpp::RewardMappingTools::computeRewardVectors(), bpp::OnABranchPhyloLikelihood::isInitialized(), bpp::OneProcessSequencePhyloLikelihood::isInitialized(), bpp::SingleProcessPhyloLikelihood::isInitialized(), and setData().
|
private |
Definition at line 381 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::CategoryFromDiscreteDistribution::create(), bpp::LikelihoodCalculation::getContext_(), getShrunkData(), bpp::LikelihoodCalculationSingleProcess::ProcessNodes::modelNode_, processNodes_, psites_, bpp::LikelihoodCalculationSingleProcess::ProcessNodes::ratesNode_, stateMap(), bpp::LikelihoodCalculationSingleProcess::ProcessNodes::treeNode_, and vRateCatTrees_.
Referenced by makeLikelihoodsAtDAGNode_(), makeLikelihoodsAtNode_(), and makeLikelihoodsAtRoot_().
|
inlinevirtual |
Reimplemented from bpp::AlignedLikelihoodCalculation.
Definition at line 285 of file LikelihoodCalculationSingleProcess.h.
References makeLikelihoodsAtRoot_(), and psites_.
Referenced by getForwardLikelihoodsAtNodeForClass().
|
private |
Compute the likelihood at a given node in the DAG,.
This is not enough to compute likelihoods at species nodes, use makeLikelihoodsAtNode_ instead.
nodeId | : index of the node in the DAG |
Definition at line 634 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::conditionalLikelihoodDimension(), bpp::ConstantOne< T >::create(), bpp::MatrixProduct< R, T0, T1 >::create(), bpp::LikelihoodCalculation::getContext_(), getNumberOfDistinctSites(), makeForwardLikelihoodTree_(), makeRootFreqs_(), bpp::numeric::one(), rFreqs_, stateMap(), and vRateCatTrees_.
Referenced by getBackwardLikelihoodsAtNodeForClass(), getConditionalLikelihoodsAtNodeForClass(), and getLikelihoodsAtNodeForClass().
|
private |
Compute the likelihood at a given node in the tree, which number may not be the same number in the DAG.
Several nodes in the DAG may be related to this tree node, in which case a sum is computed.
nodeId | : index of the node in the phylo Tree |
Definition at line 497 of file LikelihoodCalculationSingleProcess.cpp.
References catProb_, bpp::conditionalLikelihoodDimension(), condLikelihoodTree_, bpp::ConstantOne< T >::create(), bpp::MatrixProduct< R, T0, T1 >::create(), bpp::Convert< R, F >::create(), bpp::LikelihoodCalculation::getContext_(), getNumberOfDistinctSites(), makeForwardLikelihoodTree_(), makeRootFreqs_(), bpp::numeric::one(), process_, processNodes_, bpp::LikelihoodCalculationSingleProcess::ProcessNodes::ratesNode_, rFreqs_, stateMap(), and vRateCatTrees_.
Referenced by getBackwardLikelihoodsAtEdgeForClass(), getLikelihoodsAtNode(), getSiteLikelihoodsTree_(), and makeLikelihoodsTree().
|
private |
Definition at line 428 of file LikelihoodCalculationSingleProcess.cpp.
References catProb_, bpp::ProbabilitiesFromDiscreteDistribution::create(), bpp::SumOfLogarithms< F >::create(), bpp::MatrixProduct< R, T0, T1 >::create(), bpp::Convert< R, F >::create(), bpp::DetailedNodeInfo, expandVector(), bpp::LikelihoodCalculation::getContext_(), getNumberOfDistinctSites(), bpp::Context::getZero(), bpp::LikelihoodCalculation::likelihood_, makeForwardLikelihoodTree_(), makeRootFreqs_(), bpp::AlignedLikelihoodCalculation::patternedSiteLikelihoods_, processNodes_, bpp::LikelihoodCalculationSingleProcess::ProcessNodes::ratesNode_, rFreqs_, rootPatternLinks_, rootWeights_, bpp::LikelihoodCalculation::setLikelihoodNode(), bpp::AlignedLikelihoodCalculation::setSiteLikelihoods(), vRateCatTrees_, bpp::writeGraphToDot(), and bpp::numeric::zero().
Referenced by getSiteLikelihoodsTree_(), makeLikelihoods(), and setData().
|
inline |
make backward likelihood tree (only computed when needed)
Definition at line 544 of file LikelihoodCalculationSingleProcess.h.
References makeLikelihoodsAtNode_(), and process_.
|
private |
Definition at line 124 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::AbstractParameterAliasable::aliasParameters(), bpp::ConfiguredParameter::create(), bpp::LikelihoodCalculation::getContext_(), bpp::AbstractParameterAliasable::getParameters_(), bpp::ProcessTree::makeProcessTree(), bpp::LikelihoodCalculationSingleProcess::ProcessNodes::modelNode_, process_, processNodes_, bpp::LikelihoodCalculationSingleProcess::ProcessNodes::ratesNode_, bpp::LikelihoodCalculationSingleProcess::ProcessNodes::rootFreqsNode_, bpp::AbstractParameterAliasable::shareParameter_(), bpp::TextTools::toString(), and bpp::LikelihoodCalculationSingleProcess::ProcessNodes::treeNode_.
Referenced by LikelihoodCalculationSingleProcess().
|
private |
make DF nodes of a process in a collection, using ConfiguredParameters defined in a CollectionNodes.
Definition at line 197 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::AbstractParameterAliasable::aliasParameters(), bpp::CollectionNodes::collection(), bpp::ConfiguredParameter::create(), bpp::LikelihoodCalculation::getContext_(), bpp::CollectionNodes::getFrequencies(), bpp::AbstractParameterAliasable::getIndependentParameters(), bpp::AbstractParametrizable::getParameter(), bpp::AbstractParameterAliasable::getParameters_(), bpp::CollectionNodes::getRateDistribution(), bpp::AbstractParametrizable::hasParameter(), bpp::ProcessTree::makeProcessTree(), bpp::LikelihoodCalculationSingleProcess::ProcessNodes::modelNode_, processNodes_, bpp::LikelihoodCalculationSingleProcess::ProcessNodes::ratesNode_, bpp::LikelihoodCalculationSingleProcess::ProcessNodes::rootFreqsNode_, bpp::AbstractParameterAliasable::shareParameter_(), bpp::SubstitutionProcessCollection::substitutionProcess(), and bpp::LikelihoodCalculationSingleProcess::ProcessNodes::treeNode_.
|
private |
Definition at line 369 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::LikelihoodCalculation::getContext_(), bpp::StateMapInterface::getNumberOfModelStates(), bpp::LikelihoodCalculationSingleProcess::ProcessNodes::modelNode_, processNodes_, rFreqs_, bpp::LikelihoodCalculationSingleProcess::ProcessNodes::rootFreqsNode_, and stateMap().
Referenced by makeLikelihoodsAtDAGNode_(), makeLikelihoodsAtNode_(), and makeLikelihoodsAtRoot_().
void LikelihoodCalculationSingleProcess::setClockLike | ( | double | rate = 1 | ) |
Set Tree ClockLike :
Definition at line 305 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::ValueFromConfiguredParameter::create(), bpp::ConfiguredParameter::create(), bpp::AbstractParameterAliasable::deleteParameter_(), bpp::LikelihoodCalculation::getContext_(), bpp::ParameterList::getParameterNames(), bpp::AbstractParameterAliasable::getParameters(), processNodes_, bpp::Parameter::R_PLUS_STAR, bpp::ConfiguredParameter::resetDependencies(), bpp::AbstractParameterAliasable::shareParameter_(), and bpp::LikelihoodCalculationSingleProcess::ProcessNodes::treeNode_.
|
inline |
Definition at line 252 of file LikelihoodCalculationSingleProcess.h.
References cleanAllLikelihoods(), bpp::LikelihoodCalculation::isInitialized(), makeLikelihoodsAtRoot_(), psites_, setPatterns_(), and vRateCatTrees_.
Referenced by bpp::OneProcessSequencePhyloLikelihood::setData(), and bpp::SingleProcessPhyloLikelihood::setData().
Definition at line 85 of file LikelihoodCalculation.h.
References bpp::LikelihoodCalculation::likelihood_.
Referenced by bpp::HmmLikelihood_DF::HmmLikelihood_DF(), bpp::LikelihoodCalculationOnABranch::makeLikelihoods(), and makeLikelihoodsAtRoot_().
void LikelihoodCalculationSingleProcess::setNumericalDerivateConfiguration | ( | double | delta, |
const NumericalDerivativeType & | config | ||
) |
Set derivation procedure (see DataFlowNumeric.h)
Definition at line 264 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::NumericMutable< T >::create(), bpp::LikelihoodCalculation::getContext_(), processNodes_, bpp::LikelihoodCalculationSingleProcess::ProcessNodes::ratesNode_, bpp::LikelihoodCalculationSingleProcess::ProcessNodes::rootFreqsNode_, and bpp::LikelihoodCalculationSingleProcess::ProcessNodes::treeNode_.
Referenced by LikelihoodCalculationSingleProcess().
|
private |
Definition at line 110 of file LikelihoodCalculationSingleProcess.cpp.
References bpp::NumericConstant< T >::create(), bpp::LikelihoodCalculation::getContext_(), bpp::SitePatterns::getIndices(), bpp::SitePatterns::getSites(), bpp::SitePatterns::getWeights(), process_, psites_, rootPatternLinks_, rootWeights_, and shrunkData_.
Referenced by LikelihoodCalculationSingleProcess(), and setData().
|
inlineinherited |
Definition at line 184 of file LikelihoodCalculation.h.
References bpp::AlignedLikelihoodCalculation::patternedSiteLikelihoods_, and bpp::AlignedLikelihoodCalculation::siteLikelihoods_.
Referenced by bpp::HmmLikelihood_DF::HmmLikelihood_DF(), bpp::LikelihoodCalculationOnABranch::makeLikelihoods(), and makeLikelihoodsAtRoot_().
|
inline |
Definition at line 382 of file LikelihoodCalculationSingleProcess.h.
References shrunkData_.
|
inline |
Definition at line 347 of file LikelihoodCalculationSingleProcess.h.
References bpp::LikelihoodCalculationSingleProcess::ProcessNodes::modelNode_, and processNodes_.
Referenced by bpp::SingleProcessPhyloLikelihood::getAlphabet(), bpp::LikelihoodCalculationOnABranch::LikelihoodCalculationOnABranch(), makeForwardLikelihoodTree_(), makeLikelihoodsAtDAGNode_(), makeLikelihoodsAtNode_(), and makeRootFreqs_().
|
inline |
Return the ref to the SubstitutionProcess.
Warning; the process parameter values may not be up to date with some of the LikelihoodCalculationSingleProcess
Definition at line 327 of file LikelihoodCalculationSingleProcess.h.
References process_.
Referenced by bpp::SubstitutionMappingTools::computeCounts(), bpp::SubstitutionMappingTools::computeNormalizations(), bpp::SubstitutionMappingTools::computeNormalizedCounts(), bpp::RewardMappingTools::computeRewardVectors(), bpp::SingleProcessPhyloLikelihood::getBranchLengthParameters(), bpp::SingleProcessPhyloLikelihood::getDerivableParameters(), bpp::SingleProcessPhyloLikelihood::getNonDerivableParameters(), bpp::OneProcessSequencePhyloLikelihood::getPosteriorRatePerSite(), bpp::SingleProcessPhyloLikelihood::getRateDistributionParameters(), bpp::SingleProcessPhyloLikelihood::getRootFrequenciesParameters(), bpp::SingleProcessPhyloLikelihood::getSubstitutionModelParameters(), bpp::SingleProcessPhyloLikelihood::substitutionProcess(), and bpp::SingleProcessPhyloLikelihood::tree().
|
friend |
Definition at line 634 of file LikelihoodCalculationSingleProcess.h.
|
private |
Definition at line 210 of file LikelihoodCalculationSingleProcess.h.
Referenced by makeLikelihoodsAtNode_(), and makeLikelihoodsAtRoot_().
|
private |
Definition at line 213 of file LikelihoodCalculationSingleProcess.h.
Referenced by cleanAllLikelihoods(), getBackwardLikelihoodsAtEdgeForClass(), getLikelihoodsAtNode(), and makeLikelihoodsAtNode_().
|
privateinherited |
Definition at line 24 of file LikelihoodCalculation.h.
Referenced by bpp::LikelihoodCalculation::getContext(), and bpp::LikelihoodCalculation::getContext_().
Likelihoods
Definition at line 30 of file LikelihoodCalculation.h.
Referenced by bpp::LikelihoodCalculation::cleanAllLikelihoods(), bpp::LikelihoodCalculation::getLikelihoodNode(), bpp::LikelihoodCalculation::getLikelihoodNode_(), bpp::LikelihoodCalculation::isInitialized(), makeLikelihoodsAtRoot_(), and bpp::LikelihoodCalculation::setLikelihoodNode().
|
mutableprotectedinherited |
Definition at line 155 of file LikelihoodCalculation.h.
Referenced by bpp::AlignedLikelihoodCalculation::cleanAllLikelihoods(), bpp::AlignedLikelihoodCalculation::getLikelihoodForASite(), bpp::AlignedLikelihoodCalculation::getSiteLikelihoods(), bpp::LikelihoodCalculationOnABranch::makeLikelihoods(), makeLikelihoodsAtRoot_(), and bpp::AlignedLikelihoodCalculation::setSiteLikelihoods().
|
private |
Definition at line 169 of file LikelihoodCalculationSingleProcess.h.
Referenced by getSubstitutionProcess(), LikelihoodCalculationSingleProcess(), makeLikelihoodsAtNode_(), makeLikelihoodsTree(), makeProcessNodes_(), setPatterns_(), and substitutionProcess().
|
private |
Definition at line 198 of file LikelihoodCalculationSingleProcess.h.
Referenced by getStateMap(), makeForwardLikelihoodTree_(), makeLikelihoodsAtNode_(), makeLikelihoodsAtRoot_(), makeProcessNodes_(), makeRootFreqs_(), setClockLike(), setNumericalDerivateConfiguration(), and stateMap().
|
private |
Definition at line 170 of file LikelihoodCalculationSingleProcess.h.
Referenced by cleanAllLikelihoods(), data(), getData(), getNumberOfSites(), makeForwardLikelihoodTree_(), makeLikelihoods(), setData(), and setPatterns_().
|
private |
Definition at line 200 of file LikelihoodCalculationSingleProcess.h.
Referenced by getRootFreqs(), makeLikelihoodsAtDAGNode_(), makeLikelihoodsAtNode_(), makeLikelihoodsAtRoot_(), and makeRootFreqs_().
|
private |
Definition at line 186 of file LikelihoodCalculationSingleProcess.h.
Referenced by cleanAllLikelihoods(), expandMatrix(), expandVector(), getRootArrayPosition(), getRootArrayPositions(), getRootPatternLinks(), makeLikelihoodsAtRoot_(), and setPatterns_().
|
private |
The frequency of each site.
Definition at line 192 of file LikelihoodCalculationSingleProcess.h.
Referenced by cleanAllLikelihoods(), getRootWeights(), getWeight(), makeLikelihoodsAtRoot_(), and setPatterns_().
|
private |
Definition at line 193 of file LikelihoodCalculationSingleProcess.h.
Referenced by cleanAllLikelihoods(), getNumberOfDistinctSites(), getShrunkData(), getSiteLikelihoodsTree_(), setPatterns_(), and shrunkData().
|
mutableprotectedinherited |
Site Likelihoods
Definition at line 149 of file LikelihoodCalculation.h.
Referenced by bpp::AlignedLikelihoodCalculation::cleanAllLikelihoods(), bpp::AlignedLikelihoodCalculation::getLikelihoodForASite(), bpp::AlignedLikelihoodCalculation::getSiteLikelihoods(), and bpp::AlignedLikelihoodCalculation::setSiteLikelihoods().
|
private |
Definition at line 203 of file LikelihoodCalculationSingleProcess.h.
Referenced by cleanAllLikelihoods(), getBackwardLikelihoodsAtEdgeForClass(), getBackwardLikelihoodsAtNodeForClass(), getBackwardLikelihoodTree(), getConditionalLikelihoodsAtNodeForClass(), getEdgesIds(), getForwardLikelihoodsAtNodeForClass(), getForwardLikelihoodTree(), getLikelihoodsAtNodeForClass(), getNodesIds(), getNumberOfClasses(), getSiteLikelihoodsForAllClasses(), getSiteLikelihoodsTree_(), getTreeNode(), makeForwardLikelihoodTree_(), makeLikelihoodsAtDAGNode_(), makeLikelihoodsAtNode_(), makeLikelihoodsAtRoot_(), and setData().