bpp-phyl  2.2.0
bpp::DiscreteRatesAcrossSitesTreeLikelihood Class Referenceabstract

Interface for rate across sites (RAS) implementation. More...

#include <Bpp/Phyl/Likelihood/DiscreteRatesAcrossSitesTreeLikelihood.h>

+ Inheritance diagram for bpp::DiscreteRatesAcrossSitesTreeLikelihood:
+ Collaboration diagram for bpp::DiscreteRatesAcrossSitesTreeLikelihood:

Public Member Functions

 DiscreteRatesAcrossSitesTreeLikelihood ()
 
virtual ~DiscreteRatesAcrossSitesTreeLikelihood ()
 
virtual const DiscreteDistribution * getRateDistribution () const =0
 Get the rate distribution used for the computation. More...
 
virtual DiscreteDistribution * getRateDistribution ()=0
 Get the rate distribution used for the computation. More...
 
virtual double getLikelihoodForASiteForARateClass (size_t site, size_t rateClass) const =0
 Get the likelihood for a site knowing its rate class. More...
 
virtual double getLogLikelihoodForASiteForARateClass (size_t site, size_t rateClass) const =0
 Get the logarithm of the likelihood for a site knowing its rate class. More...
 
virtual double getLikelihoodForASiteForARateClassForAState (size_t site, size_t rateClass, int state) const =0
 Get the likelihood for a site knowing its rate class and its ancestral state. More...
 
virtual double getLogLikelihoodForASiteForARateClassForAState (size_t site, size_t rateClass, int state) const =0
 Get the logarithm of the likelihood for a site knowing its rate class and its ancestral state. More...
 
virtual VVdouble getLikelihoodForEachSiteForEachRateClass () const =0
 Get the likelihood for each site and each rate class. More...
 
virtual VVdouble getLogLikelihoodForEachSiteForEachRateClass () const =0
 Get the logarithm of the likelihood for each site and each rate class. More...
 
virtual VVVdouble getLikelihoodForEachSiteForEachRateClassForEachState () const =0
 Get the likelihood for each site and each rate class and each state. More...
 
virtual VVVdouble getLogLikelihoodForEachSiteForEachRateClassForEachState () const =0
 Get the logarithm of the likelihood for each site and each rate class and each state. More...
 
virtual VVdouble getPosteriorProbabilitiesOfEachRate () const =0
 Get the posterior probability for each site of belonging to a particular rate class. More...
 
virtual std::vector< size_t > getRateClassWithMaxPostProbOfEachSite () const =0
 Get the posterior rate class (the one with maximum posterior probability) for each site. More...
 
virtual Vdouble getRateWithMaxPostProbOfEachSite () const =0
 Get the posterior rate (the one with maximum posterior probability) for each site. More...
 
virtual Vdouble getPosteriorRateOfEachSite () const =0
 Get the posterior rate, i.e. averaged over all classes and weighted with posterior probabilities, for each site. More...
 
virtual ParameterList getRateDistributionParameters () const =0
 Get the parameters associated to the rate distirbution. More...
 
virtual size_t getNumberOfClasses () const =0
 Get the number of classes. More...
 
virtual VVVdouble getTransitionProbabilitiesPerRateClass (int nodeId, size_t siteIndex) const =0
 Retrieves all Pij(t) for a particular branch, defined by the upper node. More...
 
TreeLikelihoodclone () const =0
 
virtual void setData (const SiteContainer &sites)=0
 Set the dataset for which the likelihood must be evaluated. More...
 
virtual const SiteContainer * getData () const =0
 Get the dataset for which the likelihood must be evaluated. More...
 
virtual void initialize ()=0 throw (Exception)
 Init the likelihood object. More...
 
virtual bool isInitialized () const =0
 
virtual TreeLikelihoodDatagetLikelihoodData ()=0
 
virtual const TreeLikelihoodDatagetLikelihoodData () const =0
 
virtual double getLikelihoodForASite (size_t site) const =0
 Get the likelihood for a site. More...
 
virtual double getLogLikelihoodForASite (size_t site) const =0
 Get the logarithm of the likelihood for a site. More...
 
virtual double getLikelihoodForASiteForAState (size_t site, int state) const =0
 Get the likelihood for a site and for a state. More...
 
