bpp-phyl3  3.0.0
bpp::AbstractSequencePhyloLikelihood Class Referenceabstract

#include <Bpp/Phyl/Likelihood/PhyloLikelihoods/SequencePhyloLikelihood.h>

+ Inheritance diagram for bpp::AbstractSequencePhyloLikelihood:
+ Collaboration diagram for bpp::AbstractSequencePhyloLikelihood:

Public Member Functions

 AbstractSequencePhyloLikelihood (Context &context, std::shared_ptr< SequenceEvolution > se, size_t nSE=0, size_t nData=0)
 
 AbstractSequencePhyloLikelihood (const AbstractSequencePhyloLikelihood &aspl)
 
AbstractSequencePhyloLikelihoodoperator= (const AbstractSequencePhyloLikelihood &aspl)
 
const SequenceEvolutionsequenceEvolution () const override
 The Sequence Evolution. More...
 
std::shared_ptr< const SequenceEvolutiongetSequenceEvolution () const override
 
const size_t getSequenceEvolutionNumber () const override
 
virtual LikelihoodCalculationlikelihoodCalculation () const =0
 
virtual std::shared_ptr< LikelihoodCalculationgetLikelihoodCalculation () const =0
 
virtual void enableSecondOrderDerivatives (bool yn)=0
 
virtual bool enableSecondOrderDerivatives () const=0
 
virtual double getSecondOrderDerivative (const std::string &variable) const=0
 
virtual double getSecondOrderDerivative (const std::string &variable1, const std::string &variable2) const=0
 
virtual double d2f (const std::string &variable, const ParameterList &parameters)
 
virtual double d2f (const std::string &variable1, const std::string &variable2, const ParameterList &parameters)
 
virtual void enableFirstOrderDerivatives (bool yn)=0
 
virtual bool enableFirstOrderDerivatives () const=0
 
virtual double getFirstOrderDerivative (const std::string &variable) const=0
 
virtual double df (const std::string &variable, const ParameterList &parameters)
 
virtual void setParameters (const ParameterList &parameters)=0
 
virtual double getValue () const=0
 
virtual double f (const ParameterList &parameters)
 
virtual bool hasParameter (const std::string &name) const=0
 
virtual const ParameterListgetParameters () const=0
 
virtual const Parameterparameter (const std::string &name) const=0
 
virtual double getParameterValue (const std::string &name) const=0
 
virtual void setAllParametersValues (const ParameterList &parameters)=0
 
virtual void setParameterValue (const std::string &name, double value)=0
 
virtual void setParametersValues (const ParameterList &parameters)=0
 
virtual bool matchParametersValues (const ParameterList &parameters)=0
 
virtual void removeConstraint (const std::string &name)=0
 
virtual void setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint)=0
 
virtual size_t getNumberOfParameters () const=0
 
virtual void setNamespace (const std::string &prefix)=0
 
virtual std::string getNamespace () const=0
 
virtual std::string getParameterNameWithoutNamespace (const std::string &name) const=0
 
virtual void setData (std::shared_ptr< const AlignmentDataInterface > sites, size_t nData=0)
 Set the dataset for which the likelihood must be evaluated. More...
 
size_t getNData () const
 Get the number of dataset concerned. More...
 
void setNData (size_t nData)
 
size_t getNumberOfStates () const
 Get the number the states. More...
 
size_t getNumberOfSites () const
 Get the number of sites in the dataset. More...
 
DataLik getLikelihoodForASite (size_t site) const
 Get the likelihood for a site (on uncompressed data) More...
 
double getLogLikelihoodForASite (size_t site) const
 Get the log likelihood for a site, and its derivatives. More...
 
VDataLik getLikelihoodPerSite () const
 Get the likelihood for each site. More...
 
virtual bool isInitialized () const override
 Sets the computeLikelihoods_ to true. More...
 
const Contextcontext () const override
 
Contextcontext () override
 
ValueRef< DataLikgetLikelihoodNode () const override
 
virtual void enableSecondOrderDerivatives (bool yn) override
 
bool enableSecondOrderDerivatives () const override
 
