5 #ifndef BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_ONEPROCESSSEQUENCEPHYLOLIKELIHOOD_H
6 #define BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_ONEPROCESSSEQUENCEPHYLOLIKELIHOOD_H
13 #include "../../Tree/PhyloTree.h"
14 #include "../SitePartition.h"
20 #include "../DataFlow/LikelihoodCalculationSingleProcess.h"
23 #include "../SubstitutionProcess.h"
24 #include "../OneProcessSequenceEvolution.h"
44 std::shared_ptr<OneProcessSequenceEvolution>
mSeqEvol_;
51 mutable std::unordered_map<std::pair<std::string, std::string>,
ValueRef<RowLik>,
56 mutable std::shared_ptr<LikelihoodCalculationSingleProcess>
likCal_;
61 std::shared_ptr<OneProcessSequenceEvolution> evol,
66 std::shared_ptr<const AlignmentDataInterface> data,
67 std::shared_ptr<OneProcessSequenceEvolution> evol,
72 std::shared_ptr<const AlignmentDataInterface> data,
73 std::shared_ptr<OneProcessSequenceEvolution> evol,
74 std::shared_ptr<CollectionNodes> collNodes,
112 void setData(std::shared_ptr<const AlignmentDataInterface> sites,
size_t nData = 0)
override
126 std::shared_ptr<const AlignmentDataInterface>
getData()
const override
166 std::shared_ptr<const ParametrizablePhyloTree>
tree()
const
168 return mSeqEvol_->substitutionProcess().getParametrizablePhyloTree();
235 const std::string& variable2)
const
241 const std::string& variable2)
const
243 const auto key = std::make_pair (variable1, variable2);
AbstractParametrizableSequencePhyloLikelihood & operator=(const AbstractParametrizableSequencePhyloLikelihood &apspl)
const Context & context() const override
static Node_DF & accessVariableNode(const Parameter ¶m)
virtual void setData(std::shared_ptr< const AlignmentDataInterface > sites, size_t nData=0)
Set the dataset for which the likelihood must be evaluated.
Context for dataflow node construction.
void setData(std::shared_ptr< const AlignmentDataInterface > sites)
virtual bool isInitialized() const
The OneProcessSequencePhyloLikelihood class: phylogenetic likelihood computation with a single proces...
std::shared_ptr< LikelihoodCalculationSingleProcess > getLikelihoodCalculationSingleProcess() const
ValueRef< RowLik > secondOrderDerivativeVector(const std::string &variable1, const std::string &variable2) const
VVdouble getPosteriorProbabilitiesPerSitePerClass() const
Vdouble getPosteriorStateFrequencies(uint nodeId)
virtual ~OneProcessSequencePhyloLikelihood()
std::shared_ptr< const SubstitutionProcessInterface > getSubstitutionProcess() const
std::unordered_map< std::string, ValueRef< RowLik > > firstOrderDerivativeVectors_
For Dataflow computing.
ValueRef< RowLik > firstOrderDerivativeVector(const std::string &variable) const
LikelihoodCalculation & likelihoodCalculation() const override
ValueRef< RowLik > getSecondOrderDerivativeVector(const std::string &variable) const
std::shared_ptr< AlignedLikelihoodCalculation > getAlignedLikelihoodCalculation() const override
OneProcessSequencePhyloLikelihood & operator=(const OneProcessSequencePhyloLikelihood &lik)
std::shared_ptr< LikelihoodCalculation > getLikelihoodCalculation() const override
std::shared_ptr< LikelihoodCalculationSingleProcess > likCal_
Vdouble getPosteriorRatePerSite() const
ValueRef< RowLik > getFirstOrderDerivativeVector(const std::string &variable) const
Vdouble getPosteriorProbabilitiesForSitePerClass(size_t pos) const
std::vector< size_t > getClassWithMaxPostProbPerSite() const
LikelihoodCalculationSingleProcess & likelihoodCalculationSingleProcess() const
OneProcessSequencePhyloLikelihood(const OneProcessSequencePhyloLikelihood &lik)
void setData(std::shared_ptr< const AlignmentDataInterface > sites, size_t nData=0) override
Set the dataset for which the likelihood must be evaluated.
const SubstitutionProcessInterface & substitutionProcess() const
Get the ParametrizablePhyloTree.
VVdouble getLikelihoodPerSitePerClass() const
ValueRef< RowLik > getSecondOrderDerivativeVector(const std::string &variable1, const std::string &variable2) const
std::shared_ptr< OneProcessSequenceEvolution > mSeqEvol_
to avoid the dynamic casts
bool isInitialized() const override
Sets the computeLikelihoods_ to true.
OneProcessSequencePhyloLikelihood(Context &context, std::shared_ptr< OneProcessSequenceEvolution > evol, size_t nSeqEvol=0)
std::shared_ptr< const ParametrizablePhyloTree > tree() const
Return the ref to the SubstitutionProcess used to build the phylolikelihood.
std::unordered_map< std::pair< std::string, std::string >, ValueRef< RowLik >, StringPairHash > secondOrderDerivativeVectors_
size_t getNumberOfClasses() const
Get the number of model classes.
std::shared_ptr< const Alphabet > getAlphabet() const override
Get the alphabet associated to the dataset.
OneProcessSequencePhyloLikelihood * clone() const override
std::shared_ptr< const AlignmentDataInterface > getData() const override
return a pointer to the compressed data.
AlignedLikelihoodCalculation & alignedLikelihoodCalculation() const override
This interface describes the substitution process along the tree and sites of the alignment.
Defines the basic types of data flow nodes.
std::vector< double > Vdouble
std::shared_ptr< Value< T > > ValueRef
Shared pointer alias for Value<T>.
std::vector< Vdouble > VVdouble