virtual double getLogLikelihoodForASiteForAState (size_t site, int state) const =0
 Get the logarithm of the likelihood for a site and for a state. More...
 
virtual Vdouble getLikelihoodForEachSite () const =0
 Get the likelihood for each site. More...
 
virtual Vdouble getLogLikelihoodForEachSite () const =0
 Get the logarithm of the likelihood for each site. More...
 
virtual VVdouble getLikelihoodForEachSiteForEachState () const =0
 Get the likelihood for each site and for each state. More...
 
virtual VVdouble getLogLikelihoodForEachSiteForEachState () const =0
 Get the logarithm of the likelihood for each site and for each state. More...
 
virtual double getLikelihood () const =0
 Get the likelihood for the whole dataset. More...
 
virtual double getLogLikelihood () const =0
 Get the logarithm of the likelihood for the whole dataset. More...
 
virtual const TreegetTree () const =0
 Get the tree (topology and branch lengths). More...
 
virtual size_t getNumberOfSites () const =0
 Get the number of sites in the dataset. More...
 
virtual size_t getNumberOfStates () const =0
 
virtual int getAlphabetStateAsInt (size_t i) const =0
 
virtual std::string getAlphabetStateAsChar (size_t i) const =0
 
virtual const std::vector< int > & getAlphabetStates () const =0
 
virtual const Alphabet * getAlphabet () const =0
 Get the alphabet associated to the dataset. More...
 
virtual void enableDerivatives (bool yn)=0
 Tell if derivatives must be computed. More...
 
virtual ParameterList getDerivableParameters () const =0
 All derivable parameters. More...
 
virtual ParameterList getNonDerivableParameters () const =0
 All non derivable parameters. More...
 
Retrieve some particular parameters subsets.
virtual ParameterList getBranchLengthsParameters () const =0
 Get the branch lengths parameters. More...
 
virtual ParameterList getSubstitutionModelParameters () const =0
 Get the parameters associated to substitution model(s). More...
 
virtual const SubstitutionModelgetSubstitutionModel (int nodeId, size_t siteIndex) const =0 throw (NodeNotFoundException)
 Get the substitution model associated to a given node and alignment column. More...
 
virtual SubstitutionModelgetSubstitutionModel (int nodeId, size_t siteIndex)=0 throw (NodeNotFoundException)
 Get the substitution model associated to a given node and alignment column. More...
 
virtual VVdouble getTransitionProbabilities (int nodeId, size_t siteIndex) const =0
 Retrieves all Pij(t) for a particular branch, defined by the upper node and site. More...
 
virtual ConstBranchModelIteratorgetNewBranchModelIterator (int nodeId) const =0
 
virtual ConstSiteModelIteratorgetNewSiteModelIterator (size_t siteIndex) const =0
 
virtual size_t getSiteIndex (size_t site) const =0 throw (IndexOutOfBoundsException)
 Get the index (used for inner computations) of a given site (original alignment column). More...
 
virtual const std::vector< double > & getRootFrequencies (size_t siteIndex) const =0
 Get the values of the frequencies for each state in the alphabet at the root node. More...
 

Detailed Description

Interface for rate across sites (RAS) implementation.

This interface provides methods for dealing with RAS models.

Definition at line 56 of file DiscreteRatesAcrossSitesTreeLikelihood.h.

Constructor & Destructor Documentation

◆ DiscreteRatesAcrossSitesTreeLikelihood()

bpp::DiscreteRatesAcrossSitesTreeLikelihood::DiscreteRatesAcrossSitesTreeLikelihood ( )
inline

Definition at line 60 of file DiscreteRatesAcrossSitesTreeLikelihood.h.

◆ ~DiscreteRatesAcrossSitesTreeLikelihood()

virtual bpp::DiscreteRatesAcrossSitesTreeLikelihood::~DiscreteRatesAcrossSitesTreeLikelihood ( )
inlinevirtual

Definition at line 61 of file DiscreteRatesAcrossSitesTreeLikelihood.h.

Member Function Documentation

◆ clone()

◆ enableDerivatives()

virtual void bpp::TreeLikelihood::enableDerivatives ( bool  yn)
pure virtualinherited

Tell if derivatives must be computed.