double getSecondOrderDerivative (const std::string &variable) const override
 
double getSecondOrderDerivative (const std::string &variable1, const std::string &variable2) const override
 
virtual void enableFirstOrderDerivatives (bool yn) override
 Tell if derivatives must be computed: for Function inheritance. More...
 
bool enableFirstOrderDerivatives () const override
 
double getFirstOrderDerivative (const std::string &variable) const override
 
void setParameters (const ParameterList &parameters) override
 
double getValue () const override
 
void shareParameters (const ParameterList &variableNodes)
 Share Parameters, that are DF_parameters. More...
 
ValueRef< DataLikfirstOrderDerivativeNode (const std::string &variable) const
 
ValueRef< DataLiksecondOrderDerivativeNode (const std::string &variable1, const std::string &variable2) const
 
the Likelihood interface
std::shared_ptr< const AlphabetgetAlphabet () const override
 Get the alphabet associated to the dataset. More...
 
The data functions
virtual void setData (std::shared_ptr< const AlignmentDataInterface > sites, size_t nData=0)=0
 Set the dataset for which the likelihood must be evaluated. More...
 
virtual std::shared_ptr< const AlignmentDataInterfacegetData () const =0
 Get the dataset for which the likelihood must be evaluated. More...
 
virtual size_t getNData () const =0
 Get the number of dataset concerned. More...
 
virtual size_t getNumberOfStates () const =0
 Get the number the states. More...
 
The data functions
virtual size_t getNumberOfSites () const =0
 Get the number of sites in the dataset. More...
 
The likelihood functions.
virtual AlignedLikelihoodCalculationalignedLikelihoodCalculation () const =0
 
virtual std::shared_ptr< AlignedLikelihoodCalculationgetAlignedLikelihoodCalculation () const =0
 
virtual DataLik getLikelihoodForASite (size_t site) const =0
 Get the likelihood for a site. More...
 
virtual double getLogLikelihoodForASite (size_t site) const =0
 Get the log likelihood for a site, and its derivatives. More...
 
virtual VDataLik getLikelihoodPerSite () const =0
 Get the likelihood for each site. More...
 
The data functions
virtual bool isInitialized () const =0
 
virtual const Contextcontext () const =0
 
virtual Contextcontext ()=0
 
The likelihood functions.
virtual ValueRef< DataLikgetLikelihoodNode () const =0
 
double getLogLikelihood () const
 Get the logarithm of the likelihood for the whole dataset. More...
 
Retrieve some particular independent parameters subsets.

Get the derivates of the LogLikelihood.

virtual ParameterList getNonDerivableParameters () const =0
 
virtual ParameterList getDerivableParameters () const =0
 
virtual ParameterList getBranchLengthParameters () const =0
 Get the independent branch lengths parameters. More...
 
virtual ParameterList getSubstitutionModelParameters () const =0
 Get the independent parameters associated to substitution model(s). More...
 
virtual ParameterList getRateDistributionParameters () const =0
 Get the independent parameters associated to the rate distribution(s). More...
 
virtual ParameterList getRootFrequenciesParameters () const =0
 Get the independent parameters associated to the root frequencies(s). More...
 

Protected Member Functions

SequencePhyloLikelihoodInterfaceclone () const override=0
 
virtual ParameterListgetParameters_ ()=0
 
void setNumberOfSites (size_t nbSites)
 
Node_DFaccessVariableNode (const std::string &name) const
 

Static Protected Member Functions

static Node_DFaccessVariableNode (const Parameter &param)
 

Protected Attributes

std::shared_ptr< SequenceEvolutionseqEvol_
 the Sequence Evolution More...
 
size_t nSeqEvol_
 the Sequence Evolution number More...
 
size_t nbStates_
 
size_t nData_
 Number of the concerned data. More...
 
size_t nbSites_
 
Contextcontext_
 
DataLik minusLogLik_
 the value More...
 
std::unordered_map< std::string, ValueRef< DataLik > > firstOrderDerivativeNodes_
 For Dataflow computing. More...
 
std::unordered_map< std::pair< std::string, std::string >, ValueRef< DataLik >, StringPairHashsecondOrderDerivativeNodes_
 

