bpp-phyl3
3.0.0
|
#include <Bpp/Phyl/Likelihood/DataFlow/LikelihoodCalculationOnABranch.h>
Classes | |
class | RateCategoryEdge |
Public Member Functions | |
LikelihoodCalculationOnABranch (Context &context, LikelihoodCalculationSingleProcess &likcalsp, uint edgeId) | |
void | setModel (std::shared_ptr< ConfiguredModel > model) |
LikelihoodCalculationOnABranch (const LikelihoodCalculationOnABranch &lik) | |
LikelihoodCalculationOnABranch * | clone () const |
const StateMapInterface & | stateMap () const |
std::shared_ptr< const StateMapInterface > | getStateMap () const |
std::shared_ptr< const Alphabet > | getAlphabet () const |
size_t | getRootArrayPosition (size_t currentPosition) const |
const PatternType & | getRootArrayPositions () 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 () |
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... | |
size_t | getNumberOfDistinctSites () const |
size_t | getNumberOfSites () const |
std::shared_ptr< ConfiguredModel > | getModel () |
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 | makeLikelihoods () |
std::shared_ptr< SiteLikelihoods > | getSiteLikelihoods_ (size_t nCat) |
void | cleanAllLikelihoods () |
Private Attributes | |
size_t | numberOfSites_ |
MatrixDimension | likelihoodMatrixDim_ |
std::shared_ptr< ConfiguredModel > | model_ |
ValueRef< PatternType > | rootPatternLinks_ |
std::shared_ptr< SiteWeights > | rootWeights_ |
The frequency of each site. More... | |
ValueRef< Eigen::RowVectorXd > | catProb_ |
std::vector< RateCategoryEdge > | vRateCatEdges_ |
Context & | context_ |
ParameterList | independentParameters_ |
std::map< std::string, std::shared_ptr< AliasParameterListener > > | aliasListenersRegister_ |
ParameterList | parameters_ |
std::string | prefix_ |
Definition at line 70 of file LikelihoodCalculationOnABranch.h.
LikelihoodCalculationOnABranch::LikelihoodCalculationOnABranch | ( | Context & | context, |
LikelihoodCalculationSingleProcess & | likcalsp, | ||
uint | edgeId | ||
) |
LikelihoodCalculationOnABranch::LikelihoodCalculationOnABranch | ( | const LikelihoodCalculationOnABranch & | lik | ) |
Definition at line 53 of file LikelihoodCalculationOnABranch.cpp.
|
privatevirtual |
Reimplemented from bpp::AlignedLikelihoodCalculation.
Definition at line 170 of file LikelihoodCalculationOnABranch.cpp.
References bpp::AlignedLikelihoodCalculation::cleanAllLikelihoods(), rootPatternLinks_, rootWeights_, and vRateCatEdges_.
|
inlinevirtual |
Reimplemented from bpp::AlignedLikelihoodCalculation.
Definition at line 168 of file LikelihoodCalculationOnABranch.h.
|
inline |
Definition at line 229 of file LikelihoodCalculationOnABranch.h.
References bpp::CWisePattern< R >::create(), bpp::LikelihoodCalculation::getContext_(), numberOfSites_, and rootPatternLinks_.
|
inline |
Definition at line 215 of file LikelihoodCalculationOnABranch.h.
References bpp::CWisePattern< R >::create(), bpp::LikelihoodCalculation::getContext_(), numberOfSites_, and rootPatternLinks_.
Referenced by getSiteLikelihoodsForAClass(), and makeLikelihoods().
|
inline |
Definition at line 183 of file LikelihoodCalculationOnABranch.h.
References bpp::StateMapInterface::getAlphabet(), and stateMap().
|
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(), expandMatrix(), bpp::LikelihoodCalculationSingleProcess::expandMatrix(), expandVector(), bpp::LikelihoodCalculationSingleProcess::expandVector(), bpp::HmmLikelihood_DF::HmmLikelihood_DF(), bpp::LikelihoodCalculationSingleProcess::makeForwardLikelihoodTree_(), makeLikelihoods(), bpp::LikelihoodCalculationSingleProcess::makeLikelihoodsAtDAGNode_(), bpp::LikelihoodCalculationSingleProcess::makeLikelihoodsAtNode_(), bpp::LikelihoodCalculationSingleProcess::makeLikelihoodsAtRoot_(), bpp::LikelihoodCalculationSingleProcess::makeProcessNodes_(), bpp::LikelihoodCalculationSingleProcess::makeRootFreqs_(), bpp::LikelihoodCalculationSingleProcess::setClockLike(), bpp::LikelihoodCalculationSingleProcess::setNumericalDerivateConfiguration(), and bpp::LikelihoodCalculationSingleProcess::setPatterns_().
|
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 bpp::LikelihoodCalculationSingleProcess::getForwardLikelihoodsAtNodeForClass(), and bpp::LikelihoodCalculationSingleProcess::getSiteLikelihoodsTree_().
|
inlineinherited |
Get the likelihood for each site.
Definition at line 221 of file LikelihoodCalculation.h.
References bpp::copyEigenToBpp(), and bpp::AlignedLikelihoodCalculation::getSiteLikelihoods().
|
inlineinherited |
Definition at line 209 of file LikelihoodCalculation.h.
References bpp::AlignedLikelihoodCalculation::getLikelihoodForASite(), and bpp::log().
|
inline |
Definition at line 286 of file LikelihoodCalculationOnABranch.h.
References model_.
Referenced by makeLikelihoods().
|
inline |
Definition at line 276 of file LikelihoodCalculationOnABranch.h.
References bpp::MatrixDimension::cols, and likelihoodMatrixDim_.
Referenced by bpp::OnABranchPhyloLikelihood::getNumberOfDistinctSites(), getSiteLikelihoodsForAllClasses(), and makeLikelihoods().
|
inline |
Definition at line 281 of file LikelihoodCalculationOnABranch.h.
References numberOfSites_.
Referenced by bpp::OnABranchPhyloLikelihood::getNumberOfSites().
|
inline |
Definition at line 202 of file LikelihoodCalculationOnABranch.h.
References rootPatternLinks_.
|
inline |
Definition at line 207 of file LikelihoodCalculationOnABranch.h.
References rootPatternLinks_.
|
inline |
Definition at line 247 of file LikelihoodCalculationOnABranch.h.
References rootWeights_.
|
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().
|
private |
RowLik LikelihoodCalculationOnABranch::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 64 of file LikelihoodCalculationOnABranch.cpp.
References expandVector(), and vRateCatEdges_.
Referenced by getSiteLikelihoodsForAllClasses().
AllRatesSiteLikelihoods LikelihoodCalculationOnABranch::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 72 of file LikelihoodCalculationOnABranch.cpp.
References getNumberOfDistinctSites(), getSiteLikelihoodsForAClass(), numberOfSites_, and vRateCatEdges_.
|
inline |
Definition at line 178 of file LikelihoodCalculationOnABranch.h.
References model_.
|
inline |
Definition at line 242 of file LikelihoodCalculationOnABranch.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 bpp::LikelihoodCalculationSingleProcess::setData().
|
privatevirtual |
Reimplemented from bpp::AlignedLikelihoodCalculation.
Definition at line 89 of file LikelihoodCalculationOnABranch.cpp.
References catProb_, bpp::ConstantOne< T >::create(), bpp::SumOfLogarithms< F >::create(), bpp::MatrixProduct< R, T0, T1 >::create(), bpp::Convert< R, F >::create(), expandVector(), bpp::LikelihoodCalculation::getContext_(), getModel(), getNumberOfDistinctSites(), bpp::Context::getZero(), likelihoodMatrixDim_, model_, bpp::numeric::one(), bpp::AlignedLikelihoodCalculation::patternedSiteLikelihoods_, rootPatternLinks_, rootWeights_, bpp::LikelihoodCalculation::setLikelihoodNode(), bpp::AlignedLikelihoodCalculation::setSiteLikelihoods(), stateMap(), bpp::transitionMatrixDimension(), vRateCatEdges_, and bpp::numeric::zero().
Referenced by setModel().
Definition at line 85 of file LikelihoodCalculation.h.
References bpp::LikelihoodCalculation::likelihood_.
Referenced by bpp::HmmLikelihood_DF::HmmLikelihood_DF(), makeLikelihoods(), and bpp::LikelihoodCalculationSingleProcess::makeLikelihoodsAtRoot_().
|
inline |
Definition at line 157 of file LikelihoodCalculationOnABranch.h.
References makeLikelihoods(), model_, and bpp::AbstractParameterAliasable::shareParameters_().
|
inlineinherited |
Definition at line 184 of file LikelihoodCalculation.h.
References bpp::AlignedLikelihoodCalculation::patternedSiteLikelihoods_, and bpp::AlignedLikelihoodCalculation::siteLikelihoods_.
Referenced by bpp::HmmLikelihood_DF::HmmLikelihood_DF(), makeLikelihoods(), and bpp::LikelihoodCalculationSingleProcess::makeLikelihoodsAtRoot_().
|
inline |
Definition at line 173 of file LikelihoodCalculationOnABranch.h.
References model_.
Referenced by getAlphabet(), and makeLikelihoods().
|
private |
Definition at line 148 of file LikelihoodCalculationOnABranch.h.
Referenced by makeLikelihoods().
|
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(), bpp::LikelihoodCalculationSingleProcess::makeLikelihoodsAtRoot_(), and bpp::LikelihoodCalculation::setLikelihoodNode().
|
private |
Definition at line 111 of file LikelihoodCalculationOnABranch.h.
Referenced by getNumberOfDistinctSites(), and makeLikelihoods().
|
private |
Definition at line 118 of file LikelihoodCalculationOnABranch.h.
Referenced by getModel(), getStateMap(), makeLikelihoods(), setModel(), and stateMap().
|
private |
Definition at line 105 of file LikelihoodCalculationOnABranch.h.
Referenced by expandMatrix(), expandVector(), getNumberOfSites(), and getSiteLikelihoodsForAllClasses().
|
mutableprotectedinherited |
Definition at line 155 of file LikelihoodCalculation.h.
Referenced by bpp::AlignedLikelihoodCalculation::cleanAllLikelihoods(), bpp::AlignedLikelihoodCalculation::getLikelihoodForASite(), bpp::AlignedLikelihoodCalculation::getSiteLikelihoods(), makeLikelihoods(), bpp::LikelihoodCalculationSingleProcess::makeLikelihoodsAtRoot_(), and bpp::AlignedLikelihoodCalculation::setSiteLikelihoods().
|
private |
Definition at line 135 of file LikelihoodCalculationOnABranch.h.
Referenced by cleanAllLikelihoods(), expandMatrix(), expandVector(), getRootArrayPosition(), getRootArrayPositions(), and makeLikelihoods().
|
private |
The frequency of each site.
Definition at line 141 of file LikelihoodCalculationOnABranch.h.
Referenced by cleanAllLikelihoods(), getRootWeights(), getWeight(), and makeLikelihoods().
|
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 151 of file LikelihoodCalculationOnABranch.h.
Referenced by cleanAllLikelihoods(), getSiteLikelihoodsForAClass(), getSiteLikelihoodsForAllClasses(), and makeLikelihoods().