bpp-phyl  2.4.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 DiscreteDistributiongetRateDistribution () const =0
 Get the rate distribution used for the computation. More...
 
virtual DiscreteDistributiongetRateDistribution ()=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 SiteContainergetData () const =0
 Get the dataset for which the likelihood must be evaluated. More...
 
virtual void initialize ()=0
 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 AlphabetgetAlphabet () 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...
 
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 ParametergetParameter (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 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
 
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 TransitionModelgetModelForSite (int nodeId, size_t siteIndex) const =0
 Get the substitution model associated to a given node and alignment column. More...
 
virtual TransitionModelgetModelForSite (int nodeId, size_t siteIndex)=0
 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
 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

bpp::DiscreteRatesAcrossSitesTreeLikelihood::DiscreteRatesAcrossSitesTreeLikelihood ( )
inline

Definition at line 60 of file DiscreteRatesAcrossSitesTreeLikelihood.h.

Member Function Documentation

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.

Referenced by bpp::TreeLikelihood::~TreeLikelihood().

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.

Referenced by bpp::TreeLikelihood::~TreeLikelihood().

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.

Referenced by bpp::TreeLikelihood::~TreeLikelihood().

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.

Referenced by bpp::TreeLikelihood::~TreeLikelihood().

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.

Referenced by bpp::TreeLikelihood::~TreeLikelihood().

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.

Referenced by bpp::TreeLikelihood::~TreeLikelihood().

virtual double bpp::TreeLikelihood::getLikelihood ( ) const
pure virtualinherited
virtual const TreeLikelihoodData* bpp::TreeLikelihood::getLikelihoodData ( ) const
pure virtualinherited
virtual double bpp::TreeLikelihood::getLikelihoodForASite ( size_t  site) const
pure virtualinherited
virtual double bpp::DiscreteRatesAcrossSitesTreeLikelihood::getLikelihoodForASiteForARateClass ( size_t  site,
size_t  rateClass 
) const
pure virtual
virtual double bpp::DiscreteRatesAcrossSitesTreeLikelihood::getLikelihoodForASiteForARateClassForAState ( size_t  site,
size_t  rateClass,
int  state 
) const
pure virtual
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(), and bpp::TreeLikelihood::~TreeLikelihood().

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.

Referenced by bpp::TreeLikelihood::~TreeLikelihood().

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.

Referenced by ~DiscreteRatesAcrossSitesTreeLikelihood().

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.

Referenced by ~DiscreteRatesAcrossSitesTreeLikelihood().

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.

Referenced by bpp::TreeLikelihood::~TreeLikelihood().

virtual double bpp::TreeLikelihood::getLogLikelihood ( ) const
pure virtualinherited
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(), and bpp::TreeLikelihood::~TreeLikelihood().

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::TwoTreeLikelihood, bpp::RNonHomogeneousTreeLikelihood, bpp::RHomogeneousTreeLikelihood, bpp::DRNonHomogeneousTreeLikelihood, bpp::DRHomogeneousTreeLikelihood, bpp::DRHomogeneousMixedTreeLikelihood, and bpp::RHomogeneousMixedTreeLikelihood.

Referenced by bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::getLogLikelihoodForEachSiteForEachRateClass(), and ~DiscreteRatesAcrossSitesTreeLikelihood().

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::TwoTreeLikelihood, bpp::RNonHomogeneousTreeLikelihood, bpp::RHomogeneousTreeLikelihood, bpp::DRNonHomogeneousTreeLikelihood, bpp::DRHomogeneousTreeLikelihood, bpp::DRHomogeneousMixedTreeLikelihood, and bpp::RHomogeneousMixedTreeLikelihood.

Referenced by bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::getLogLikelihoodForEachSiteForEachRateClassForEachState(), and ~DiscreteRatesAcrossSitesTreeLikelihood().

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(), and bpp::TreeLikelihood::~TreeLikelihood().

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.

Referenced by bpp::PairedSiteLikelihoods::appendModel(), and bpp::TreeLikelihood::~TreeLikelihood().

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.

Referenced by ~DiscreteRatesAcrossSitesTreeLikelihood().

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.

Referenced by ~DiscreteRatesAcrossSitesTreeLikelihood().

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.

Referenced by bpp::TreeLikelihood::~TreeLikelihood().

virtual const TransitionModel* bpp::TreeLikelihood::getModelForSite ( int  nodeId,
size_t  siteIndex 
) const
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.

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

Referenced by bpp::TreeLikelihood::~TreeLikelihood().

virtual TransitionModel* bpp::TreeLikelihood::getModelForSite ( int  nodeId,
size_t  siteIndex 
)
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::TwoTreeLikelihood, bpp::NonHomogeneousTreeLikelihood, and bpp::HomogeneousTreeLikelihood.

virtual ConstSiteModelIterator* bpp::TreeLikelihood::getNewSiteModelIterator ( size_t  siteIndex) const
pure virtualinherited
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.

Referenced by bpp::OptimizationTools::optimizeNumericalParameters2(), and bpp::TreeLikelihood::~TreeLikelihood().

virtual size_t bpp::DiscreteRatesAcrossSitesTreeLikelihood::getNumberOfClasses ( ) const
pure virtual
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(), and bpp::TreeLikelihood::~TreeLikelihood().

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.

Referenced by ~DiscreteRatesAcrossSitesTreeLikelihood().

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.

Referenced by ~DiscreteRatesAcrossSitesTreeLikelihood().

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(), and ~DiscreteRatesAcrossSitesTreeLikelihood().

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.

virtual ParameterList bpp::DiscreteRatesAcrossSitesTreeLikelihood::getRateDistributionParameters ( ) const
pure virtual
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.

Referenced by ~DiscreteRatesAcrossSitesTreeLikelihood().

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.

Referenced by bpp::RewardMappingTools::computeRewardVectors(), bpp::SubstitutionMappingTools::computeSubstitutionVectors(), bpp::SubstitutionMappingTools::computeSubstitutionVectorsNoAveraging(), bpp::TreeLikelihoodTools::getAncestralFrequencies(), and bpp::TreeLikelihood::~TreeLikelihood().

virtual size_t bpp::TreeLikelihood::getSiteIndex ( size_t  site) const
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::TwoTreeLikelihood, bpp::RNonHomogeneousTreeLikelihood, bpp::DRNonHomogeneousTreeLikelihood, and bpp::DRHomogeneousTreeLikelihood.

Referenced by bpp::TreeLikelihoodTools::getAncestralFrequencies(), and bpp::TreeLikelihood::~TreeLikelihood().

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.

Referenced by bpp::TreeLikelihoodTools::getAncestralFrequencies_(), and bpp::TreeLikelihood::~TreeLikelihood().

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.

Referenced by bpp::RewardMappingTools::computeRewardVectors(), bpp::SubstitutionMappingTools::computeSubstitutionVectors(), bpp::SubstitutionMappingTools::computeSubstitutionVectorsNoAveraging(), bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::getTransitionProbabilities(), and ~DiscreteRatesAcrossSitesTreeLikelihood().

virtual void bpp::TreeLikelihood::initialize ( )
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::TwoTreeLikelihood, bpp::AbstractHomogeneousTreeLikelihood, and bpp::RHomogeneousMixedTreeLikelihood.

Referenced by bpp::TreeLikelihood::~TreeLikelihood().


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