Detailed Description

Definition at line 49 of file SequencePhyloLikelihood.h.

Constructor & Destructor Documentation

◆ AbstractSequencePhyloLikelihood() [1/2]

bpp::AbstractSequencePhyloLikelihood::AbstractSequencePhyloLikelihood ( Context context,
std::shared_ptr< SequenceEvolution se,
size_t  nSE = 0,
size_t  nData = 0 
)
inline

Definition at line 65 of file SequencePhyloLikelihood.h.

◆ AbstractSequencePhyloLikelihood() [2/2]

bpp::AbstractSequencePhyloLikelihood::AbstractSequencePhyloLikelihood ( const AbstractSequencePhyloLikelihood aspl)
inline

Definition at line 78 of file SequencePhyloLikelihood.h.

Member Function Documentation

◆ accessVariableNode() [1/2]

◆ accessVariableNode() [2/2]

Node_DF& bpp::AbstractPhyloLikelihood::accessVariableNode ( const std::string &  name) const
inlineprotectedinherited

◆ alignedLikelihoodCalculation()

◆ clone()

◆ context() [1/4]

virtual const Context& bpp::PhyloLikelihoodInterface::context ( ) const
pure virtualinherited

◆ context() [2/4]

◆ context() [3/4]

Context& bpp::AbstractPhyloLikelihood::context ( )
inlineoverridevirtualinherited

◆ context() [4/4]

virtual Context& bpp::PhyloLikelihoodInterface::context ( )
pure virtualinherited

◆ enableFirstOrderDerivatives() [1/2]

bool bpp::AbstractPhyloLikelihood::enableFirstOrderDerivatives ( ) const
inlineoverridevirtualinherited

Implements bpp::SecondOrderDerivable.

Definition at line 115 of file AbstractPhyloLikelihood.h.

◆ enableFirstOrderDerivatives() [2/2]

virtual void bpp::AbstractPhyloLikelihood::enableFirstOrderDerivatives ( bool  yn)
inlineoverridevirtualinherited

Tell if derivatives must be computed: for Function inheritance.

Implements bpp::SecondOrderDerivable.

Definition at line 113 of file AbstractPhyloLikelihood.h.

◆ enableSecondOrderDerivatives() [1/2]

bool bpp::AbstractPhyloLikelihood::enableSecondOrderDerivatives ( ) const
inlineoverridevirtualinherited

Implements bpp::SecondOrderDerivable.

Definition at line 116 of file AbstractPhyloLikelihood.h.

◆ enableSecondOrderDerivatives() [2/2]

virtual void bpp::AbstractPhyloLikelihood::enableSecondOrderDerivatives ( bool  yn)
inlineoverridevirtualinherited

Implements bpp::SecondOrderDerivable.

Definition at line 114 of file AbstractPhyloLikelihood.h.

◆ firstOrderDerivativeNode()

◆ getAlignedLikelihoodCalculation()

◆ getAlphabet()

std::shared_ptr<const Alphabet> bpp::AbstractSequencePhyloLikelihood::getAlphabet ( ) const
inlineoverridevirtual

Get the alphabet associated to the dataset.

Returns
the alphabet associated to the dataset.

Implements bpp::SingleDataPhyloLikelihoodInterface.

Definition at line 116 of file SequencePhyloLikelihood.h.

References seqEvol_.

◆ getBranchLengthParameters()

virtual ParameterList bpp::PhyloLikelihoodInterface::getBranchLengthParameters ( ) const
pure virtualinherited

◆ getData()

virtual std::shared_ptr<const AlignmentDataInterface> bpp::SingleDataPhyloLikelihoodInterface::getData ( ) const
pure virtualinherited

Get the dataset for which the likelihood must be evaluated.

Returns
A pointer toward the site container where the sequences are stored.

Implemented in bpp::SingleProcessPhyloLikelihood, bpp::PartitionProcessPhyloLikelihood, bpp::OneProcessSequencePhyloLikelihood, and bpp::MultiProcessSequencePhyloLikelihood.