This methods calls the enableFirstOrderDerivatives and enableSecondOrderDerivatives.

Parameters
ynYes or no.

Implemented in bpp::AbstractTreeLikelihood.

◆ getAlphabet()

virtual const Alphabet* bpp::TreeLikelihood::getAlphabet ( ) const
pure virtualinherited

Get the alphabet associated to the dataset.

Returns
the alphabet associated to the dataset.

Implemented in bpp::AbstractTreeLikelihood.

◆ getAlphabetStateAsChar()

virtual std::string bpp::TreeLikelihood::getAlphabetStateAsChar ( size_t  i) const
pure virtualinherited
Returns
the alphabet state corresponding to the given model state.

Implemented in bpp::AbstractNonHomogeneousTreeLikelihood, bpp::AbstractHomogeneousTreeLikelihood, and bpp::TwoTreeLikelihood.

◆ getAlphabetStateAsInt()

virtual int bpp::TreeLikelihood::getAlphabetStateAsInt ( size_t  i) const
pure virtualinherited
Returns
the alphabet state corresponding to the given model state.

Implemented in bpp::AbstractNonHomogeneousTreeLikelihood, bpp::AbstractHomogeneousTreeLikelihood, and bpp::TwoTreeLikelihood.

◆ getAlphabetStates()

virtual const std::vector<int>& bpp::TreeLikelihood::getAlphabetStates ( ) const
pure virtualinherited
Returns
the alphabet states corresponding to all model states.

Implemented in bpp::AbstractNonHomogeneousTreeLikelihood, bpp::AbstractHomogeneousTreeLikelihood, and bpp::TwoTreeLikelihood.

◆ getBranchLengthsParameters()

virtual ParameterList bpp::TreeLikelihood::getBranchLengthsParameters ( ) const
pure virtualinherited

Get the branch lengths parameters.

Returns
A ParameterList with all branch lengths.

Implemented in bpp::AbstractNonHomogeneousTreeLikelihood, bpp::AbstractHomogeneousTreeLikelihood, and bpp::TwoTreeLikelihood.

Referenced by bpp::OptimizationTools::ScaleFunction::ScaleFunction().

◆ getData()

virtual const SiteContainer* bpp::TreeLikelihood::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::AbstractTreeLikelihood.

◆ getDerivableParameters()

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

All derivable parameters.

Usually, this contains all branch lengths parameters.

Returns
A ParameterList.

Implemented in bpp::RHomogeneousClockTreeLikelihood, and bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

◆ getLikelihood()

virtual double bpp::TreeLikelihood::getLikelihood ( ) const
pure virtualinherited

◆ getLikelihoodData() [1/2]

virtual TreeLikelihoodData* bpp::TreeLikelihood::getLikelihoodData ( )
pure virtualinherited

◆ getLikelihoodData() [2/2]

virtual const TreeLikelihoodData* bpp::TreeLikelihood::getLikelihoodData ( ) const
pure virtualinherited

◆ getLikelihoodForASite()

virtual double bpp::TreeLikelihood::getLikelihoodForASite ( size_t  site) const
pure virtualinherited

◆ getLikelihoodForASiteForARateClass()

virtual double bpp::DiscreteRatesAcrossSitesTreeLikelihood::getLikelihoodForASiteForARateClass ( size_t  site,
size_t  rateClass 
) const
pure virtual

Get the likelihood for a site knowing its rate class.

Parameters
siteThe site index.
rateClassThe rate class index.
Returns
The likelihood for the specified site and rate class.

Implemented in bpp::RNonHomogeneousTreeLikelihood, bpp::TwoTreeLikelihood, bpp::RHomogeneousTreeLikelihood, bpp::DRNonHomogeneousTreeLikelihood, bpp::DRHomogeneousTreeLikelihood, bpp::DRHomogeneousMixedTreeLikelihood, and bpp::RHomogeneousMixedTreeLikelihood.

◆ getLikelihoodForASiteForARateClassForAState()

virtual double bpp::DiscreteRatesAcrossSitesTreeLikelihood::getLikelihoodForASiteForARateClassForAState ( size_t  site,
size_t  rateClass,
int  state 
) const
pure virtual

Get the likelihood for a site knowing its rate class and its ancestral state.

Parameters
siteThe site index.
rateClassThe rate class index.
stateThe ancestral state.
Returns
The likelihood for the specified site and rate class and ancestral state.

Implemented in bpp::RNonHomogeneousTreeLikelihood, bpp::TwoTreeLikelihood, bpp::RHomogeneousTreeLikelihood, bpp::DRNonHomogeneousTreeLikelihood, bpp::DRHomogeneousTreeLikelihood, bpp::DRHomogeneousMixedTreeLikelihood, and bpp::RHomogeneousMixedTreeLikelihood.

◆ getLikelihoodForASiteForAState()

virtual double bpp::TreeLikelihood::getLikelihoodForASiteForAState ( size_t  site,
int  state 
) const
pure virtualinherited

Get the likelihood for a site and for a state.

Parameters
siteThe site index to analyse.
stateThe state to consider.
Returns
The likelihood for site site and state state.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

Referenced by bpp::AbstractTreeLikelihood::getLikelihoodForEachSiteForEachState().

◆ getLikelihoodForEachSite()

virtual Vdouble bpp::TreeLikelihood::getLikelihoodForEachSite ( ) const
pure virtualinherited

Get the likelihood for each site.

Returns
A vector with all likelihoods for each site.

Implemented in bpp::AbstractTreeLikelihood.

◆ getLikelihoodForEachSiteForEachRateClass()

virtual VVdouble bpp::DiscreteRatesAcrossSitesTreeLikelihood::getLikelihoodForEachSiteForEachRateClass ( ) const
pure virtual

Get the likelihood for each site and each rate class.

Returns
A two-dimension vector with all likelihoods.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

◆ getLikelihoodForEachSiteForEachRateClassForEachState()

virtual VVVdouble bpp::DiscreteRatesAcrossSitesTreeLikelihood::getLikelihoodForEachSiteForEachRateClassForEachState ( ) const
pure virtual

Get the likelihood for each site and each rate class and each state.

Returns
A three-dimension vector with all likelihoods.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

◆ getLikelihoodForEachSiteForEachState()

virtual VVdouble bpp::TreeLikelihood::getLikelihoodForEachSiteForEachState ( ) const
pure virtualinherited

Get the likelihood for each site and for each state.

Returns
A 2d vector with all likelihoods for each site and for each state.

Implemented in bpp::AbstractTreeLikelihood.

◆ getLogLikelihood()

virtual double bpp::TreeLikelihood::getLogLikelihood ( ) const
pure virtualinherited

Get the logarithm of the likelihood for the whole dataset.

Returns
The logarithm of the likelihood of the dataset.

Implemented in bpp::RNonHomogeneousTreeLikelihood, bpp::RHomogeneousTreeLikelihood, bpp::TwoTreeLikelihood, bpp::DRNonHomogeneousTreeLikelihood, bpp::DRHomogeneousTreeLikelihood, and bpp::DRHomogeneousMixedTreeLikelihood.

◆ getLogLikelihoodForASite()

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

Get the logarithm of the likelihood for a site.

Parameters
siteThe site index to analyse.
Returns
The logarithm of the likelihood for site site.

Implemented in bpp::RNonHomogeneousTreeLikelihood, bpp::RHomogeneousTreeLikelihood, bpp::TwoTreeLikelihood, bpp::DRNonHomogeneousTreeLikelihood, bpp::DRHomogeneousTreeLikelihood, and bpp::DRHomogeneousMixedTreeLikelihood.

Referenced by bpp::AbstractTreeLikelihood::getLogLikelihoodForEachSite().

◆ getLogLikelihoodForASiteForARateClass()

virtual double bpp::DiscreteRatesAcrossSitesTreeLikelihood::getLogLikelihoodForASiteForARateClass ( size_t  site,
size_t  rateClass 
) const
pure virtual

Get the logarithm of the likelihood for a site knowing its rate class.

Parameters
siteThe site index.
rateClassThe rate class index.
Returns
The logarithm of the likelihood for the specified site and rate class.

Implemented in bpp::RNonHomogeneousTreeLikelihood, bpp::TwoTreeLikelihood, bpp::RHomogeneousTreeLikelihood, bpp::DRNonHomogeneousTreeLikelihood, bpp::DRHomogeneousTreeLikelihood, bpp::DRHomogeneousMixedTreeLikelihood, and bpp::RHomogeneousMixedTreeLikelihood.