Referenced by bpp::PhylogeneticsApplicationTools::printAnalysisInformation().

◆ getDerivableParameters()

virtual ParameterList bpp::PhyloLikelihoodInterface::getDerivableParameters ( ) const
pure virtualinherited

◆ getFirstOrderDerivative()

double bpp::AbstractPhyloLikelihood::getFirstOrderDerivative ( const std::string &  variable) const
inlineoverridevirtualinherited

◆ getLikelihoodCalculation()

◆ getLikelihoodForASite() [1/2]

DataLik bpp::AbstractAlignedPhyloLikelihood::getLikelihoodForASite ( size_t  site) const
inlinevirtualinherited

Get the likelihood for a site (on uncompressed data)

Parameters
siteThe site index to analyse.
Returns
The likelihood for site site.

Implements bpp::AlignedPhyloLikelihoodInterface.

Definition at line 143 of file AlignedPhyloLikelihood.h.

References bpp::AlignedPhyloLikelihoodInterface::alignedLikelihoodCalculation(), and bpp::AlignedLikelihoodCalculation::getLikelihoodForASite().

◆ getLikelihoodForASite() [2/2]

virtual DataLik bpp::AlignedPhyloLikelihoodInterface::getLikelihoodForASite ( size_t  site) const
pure virtualinherited

Get the likelihood for a site.

Parameters
siteThe site index to analyse.
Returns
The likelihood for site site.

Implemented in bpp::AbstractAlignedPhyloLikelihood.

Referenced by bpp::AbstractAlignedPhyloLikelihoodSet::getLikelihoodForASiteForAPhyloLikelihood().

◆ getLikelihoodNode() [1/2]

virtual ValueRef<DataLik> bpp::PhyloLikelihoodInterface::getLikelihoodNode ( ) const
pure virtualinherited
Returns
the LikDF node where the Likelihood is computed.

Implemented in bpp::AbstractPhyloLikelihood.

◆ getLikelihoodNode() [2/2]

ValueRef<DataLik> bpp::AbstractPhyloLikelihood::getLikelihoodNode ( ) const
inlineoverridevirtualinherited

◆ getLikelihoodPerSite() [1/2]

VDataLik bpp::AbstractAlignedPhyloLikelihood::getLikelihoodPerSite ( ) const
inlinevirtualinherited

◆ getLikelihoodPerSite() [2/2]

virtual VDataLik bpp::AlignedPhyloLikelihoodInterface::getLikelihoodPerSite ( ) const
pure virtualinherited

Get the likelihood for each site.

Returns
A vector with all site likelihoods.

Implemented in bpp::AbstractAlignedPhyloLikelihood.

◆ getLogLikelihood()

double bpp::PhyloLikelihoodInterface::getLogLikelihood ( ) const
inlineinherited

Get the logarithm of the likelihood for the whole dataset.

Returns
The logarithm of the likelihood of the dataset.

Definition at line 66 of file PhyloLikelihood.h.

References bpp::SecondOrderDerivable::getValue().

◆ getLogLikelihoodForASite() [1/2]

double bpp::AbstractAlignedPhyloLikelihood::getLogLikelihoodForASite ( size_t  site) const
inlinevirtualinherited

Get the log likelihood for a site, and its derivatives.

Parameters
siteThe site index to analyse.
Returns
The (D)log likelihood for site site.

Implements bpp::AlignedPhyloLikelihoodInterface.

Definition at line 154 of file AlignedPhyloLikelihood.h.

References bpp::convert(), and bpp::AlignedPhyloLikelihoodInterface::getAlignedLikelihoodCalculation().

◆ getLogLikelihoodForASite() [2/2]

virtual double bpp::AlignedPhyloLikelihoodInterface::getLogLikelihoodForASite ( size_t  site) const
pure virtualinherited

Get the log likelihood for a site, and its derivatives.

Parameters
siteThe site index to analyse.
Returns
The (D)log likelihood for site site.

Implemented in bpp::AbstractAlignedPhyloLikelihood.

Referenced by bpp::AbstractAlignedPhyloLikelihoodSet::getLogLikelihoodForASiteForAPhyloLikelihood(), and bpp::PhylogeneticsApplicationTools::printAnalysisInformation().