◆ getLogLikelihoodForASiteForARateClassForAState()

virtual double bpp::DiscreteRatesAcrossSitesTreeLikelihood::getLogLikelihoodForASiteForARateClassForAState ( size_t  site,
size_t  rateClass,
int  state 
) const
pure virtual

Get the logarithm of the likelihood for a site knowing its rate class and its ancestral state.

Parameters
siteThe site index.
rateClassThe rate class index.
stateThe ancestral state.
Returns
The logarithm of the likelihood for the specified site and rate class and ancestral state..

Implemented in bpp::RNonHomogeneousTreeLikelihood, bpp::TwoTreeLikelihood, bpp::RHomogeneousTreeLikelihood, bpp::DRNonHomogeneousTreeLikelihood, bpp::DRHomogeneousTreeLikelihood, bpp::DRHomogeneousMixedTreeLikelihood, and bpp::RHomogeneousMixedTreeLikelihood.

◆ getLogLikelihoodForASiteForAState()

virtual double bpp::TreeLikelihood::getLogLikelihoodForASiteForAState ( size_t  site,
int  state 
) const
pure virtualinherited

Get the logarithm of the likelihood for a site and for a state.

Parameters
siteThe site index to analyse.
stateThe state to consider.
Returns
The logarithm of the likelihood for site site and state state.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

Referenced by bpp::AbstractTreeLikelihood::getLogLikelihoodForEachSiteForEachState().

◆ getLogLikelihoodForEachSite()

virtual Vdouble bpp::TreeLikelihood::getLogLikelihoodForEachSite ( ) const
pure virtualinherited

Get the logarithm of the likelihood for each site.

Returns
A vector with all log likelihoods for each site.

Implemented in bpp::AbstractTreeLikelihood.

◆ getLogLikelihoodForEachSiteForEachRateClass()

virtual VVdouble bpp::DiscreteRatesAcrossSitesTreeLikelihood::getLogLikelihoodForEachSiteForEachRateClass ( ) const
pure virtual

Get the logarithm of the likelihood for each site and each rate class.

Returns
A two-dimension vector with all log likelihoods: V[i][j] = likelihood of site i and rate class j.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

◆ getLogLikelihoodForEachSiteForEachRateClassForEachState()

virtual VVVdouble bpp::DiscreteRatesAcrossSitesTreeLikelihood::getLogLikelihoodForEachSiteForEachRateClassForEachState ( ) const
pure virtual

Get the logarithm of the likelihood for each site and each rate class and each state.

Returns
A three-dimension vector with all log likelihoods: V[i][j][k} = likelihood of site i and rate class j and state k.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

◆ getLogLikelihoodForEachSiteForEachState()

virtual VVdouble bpp::TreeLikelihood::getLogLikelihoodForEachSiteForEachState ( ) const
pure virtualinherited

Get the logarithm of the likelihood for each site and for each state.

Returns
A 2d vector with all log likelihoods for each site and for each state.

Implemented in bpp::AbstractTreeLikelihood.

◆ getNewBranchModelIterator()

virtual ConstBranchModelIterator* bpp::TreeLikelihood::getNewBranchModelIterator ( int  nodeId) const
pure virtualinherited

◆ getNewSiteModelIterator()

virtual ConstSiteModelIterator* bpp::TreeLikelihood::getNewSiteModelIterator ( size_t  siteIndex) const
pure virtualinherited

◆ getNonDerivableParameters()

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

All non derivable parameters.

Usually, this contains all substitution model parameters and rate distribution.

Returns
A ParameterList.

Implemented in bpp::RHomogeneousClockTreeLikelihood, and bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

◆ getNumberOfClasses()

virtual size_t bpp::DiscreteRatesAcrossSitesTreeLikelihood::getNumberOfClasses ( ) const
pure virtual

◆ getNumberOfSites()

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

Get the number of sites in the dataset.

Returns
the number of sites in the dataset.

Implemented in bpp::AbstractTreeLikelihood.

Referenced by bpp::SubstitutionMappingTools::getNormalizationsPerBranch().

◆ getNumberOfStates()

◆ getPosteriorProbabilitiesOfEachRate()

virtual VVdouble bpp::DiscreteRatesAcrossSitesTreeLikelihood::getPosteriorProbabilitiesOfEachRate ( ) const
pure virtual

Get the posterior probability for each site of belonging to a particular rate class.

Returns
A two-dimension vector with all posterior probabilities: V[i][j] = probablity for site i of belonging to rate class j.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

◆ getPosteriorRateOfEachSite()

virtual Vdouble bpp::DiscreteRatesAcrossSitesTreeLikelihood::getPosteriorRateOfEachSite ( ) const
pure virtual

Get the posterior rate, i.e. averaged over all classes and weighted with posterior probabilities, for each site.

Returns
A vector with all rates.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

◆ getRateClassWithMaxPostProbOfEachSite()

virtual std::vector<size_t> bpp::DiscreteRatesAcrossSitesTreeLikelihood::getRateClassWithMaxPostProbOfEachSite ( ) const
pure virtual

Get the posterior rate class (the one with maximum posterior probability) for each site.

Returns
A vector with all rate classes indexes.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

Referenced by bpp::RASTools::getPosteriorRateDistribution().

◆ getRateDistribution() [1/2]

virtual const DiscreteDistribution* bpp::DiscreteRatesAcrossSitesTreeLikelihood::getRateDistribution ( ) const
pure virtual

Get the rate distribution used for the computation.

Returns
A const pointer toward the rate distribution of this instance.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

Referenced by bpp::DRTreeLikelihoodTools::getPosteriorProbabilitiesForEachStateForEachRate(), and bpp::RASTools::getPosteriorRateDistribution().

◆ getRateDistribution() [2/2]

virtual DiscreteDistribution* bpp::DiscreteRatesAcrossSitesTreeLikelihood::getRateDistribution ( )
pure virtual

Get the rate distribution used for the computation.

Returns
A pointer toward the rate distribution of this instance.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

◆ getRateDistributionParameters()

virtual ParameterList bpp::DiscreteRatesAcrossSitesTreeLikelihood::getRateDistributionParameters ( ) const
pure virtual

Get the parameters associated to the rate distirbution.

Returns
A ParameterList object with all rate distribution parameters.

Implemented in bpp::AbstractNonHomogeneousTreeLikelihood, bpp::AbstractHomogeneousTreeLikelihood, and bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

◆ getRateWithMaxPostProbOfEachSite()

virtual Vdouble bpp::DiscreteRatesAcrossSitesTreeLikelihood::getRateWithMaxPostProbOfEachSite ( ) const
pure virtual

Get the posterior rate (the one with maximum posterior probability) for each site.

Returns
A vector with all rate classes indexes.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

◆ getRootFrequencies()

virtual const std::vector<double>& bpp::TreeLikelihood::getRootFrequencies ( size_t  siteIndex) const
pure virtualinherited

Get the values of the frequencies for each state in the alphabet at the root node.

For reversible models, these are the equilibrium frequencies. For non-reversible models, these usually are distinct parameters.

For models without site partitioning, the set of frequencies is the same for all positions. For partition models, the frequencies may differ from one site to another.

Parameters
siteIndexThe index of the alignment position.
See also
getSiteIndex
Returns
A vector with ancestral frequencies for each state in the alphabet;

Implemented in bpp::AbstractNonHomogeneousTreeLikelihood, bpp::AbstractHomogeneousTreeLikelihood, and bpp::TwoTreeLikelihood.

◆ getSiteIndex()

virtual size_t bpp::TreeLikelihood::getSiteIndex ( size_t  site) const
throw (IndexOutOfBoundsException
)
pure virtualinherited

Get the index (used for inner computations) of a given site (original alignment column).

Parameters
siteAn alignment position.
Returns
The site index corresponding to the given input alignment position.

Implemented in bpp::RHomogeneousTreeLikelihood, bpp::RNonHomogeneousTreeLikelihood, bpp::TwoTreeLikelihood, bpp::DRNonHomogeneousTreeLikelihood, and bpp::DRHomogeneousTreeLikelihood.

◆ getSubstitutionModel() [1/2]

virtual const SubstitutionModel* bpp::TreeLikelihood::getSubstitutionModel ( int  nodeId,
size_t  siteIndex 
) const
throw (NodeNotFoundException
)
pure virtualinherited