◆ getNData() [1/2]

size_t bpp::AbstractSingleDataPhyloLikelihood::getNData ( ) const
inlinevirtualinherited

Get the number of dataset concerned.

Implements bpp::SingleDataPhyloLikelihoodInterface.

Definition at line 126 of file SingleDataPhyloLikelihood.h.

References bpp::AbstractSingleDataPhyloLikelihood::nData_.

◆ getNData() [2/2]

virtual size_t bpp::SingleDataPhyloLikelihoodInterface::getNData ( ) const
pure virtualinherited

Get the number of dataset concerned.

Implemented in bpp::AbstractSingleDataPhyloLikelihood.

Referenced by bpp::PhylogeneticsApplicationTools::printParameters().

◆ getNonDerivableParameters()

virtual ParameterList bpp::PhyloLikelihoodInterface::getNonDerivableParameters ( ) const
pure virtualinherited

◆ getNumberOfSites() [1/2]

◆ getNumberOfSites() [2/2]

virtual size_t bpp::AlignedPhyloLikelihoodInterface::getNumberOfSites ( ) const
pure virtualinherited

◆ getNumberOfStates() [1/2]

size_t bpp::AbstractSingleDataPhyloLikelihood::getNumberOfStates ( ) const
inlinevirtualinherited

Get the number the states.

Implements bpp::SingleDataPhyloLikelihoodInterface.

Definition at line 136 of file SingleDataPhyloLikelihood.h.

References bpp::AbstractSingleDataPhyloLikelihood::nbStates_.

◆ getNumberOfStates() [2/2]

virtual size_t bpp::SingleDataPhyloLikelihoodInterface::getNumberOfStates ( ) const
pure virtualinherited

Get the number the states.

Implemented in bpp::AbstractSingleDataPhyloLikelihood.

◆ getRateDistributionParameters()

virtual ParameterList bpp::PhyloLikelihoodInterface::getRateDistributionParameters ( ) const
pure virtualinherited

Get the independent parameters associated to the rate distribution(s).

Returns
A ParameterList.

Implemented in bpp::SingleProcessPhyloLikelihood, bpp::AbstractParametrizableSequencePhyloLikelihood, bpp::AbstractPhyloLikelihoodSet, and bpp::OnABranchPhyloLikelihood.

◆ getRootFrequenciesParameters()

virtual ParameterList bpp::PhyloLikelihoodInterface::getRootFrequenciesParameters ( ) const
pure virtualinherited

Get the independent parameters associated to the root frequencies(s).

Returns
A ParameterList.

Implemented in bpp::SingleProcessPhyloLikelihood, bpp::AbstractParametrizableSequencePhyloLikelihood, bpp::AbstractPhyloLikelihoodSet, and bpp::OnABranchPhyloLikelihood.

◆ getSecondOrderDerivative() [1/2]

double bpp::AbstractPhyloLikelihood::getSecondOrderDerivative ( const std::string &  variable) const
inlineoverridevirtualinherited

Implements bpp::SecondOrderDerivable.

Definition at line 155 of file AbstractPhyloLikelihood.h.

◆ getSecondOrderDerivative() [2/2]

double bpp::AbstractPhyloLikelihood::getSecondOrderDerivative ( const std::string &  variable1,
const std::string &  variable2 
) const
inlineoverridevirtualinherited

◆ getSequenceEvolution()

std::shared_ptr<const SequenceEvolution> bpp::AbstractSequencePhyloLikelihood::getSequenceEvolution ( ) const
inlineoverridevirtual

Implements bpp::SequencePhyloLikelihoodInterface.

Definition at line 102 of file SequencePhyloLikelihood.h.

References seqEvol_.

◆ getSequenceEvolutionNumber()

const size_t bpp::AbstractSequencePhyloLikelihood::getSequenceEvolutionNumber ( ) const
inlineoverridevirtual

Implements bpp::SequencePhyloLikelihoodInterface.

Definition at line 107 of file SequencePhyloLikelihood.h.

References nSeqEvol_.