Get the substitution model associated to a given node and alignment column.

Parameters
nodeIdThe id of the request node.
siteIndexThe index of the alignment position.
See also
getSiteIndex
Returns
A pointer toward the corresponding model.
Exceptions
NodeNotFoundExceptionThis exception may be thrown if the node is not found (depending on the implementation).

Implemented in bpp::AbstractHomogeneousTreeLikelihood, bpp::TwoTreeLikelihood, bpp::NonHomogeneousTreeLikelihood, bpp::HomogeneousTreeLikelihood, and bpp::SitePartitionHomogeneousTreeLikelihood.

◆ getSubstitutionModel() [2/2]

virtual SubstitutionModel* bpp::TreeLikelihood::getSubstitutionModel ( int  nodeId,
size_t  siteIndex 
)
throw (NodeNotFoundException
)
pure virtualinherited

Get the substitution model associated to a given node and alignment column.

Parameters
nodeIdThe id of the request node.
siteIndexThe index of the alignment position.
See also
getSiteIndex
Returns
A pointer toward the corresponding model.
Exceptions
NodeNotFoundExceptionThis exception may be thrown if the node is not found (depending on the implementation).

Implemented in bpp::AbstractHomogeneousTreeLikelihood, bpp::TwoTreeLikelihood, bpp::NonHomogeneousTreeLikelihood, bpp::HomogeneousTreeLikelihood, and bpp::SitePartitionHomogeneousTreeLikelihood.

◆ getSubstitutionModelParameters()

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

Get the parameters associated to substitution model(s).

Returns
A ParameterList.

Implemented in bpp::AbstractNonHomogeneousTreeLikelihood, bpp::AbstractHomogeneousTreeLikelihood, and bpp::TwoTreeLikelihood.

◆ getTransitionProbabilities()

virtual VVdouble bpp::TreeLikelihood::getTransitionProbabilities ( int  nodeId,
size_t  siteIndex 
) const
pure virtualinherited

Retrieves all Pij(t) for a particular branch, defined by the upper node and site.

These intermediate results may be used by other methods.

Parameters
nodeIdThe node defining the branch of interest.
siteIndexThe index of the alignment position.
See also
getSiteIndex
Returns
An array of dimension 2, where a[x][y] is the probability of substituting from x to y.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

◆ getTransitionProbabilitiesPerRateClass()

virtual VVVdouble bpp::DiscreteRatesAcrossSitesTreeLikelihood::getTransitionProbabilitiesPerRateClass ( int  nodeId,
size_t  siteIndex 
) const
pure virtual

Retrieves all Pij(t) for a particular branch, defined by the upper node.

These intermediate results may be used by other methods.

Parameters
nodeIdThe node defining the branch of interest.
siteIndexThe position in the alignment.
Returns
An array of dimension 3, where a[c][x][y] is the probability of substituting from x to y while being in rate class c.

Implemented in bpp::AbstractNonHomogeneousTreeLikelihood, bpp::AbstractHomogeneousTreeLikelihood, and bpp::TwoTreeLikelihood.

◆ getTree()

◆ initialize()

virtual void bpp::TreeLikelihood::initialize ( )
throw (Exception
)
pure virtualinherited

Init the likelihood object.

This method is used to initialize all parameters. It is typically called after the constructor and the setData method. It contains virtual methods that can't be called in the constructor.

Exceptions
Exceptionif something bad happened, for instance if no data are associated to the likelihood function.

Implemented in bpp::AbstractTreeLikelihood, bpp::RNonHomogeneousMixedTreeLikelihood, bpp::AbstractNonHomogeneousTreeLikelihood, bpp::DRHomogeneousMixedTreeLikelihood, bpp::AbstractHomogeneousTreeLikelihood, bpp::TwoTreeLikelihood, and bpp::RHomogeneousMixedTreeLikelihood.

◆ isInitialized()

virtual bool bpp::TreeLikelihood::isInitialized ( ) const
pure virtualinherited
Returns
'true' is the likelihood function has been initialized.

Implemented in bpp::AbstractTreeLikelihood.

◆ setData()

virtual void bpp::TreeLikelihood::setData ( const SiteContainer &  sites)
pure virtualinherited

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