◆ getSubstitutionModelParameters()

virtual ParameterList bpp::PhyloLikelihoodInterface::getSubstitutionModelParameters ( ) const
pure virtualinherited

Get the independent parameters associated to substitution model(s).

Returns
A ParameterList.

Implemented in bpp::SingleProcessPhyloLikelihood, bpp::AbstractParametrizableSequencePhyloLikelihood, bpp::AbstractPhyloLikelihoodSet, and bpp::OnABranchPhyloLikelihood.

◆ getValue()

double bpp::AbstractPhyloLikelihood::getValue ( ) const
inlineoverridevirtualinherited

◆ isInitialized() [1/2]

virtual bool bpp::PhyloLikelihoodInterface::isInitialized ( ) const
pure virtualinherited

◆ isInitialized() [2/2]

virtual bool bpp::AbstractPhyloLikelihood::isInitialized ( ) const
inlineoverridevirtualinherited

◆ likelihoodCalculation()

◆ operator=()

◆ secondOrderDerivativeNode()

ValueRef<DataLik> bpp::AbstractPhyloLikelihood::secondOrderDerivativeNode ( const std::string &  variable1,
const std::string &  variable2 
) const
inlineinherited

◆ sequenceEvolution()

const SequenceEvolution& bpp::AbstractSequencePhyloLikelihood::sequenceEvolution ( ) const
inlineoverridevirtual

The Sequence Evolution.

Implements bpp::SequencePhyloLikelihoodInterface.

Definition at line 97 of file SequencePhyloLikelihood.h.

References seqEvol_.

◆ setData() [1/2]

◆ setData() [2/2]

virtual void bpp::SingleDataPhyloLikelihoodInterface::setData ( std::shared_ptr< const AlignmentDataInterface sites,
size_t  nData = 0 
)
pure virtualinherited

Set the dataset for which the likelihood must be evaluated.

Parameters
sitesThe data set to use.
nDatathe number of the data

Implemented in bpp::SingleProcessPhyloLikelihood, bpp::AbstractParametrizableSequencePhyloLikelihood, bpp::OneProcessSequencePhyloLikelihood, bpp::MultiProcessSequencePhyloLikelihood, bpp::AbstractSingleDataPhyloLikelihood, and bpp::PartitionProcessPhyloLikelihood.

◆ setNData()

void bpp::AbstractSingleDataPhyloLikelihood::setNData ( size_t  nData)
inlineinherited

◆ setNumberOfSites()

void bpp::AbstractAlignedPhyloLikelihood::setNumberOfSites ( size_t  nbSites)
inlineprotectedinherited

◆ setParameters()

void bpp::AbstractPhyloLikelihood::setParameters ( const ParameterList parameters)
inlineoverridevirtualinherited

◆ shareParameters()

void bpp::AbstractPhyloLikelihood::shareParameters ( const ParameterList variableNodes)
inlineinherited

Member Data Documentation

◆ context_

◆ firstOrderDerivativeNodes_

std::unordered_map<std::string, ValueRef<DataLik> > bpp::AbstractPhyloLikelihood::firstOrderDerivativeNodes_
mutableprotectedinherited

For Dataflow computing.

Definition at line 44 of file AbstractPhyloLikelihood.h.

Referenced by bpp::AbstractPhyloLikelihood::firstOrderDerivativeNode().

◆ minusLogLik_

DataLik bpp::AbstractPhyloLikelihood::minusLogLik_
mutableprotectedinherited

◆ nbSites_

◆ nbStates_

◆ nData_

◆ nSeqEvol_

size_t bpp::AbstractSequencePhyloLikelihood::nSeqEvol_
protected

the Sequence Evolution number

Definition at line 62 of file SequencePhyloLikelihood.h.

Referenced by getSequenceEvolutionNumber(), and operator=().

◆ secondOrderDerivativeNodes_

std::unordered_map<std::pair<std::string, std::string>, ValueRef<DataLik>, StringPairHash> bpp::AbstractPhyloLikelihood::secondOrderDerivativeNodes_
mutableprotectedinherited

◆ seqEvol_


The documentation for this class was generated from the following file: