bpp-phyl  2.2.0
bpp::AbstractNonHomogeneousTreeLikelihood Class Referenceabstract

Partial implementation for branch non-homogeneous models of the TreeLikelihood interface. More...

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

+ Inheritance diagram for bpp::AbstractNonHomogeneousTreeLikelihood:
+ Collaboration diagram for bpp::AbstractNonHomogeneousTreeLikelihood:

Classes

class  ConstNonHomogeneousSiteModelIterator
 

Public Member Functions

 AbstractNonHomogeneousTreeLikelihood (const Tree &tree, SubstitutionModelSet *modelSet, DiscreteDistribution *rDist, bool verbose=true, bool reparametrizeRoot=true) throw (Exception)
 
 AbstractNonHomogeneousTreeLikelihood (const AbstractNonHomogeneousTreeLikelihood &lik)
 Copy constructor. More...
 
AbstractNonHomogeneousTreeLikelihoodoperator= (const AbstractNonHomogeneousTreeLikelihood &lik)
 Assignation operator. More...
 
virtual ~AbstractNonHomogeneousTreeLikelihood ()
 
virtual void initParameters ()
 This builds the parameters list from all parametrizable objects, i.e. substitution model, rate distribution and tree. More...
 
virtual void applyParameters () throw (Exception)
 All parameters are stored in a parameter list. This function apply these parameters to the substitution model, to the rate distribution and to the branch lengths. More...
 
virtual void initBranchLengthsParameters ()
 
virtual void setMinimumBranchLength (double minimum) throw (Exception)
 
virtual void setMaximumBranchLength (double maximum) throw (Exception)
 
virtual double getMinimumBranchLength () const
 
virtual double getMaximumBranchLength () const
 
NonHomogeneousTreeLikelihoodclone () const =0
 
const SubstitutionModelgetSubstitutionModel (int nodeId, size_t siteIndex) const throw (NodeNotFoundException)
 Get the substitution model associated to a given node and alignment column. More...
 
SubstitutionModelgetSubstitutionModel (int nodeId, size_t siteIndex) throw (NodeNotFoundException)
 Get the substitution model associated to a given node and alignment column. More...
 
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 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 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...
 
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...
 
The TreeLikelihood interface.

Other methods are implemented in the AbstractTreeLikelihood class.

size_t getNumberOfStates () const
 
const std::vector< int > & getAlphabetStates () const
 
int getAlphabetStateAsInt (size_t i) const
 
std::string getAlphabetStateAsChar (size_t i) const
 
void initialize () throw (Exception)
 Init the likelihood object. More...
 
ParameterList getBranchLengthsParameters () const
 Get the branch lengths parameters. More...
 
ParameterList getSubstitutionModelParameters () const
 Get the parameters associated to substitution model(s). More...
 
ParameterList getRateDistributionParameters () const
 Get the parameters associated to the rate distirbution. More...
 
const SubstitutionModelgetSubstitutionModelForNode (int nodeId) const throw (NodeNotFoundException)
 Get the substitution model associated to a given node. More...
 
SubstitutionModelgetSubstitutionModelForNode (int nodeId) throw (NodeNotFoundException)
 Get the substitution model associated to a given node. More...
 
const std::vector< double > & getRootFrequencies (size_t siteIndex) const
 Get the values of the frequencies for each state in the alphabet at the root node. More...
 
VVVdouble getTransitionProbabilitiesPerRateClass (int nodeId, size_t siteIndex) const
 Retrieves all Pij(t) for a particular branch, defined by the upper node. More...
 
ConstBranchModelIteratorgetNewBranchModelIterator (int nodeId) const
 
ConstSiteModelIteratorgetNewSiteModelIterator (size_t siteIndex) const
 
The NonHomogeneousTreeLikelihood interface.

Other methods are implemented in the AbstractTreeLikelihood class.

const SubstitutionModelSetgetSubstitutionModelSet () const
 
SubstitutionModelSetgetSubstitutionModelSet ()
 
void setSubstitutionModelSet (SubstitutionModelSet *modelSet) throw (Exception)
 
ParameterList getRootFrequenciesParameters () const
 
Retrieve some particular parameters subsets.
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 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...
 
The TreeLikelihood interface.

Other methods are implemented in the AbstractTreeLikelihood class.

double getLikelihoodForASiteForAState (size_t site, int state) const
 Get the likelihood for a site and for a state. More...
 
double getLogLikelihoodForASiteForAState (size_t site, int state) const
 Get the logarithm of the likelihood for a site and for a state. More...
 
ParameterList getDerivableParameters () const
 All derivable parameters. More...
 
ParameterList getNonDerivableParameters () const
 All non derivable parameters. More...
 
VVdouble getTransitionProbabilities (int nodeId, size_t siteIndex) const
 Retrieves all Pij(t) for a particular branch, defined by the upper node and site. More...
 
The DiscreteRatesAcrossSites interface implementation:
const DiscreteDistribution * getRateDistribution () const
 Get the rate distribution used for the computation. More...
 
DiscreteDistribution * getRateDistribution ()
 Get the rate distribution used for the computation. More...
 
size_t getNumberOfClasses () const
 Get the number of classes. More...
 
VVdouble getLikelihoodForEachSiteForEachRateClass () const
 Get the likelihood for each site and each rate class. More...
 
VVdouble getLogLikelihoodForEachSiteForEachRateClass () const
 Get the logarithm of the likelihood for each site and each rate class. More...
 
VVVdouble getLikelihoodForEachSiteForEachRateClassForEachState () const
 Get the likelihood for each site and each rate class and each state. More...
 
VVVdouble getLogLikelihoodForEachSiteForEachRateClassForEachState () const
 Get the logarithm of the likelihood for each site and each rate class and each state. More...
 
VVdouble getPosteriorProbabilitiesOfEachRate () const
 Get the posterior probability for each site of belonging to a particular rate class. More...
 
Vdouble getRateWithMaxPostProbOfEachSite () const
 Get the posterior rate (the one with maximum posterior probability) for each site. More...
 
std::vector< size_t > getRateClassWithMaxPostProbOfEachSite () const
 Get the posterior rate class (the one with maximum posterior probability) for each site. More...
 
Vdouble getPosteriorRateOfEachSite () const
 Get the posterior rate, i.e. averaged over all classes and weighted with posterior probabilities, for each site. More...
 
The TreeLikelihood interface.
const SiteContainer * getData () const
 Get the dataset for which the likelihood must be evaluated. More...
 
const Alphabet * getAlphabet () const
 Get the alphabet associated to the dataset. More...
 
Vdouble getLikelihoodForEachSite () const
 Get the likelihood for each site. More...
 
Vdouble getLogLikelihoodForEachSite () const
 Get the logarithm of the likelihood for each site. More...
 
VVdouble getLikelihoodForEachSiteForEachState () const
 Get the likelihood for each site and for each state. More...
 
VVdouble getLogLikelihoodForEachSiteForEachState () const
 Get the logarithm of the likelihood for each site and for each state. More...
 
size_t getNumberOfSites () const
 Get the number of sites in the dataset. More...
 
const TreegetTree () const
 Get the tree (topology and branch lengths). More...
 
void enableDerivatives (bool yn)
 Tell if derivatives must be computed. More...
 
void enableFirstOrderDerivatives (bool yn)
 
bool enableFirstOrderDerivatives () const
 
void enableSecondOrderDerivatives (bool yn)
 
bool enableSecondOrderDerivatives () const
 
bool isInitialized () const
 

Static Public Member Functions

Generic tools to deal with likelihood arrays
static void resetLikelihoodArray (VVVdouble &likelihoodArray)
 Set all conditional likelihoods to 1. More...
 
static void displayLikelihoodArray (const VVVdouble &likelihoodArray)
 Print the likelihood array to terminal (debugging tool). More...
 

Protected Member Functions

virtual void computeAllTransitionProbabilities ()
 Fill the pxy_, dpxy_ and d2pxy_ arrays for all nodes. More...
 
virtual void computeTransitionProbabilitiesForNode (const Node *node)
 Fill the pxy_, dpxy_ and d2pxy_ arrays for one node. More...
 

Protected Attributes

SubstitutionModelSetmodelSet_
 
ParameterList brLenParameters_
 
std::map< int, VVVdouble > pxy_
 
std::map< int, VVVdouble > dpxy_
 
std::map< int, VVVdouble > d2pxy_
 
std::vector< double > rootFreqs_
 
std::vector< Node * > nodes_
 Pointer toward all nodes in the tree. More...
 
std::map< int, const Node * > idToNode_
 An index linking nodes to their id, for faster access than the getNode() method. More...
 
size_t nbSites_
 
size_t nbDistinctSites_
 
size_t nbClasses_
 
size_t nbStates_
 
size_t nbNodes_
 
bool verbose_
 
double minimumBrLen_
 
double maximumBrLen_
 
std::auto_ptr< Constraint > brLenConstraint_
 
bool reparametrizeRoot_
 
int root1_
 
int root2_
 
DiscreteDistribution * rateDistribution_
 
const SiteContainer * data_
 
TreeTemplate< Node > * tree_
 
bool computeFirstOrderDerivatives_
 
bool computeSecondOrderDerivatives_
 
bool initialized_
 

Private Member Functions

void init_ (const Tree &tree, SubstitutionModelSet *modelSet, DiscreteDistribution *rDist, bool verbose) throw (Exception)
 Method called by constructor. More...
 

Detailed Description

Partial implementation for branch non-homogeneous models of the TreeLikelihood interface.

This class provides a pointer toward a single substitution model + several utilitary variables.

Definition at line 58 of file AbstractNonHomogeneousTreeLikelihood.h.

Constructor & Destructor Documentation

◆ AbstractNonHomogeneousTreeLikelihood() [1/2]

AbstractNonHomogeneousTreeLikelihood::AbstractNonHomogeneousTreeLikelihood ( const Tree tree,
SubstitutionModelSet modelSet,
DiscreteDistribution *  rDist,
bool  verbose = true,
bool  reparametrizeRoot = true 
)
throw (Exception
)

Definition at line 58 of file AbstractNonHomogeneousTreeLikelihood.cpp.

◆ AbstractNonHomogeneousTreeLikelihood() [2/2]

AbstractNonHomogeneousTreeLikelihood::AbstractNonHomogeneousTreeLikelihood ( const AbstractNonHomogeneousTreeLikelihood lik)

Copy constructor.

This constructor is to be called by the derived class copy constructor.

Definition at line 92 of file AbstractNonHomogeneousTreeLikelihood.cpp.

References bpp::Node::getId(), idToNode_, nodes_, and bpp::AbstractTreeLikelihood::tree_.

◆ ~AbstractNonHomogeneousTreeLikelihood()

virtual bpp::AbstractNonHomogeneousTreeLikelihood::~AbstractNonHomogeneousTreeLikelihood ( )
inlinevirtual

Definition at line 155 of file AbstractNonHomogeneousTreeLikelihood.h.

Member Function Documentation

◆ applyParameters()

void AbstractNonHomogeneousTreeLikelihood::applyParameters ( )
throw (Exception
)
virtual

◆ clone()

NonHomogeneousTreeLikelihood* bpp::NonHomogeneousTreeLikelihood::clone ( ) const
pure virtualinherited

◆ computeAllTransitionProbabilities()

void AbstractNonHomogeneousTreeLikelihood::computeAllTransitionProbabilities ( )
protectedvirtual

◆ computeTransitionProbabilitiesForNode()

◆ displayLikelihoodArray()

void AbstractDiscreteRatesAcrossSitesTreeLikelihood::displayLikelihoodArray ( const VVVdouble &  likelihoodArray)
staticinherited

◆ enableDerivatives() [1/2]

void bpp::AbstractTreeLikelihood::enableDerivatives ( bool  yn)
inlinevirtualinherited

Tell if derivatives must be computed.

This methods calls the enableFirstOrderDerivatives and enableSecondOrderDerivatives.

Parameters
ynYes or no.

Implements bpp::TreeLikelihood.

Definition at line 292 of file AbstractTreeLikelihood.h.

References bpp::AbstractTreeLikelihood::computeFirstOrderDerivatives_, and bpp::AbstractTreeLikelihood::computeSecondOrderDerivatives_.

Referenced by bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::AbstractDiscreteRatesAcrossSitesTreeLikelihood(), and bpp::DistanceEstimation::computeMatrix().

◆ enableDerivatives() [2/2]

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.

◆ enableFirstOrderDerivatives() [1/2]

void bpp::AbstractTreeLikelihood::enableFirstOrderDerivatives ( bool  yn)
inlineinherited

◆ enableFirstOrderDerivatives() [2/2]

bool bpp::AbstractTreeLikelihood::enableFirstOrderDerivatives ( ) const
inlineinherited

◆ enableSecondOrderDerivatives() [1/2]

void bpp::AbstractTreeLikelihood::enableSecondOrderDerivatives ( bool  yn)
inlineinherited

◆ enableSecondOrderDerivatives() [2/2]

bool bpp::AbstractTreeLikelihood::enableSecondOrderDerivatives ( ) const
inlineinherited

◆ getAlphabet() [1/2]

const Alphabet* bpp::AbstractTreeLikelihood::getAlphabet ( ) const
inlinevirtualinherited

Get the alphabet associated to the dataset.

Returns
the alphabet associated to the dataset.

Implements bpp::TreeLikelihood.

Definition at line 285 of file AbstractTreeLikelihood.h.

References bpp::AbstractTreeLikelihood::data_.

◆ getAlphabet() [2/2]

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()

std::string bpp::AbstractNonHomogeneousTreeLikelihood::getAlphabetStateAsChar ( size_t  i) const
inlinevirtual
Returns
the alphabet state corresponding to the given model state.

Implements bpp::TreeLikelihood.

Definition at line 183 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::SubstitutionModelSet::getAlphabetStateAsChar(), and modelSet_.

◆ getAlphabetStateAsInt()

int bpp::AbstractNonHomogeneousTreeLikelihood::getAlphabetStateAsInt ( size_t  i) const
inlinevirtual
Returns
the alphabet state corresponding to the given model state.

Implements bpp::TreeLikelihood.

Definition at line 181 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::SubstitutionModelSet::getAlphabetStateAsInt(), and modelSet_.

◆ getAlphabetStates()

const std::vector<int>& bpp::AbstractNonHomogeneousTreeLikelihood::getAlphabetStates ( ) const
inlinevirtual
Returns
the alphabet states corresponding to all model states.

Implements bpp::TreeLikelihood.

Definition at line 179 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::SubstitutionModelSet::getAlphabetStates(), and modelSet_.

◆ getBranchLengthsParameters()

ParameterList AbstractNonHomogeneousTreeLikelihood::getBranchLengthsParameters ( ) const
virtual

Get the branch lengths parameters.

Returns
A ParameterList with all branch lengths.

Implements bpp::TreeLikelihood.

Definition at line 280 of file AbstractNonHomogeneousTreeLikelihood.cpp.

References brLenParameters_, and bpp::AbstractTreeLikelihood::initialized_.

◆ getData() [1/2]

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.

◆ getData() [2/2]

const SiteContainer* bpp::AbstractTreeLikelihood::getData ( ) const
inlinevirtualinherited

Get the dataset for which the likelihood must be evaluated.

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

Implements bpp::TreeLikelihood.

Definition at line 284 of file AbstractTreeLikelihood.h.

References bpp::AbstractTreeLikelihood::data_.

Referenced by bpp::RNonHomogeneousMixedTreeLikelihood::init().

◆ getDerivableParameters() [1/2]

ParameterList AbstractDiscreteRatesAcrossSitesTreeLikelihood::getDerivableParameters ( ) const
virtualinherited

All derivable parameters.

Usually, this contains all branch lengths parameters.

Returns
A ParameterList.

Implements bpp::TreeLikelihood.

Reimplemented in bpp::RHomogeneousClockTreeLikelihood.

Definition at line 73 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

◆ getDerivableParameters() [2/2]

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 virtualinherited

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 virtualinherited

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() [1/2]

double AbstractDiscreteRatesAcrossSitesTreeLikelihood::getLikelihoodForASiteForAState ( size_t  site,
int  state 
) const
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.

Implements bpp::TreeLikelihood.

Definition at line 111 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

◆ getLikelihoodForASiteForAState() [2/2]

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() [1/2]

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.

◆ getLikelihoodForEachSite() [2/2]

Vdouble AbstractTreeLikelihood::getLikelihoodForEachSite ( ) const
virtualinherited

Get the likelihood for each site.

Returns
A vector with all likelihoods for each site.

Implements bpp::TreeLikelihood.

Definition at line 46 of file AbstractTreeLikelihood.cpp.

References bpp::TreeLikelihood::getLikelihoodForASite(), and bpp::AbstractTreeLikelihood::getNumberOfSites().

◆ getLikelihoodForEachSiteForEachRateClass()

VVdouble AbstractDiscreteRatesAcrossSitesTreeLikelihood::getLikelihoodForEachSiteForEachRateClass ( ) const
virtualinherited

Get the likelihood for each site and each rate class.

Returns
A two-dimension vector with all likelihoods.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 93 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

◆ getLikelihoodForEachSiteForEachRateClassForEachState()

VVVdouble AbstractDiscreteRatesAcrossSitesTreeLikelihood::getLikelihoodForEachSiteForEachRateClassForEachState ( ) const
virtualinherited

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

Returns
A three-dimension vector with all likelihoods.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 156 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

◆ getLikelihoodForEachSiteForEachState() [1/2]

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.

◆ getLikelihoodForEachSiteForEachState() [2/2]

VVdouble AbstractTreeLikelihood::getLikelihoodForEachSiteForEachState ( ) const
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.

Implements bpp::TreeLikelihood.

Definition at line 64 of file AbstractTreeLikelihood.cpp.

References bpp::TreeLikelihood::getLikelihoodForASiteForAState(), bpp::AbstractTreeLikelihood::getNumberOfSites(), and bpp::TreeLikelihood::getNumberOfStates().

◆ 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 virtualinherited

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 virtualinherited

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() [1/2]

double AbstractDiscreteRatesAcrossSitesTreeLikelihood::getLogLikelihoodForASiteForAState ( size_t  site,
int  state 
) const
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.

Implements bpp::TreeLikelihood.

Definition at line 124 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

◆ getLogLikelihoodForASiteForAState() [2/2]

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() [1/2]

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.

◆ getLogLikelihoodForEachSite() [2/2]

Vdouble AbstractTreeLikelihood::getLogLikelihoodForEachSite ( ) const
virtualinherited

Get the logarithm of the likelihood for each site.

Returns
A vector with all log likelihoods for each site.

Implements bpp::TreeLikelihood.

Definition at line 55 of file AbstractTreeLikelihood.cpp.

References bpp::TreeLikelihood::getLogLikelihoodForASite(), and bpp::AbstractTreeLikelihood::getNumberOfSites().

◆ getLogLikelihoodForEachSiteForEachRateClass()

VVdouble AbstractDiscreteRatesAcrossSitesTreeLikelihood::getLogLikelihoodForEachSiteForEachRateClass ( ) const
virtualinherited

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.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 138 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

◆ getLogLikelihoodForEachSiteForEachRateClassForEachState()

VVVdouble AbstractDiscreteRatesAcrossSitesTreeLikelihood::getLogLikelihoodForEachSiteForEachRateClassForEachState ( ) const
virtualinherited

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.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 179 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

◆ getLogLikelihoodForEachSiteForEachState() [1/2]

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.

◆ getLogLikelihoodForEachSiteForEachState() [2/2]

VVdouble AbstractTreeLikelihood::getLogLikelihoodForEachSiteForEachState ( ) const
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.

Implements bpp::TreeLikelihood.

Definition at line 81 of file AbstractTreeLikelihood.cpp.

References bpp::TreeLikelihood::getLogLikelihoodForASiteForAState(), bpp::AbstractTreeLikelihood::getNumberOfSites(), and bpp::TreeLikelihood::getNumberOfStates().

◆ getMaximumBranchLength()

virtual double bpp::AbstractNonHomogeneousTreeLikelihood::getMaximumBranchLength ( ) const
inlinevirtual

Definition at line 279 of file AbstractNonHomogeneousTreeLikelihood.h.

References maximumBrLen_.

◆ getMinimumBranchLength()

virtual double bpp::AbstractNonHomogeneousTreeLikelihood::getMinimumBranchLength ( ) const
inlinevirtual

Definition at line 278 of file AbstractNonHomogeneousTreeLikelihood.h.

References minimumBrLen_.

◆ getNewBranchModelIterator()

ConstBranchModelIterator* bpp::AbstractNonHomogeneousTreeLikelihood::getNewBranchModelIterator ( int  nodeId) const
inlinevirtual

◆ getNewSiteModelIterator()

ConstSiteModelIterator* bpp::AbstractNonHomogeneousTreeLikelihood::getNewSiteModelIterator ( size_t  siteIndex) const
inlinevirtual

Implements bpp::TreeLikelihood.

Definition at line 215 of file AbstractNonHomogeneousTreeLikelihood.h.

References modelSet_.

◆ getNonDerivableParameters() [1/2]

ParameterList AbstractDiscreteRatesAcrossSitesTreeLikelihood::getNonDerivableParameters ( ) const
virtualinherited

All non derivable parameters.

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

Returns
A ParameterList.

Implements bpp::TreeLikelihood.

Reimplemented in bpp::RHomogeneousClockTreeLikelihood.

Definition at line 82 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

◆ getNonDerivableParameters() [2/2]

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()

size_t bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::getNumberOfClasses ( ) const
inlinevirtualinherited

Get the number of classes.

Returns
The Number of classes.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 108 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.h.

References bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::rateDistribution_.

◆ getNumberOfSites() [1/2]

size_t bpp::AbstractTreeLikelihood::getNumberOfSites ( ) const
inlinevirtualinherited

◆ getNumberOfSites() [2/2]

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()

size_t bpp::AbstractNonHomogeneousTreeLikelihood::getNumberOfStates ( ) const
inlinevirtual
Returns
the number of model states of the underlying Markov chain.

Implements bpp::TreeLikelihood.

Definition at line 177 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::SubstitutionModelSet::getNumberOfStates(), and modelSet_.

◆ getPosteriorProbabilitiesOfEachRate()

VVdouble AbstractDiscreteRatesAcrossSitesTreeLikelihood::getPosteriorProbabilitiesOfEachRate ( ) const
virtualinherited

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.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 202 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

◆ getPosteriorRateOfEachSite()

Vdouble AbstractDiscreteRatesAcrossSitesTreeLikelihood::getPosteriorRateOfEachSite ( ) const
virtualinherited

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

Returns
A vector with all rates.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 220 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

◆ getRateClassWithMaxPostProbOfEachSite()

vector< size_t > AbstractDiscreteRatesAcrossSitesTreeLikelihood::getRateClassWithMaxPostProbOfEachSite ( ) const
virtualinherited

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

Returns
A vector with all rate classes indexes.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 239 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

◆ getRateDistribution() [1/2]

const DiscreteDistribution* bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::getRateDistribution ( ) const
inlinevirtualinherited

Get the rate distribution used for the computation.

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

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 106 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.h.

References bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::rateDistribution_.

◆ getRateDistribution() [2/2]

DiscreteDistribution* bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::getRateDistribution ( )
inlinevirtualinherited

Get the rate distribution used for the computation.

Returns
A pointer toward the rate distribution of this instance.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 107 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.h.

References bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::rateDistribution_.

◆ getRateDistributionParameters()

ParameterList bpp::AbstractNonHomogeneousTreeLikelihood::getRateDistributionParameters ( ) const
inlinevirtual

Get the parameters associated to the rate distirbution.

Returns
A ParameterList object with all rate distribution parameters.

Reimplemented from bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 191 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::getRateDistributionParameters().

◆ getRateWithMaxPostProbOfEachSite()

Vdouble AbstractDiscreteRatesAcrossSitesTreeLikelihood::getRateWithMaxPostProbOfEachSite ( ) const
virtualinherited

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

Returns
A vector with all rate classes indexes.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 253 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

◆ getRootFrequencies()

const std::vector<double>& bpp::AbstractNonHomogeneousTreeLikelihood::getRootFrequencies ( size_t  siteIndex) const
inlinevirtual

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;

Implements bpp::TreeLikelihood.

Definition at line 206 of file AbstractNonHomogeneousTreeLikelihood.h.

References rootFreqs_.

◆ getRootFrequenciesParameters()

ParameterList bpp::AbstractNonHomogeneousTreeLikelihood::getRootFrequenciesParameters ( ) const
inlinevirtual
Returns
The parameters on which the root frequencies depend.

Implements bpp::NonHomogeneousTreeLikelihood.

Definition at line 235 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::SubstitutionModelSet::getRootFrequenciesParameters(), and modelSet_.

◆ 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]

const SubstitutionModel* bpp::NonHomogeneousTreeLikelihood::getSubstitutionModel ( int  nodeId,
size_t  siteIndex 
) const
throw (NodeNotFoundException
)
inlinevirtualinherited

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).

Implements bpp::TreeLikelihood.

Definition at line 69 of file NonHomogeneousTreeLikelihood.h.

References bpp::NonHomogeneousTreeLikelihood::getSubstitutionModelForNode().

◆ getSubstitutionModel() [2/2]

SubstitutionModel* bpp::NonHomogeneousTreeLikelihood::getSubstitutionModel ( int  nodeId,
size_t  siteIndex 
)
throw (NodeNotFoundException
)
inlinevirtualinherited

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).

Implements bpp::TreeLikelihood.

Definition at line 74 of file NonHomogeneousTreeLikelihood.h.

References bpp::NonHomogeneousTreeLikelihood::getSubstitutionModelForNode().

◆ getSubstitutionModelForNode() [1/2]

const SubstitutionModel* bpp::AbstractNonHomogeneousTreeLikelihood::getSubstitutionModelForNode ( int  nodeId) const
throw (NodeNotFoundException
)
inlinevirtual

Get the substitution model associated to a given node.

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

Implements bpp::NonHomogeneousTreeLikelihood.

Definition at line 196 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::SubstitutionModelSet::getModelForNode(), and modelSet_.

◆ getSubstitutionModelForNode() [2/2]

SubstitutionModel* bpp::AbstractNonHomogeneousTreeLikelihood::getSubstitutionModelForNode ( int  nodeId)
throw (NodeNotFoundException
)
inlinevirtual

Get the substitution model associated to a given node.

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

Implements bpp::NonHomogeneousTreeLikelihood.

Definition at line 201 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::SubstitutionModelSet::getModelForNode(), and modelSet_.

◆ getSubstitutionModelParameters()

ParameterList AbstractNonHomogeneousTreeLikelihood::getSubstitutionModelParameters ( ) const
virtual

Get the parameters associated to substitution model(s).

Returns
A ParameterList.

Implements bpp::TreeLikelihood.

Definition at line 288 of file AbstractNonHomogeneousTreeLikelihood.cpp.

References bpp::AbstractTreeLikelihood::initialized_, and modelSet_.

◆ getSubstitutionModelSet() [1/2]

const SubstitutionModelSet* bpp::AbstractNonHomogeneousTreeLikelihood::getSubstitutionModelSet ( ) const
inlinevirtual
Returns
The set of substitution models associated to this instance.

Implements bpp::NonHomogeneousTreeLikelihood.

Definition at line 229 of file AbstractNonHomogeneousTreeLikelihood.h.

References modelSet_.

◆ getSubstitutionModelSet() [2/2]

SubstitutionModelSet* bpp::AbstractNonHomogeneousTreeLikelihood::getSubstitutionModelSet ( )
inlinevirtual
Returns
The set of substitution models associated to this instance.

Implements bpp::NonHomogeneousTreeLikelihood.

Definition at line 231 of file AbstractNonHomogeneousTreeLikelihood.h.

References modelSet_.

◆ getTransitionProbabilities() [1/2]

VVdouble AbstractDiscreteRatesAcrossSitesTreeLikelihood::getTransitionProbabilities ( int  nodeId,
size_t  siteIndex 
) const
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.

Implements bpp::TreeLikelihood.

Definition at line 311 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

◆ getTransitionProbabilities() [2/2]

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()

VVVdouble bpp::AbstractNonHomogeneousTreeLikelihood::getTransitionProbabilitiesPerRateClass ( int  nodeId,
size_t  siteIndex 
) const
inlinevirtual

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.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 208 of file AbstractNonHomogeneousTreeLikelihood.h.

References pxy_.

◆ getTree() [1/2]

const Tree& bpp::AbstractTreeLikelihood::getTree ( ) const
inlinevirtualinherited

Get the tree (topology and branch lengths).

Returns
The tree of this TreeLikelihood object.

Implements bpp::TreeLikelihood.

Definition at line 291 of file AbstractTreeLikelihood.h.

References bpp::AbstractTreeLikelihood::tree_.

Referenced by bpp::NNIHomogeneousTreeLikelihood::getTopology(), and bpp::RNonHomogeneousMixedTreeLikelihood::init().

◆ getTree() [2/2]

◆ init_()

void AbstractNonHomogeneousTreeLikelihood::init_ ( const Tree tree,
SubstitutionModelSet modelSet,
DiscreteDistribution *  rDist,
bool  verbose 
)
throw (Exception
)
private

◆ initBranchLengthsParameters()

◆ initialize()

void AbstractNonHomogeneousTreeLikelihood::initialize ( )
throw (Exception
)
virtual

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.

Implements bpp::TreeLikelihood.

Reimplemented in bpp::RNonHomogeneousMixedTreeLikelihood.

Definition at line 268 of file AbstractNonHomogeneousTreeLikelihood.cpp.

References computeAllTransitionProbabilities(), bpp::AbstractTreeLikelihood::data_, bpp::AbstractTreeLikelihood::initialized_, and initParameters().

Referenced by bpp::RNonHomogeneousMixedTreeLikelihood::initialize().

◆ initParameters()

void AbstractNonHomogeneousTreeLikelihood::initParameters ( )
virtual

This builds the parameters list from all parametrizable objects, i.e. substitution model, rate distribution and tree.

Definition at line 296 of file AbstractNonHomogeneousTreeLikelihood.cpp.

References brLenParameters_, initBranchLengthsParameters(), modelSet_, and bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::rateDistribution_.

Referenced by initialize(), and bpp::RNonHomogeneousMixedTreeLikelihood::initialize().

◆ isInitialized() [1/2]

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

Implemented in bpp::AbstractTreeLikelihood.

◆ isInitialized() [2/2]

bool bpp::AbstractTreeLikelihood::isInitialized ( ) const
inlinevirtualinherited

◆ operator=()

◆ resetLikelihoodArray()

◆ setData()

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

◆ setMaximumBranchLength()

virtual void bpp::AbstractNonHomogeneousTreeLikelihood::setMaximumBranchLength ( double  maximum)
throw (Exception
)
inlinevirtual

◆ setMinimumBranchLength()

virtual void bpp::AbstractNonHomogeneousTreeLikelihood::setMinimumBranchLength ( double  minimum)
throw (Exception
)
inlinevirtual

◆ setSubstitutionModelSet()

void AbstractNonHomogeneousTreeLikelihood::setSubstitutionModelSet ( SubstitutionModelSet model)
throw (Exception
)
virtual
Returns
Set the substitution models for this instance.
Exceptions
ExceptionIf the model could not be set (for instance, because of a wrong alphabet type).

Implements bpp::NonHomogeneousTreeLikelihood.

Definition at line 195 of file AbstractNonHomogeneousTreeLikelihood.cpp.

References bpp::Node::getId().

Member Data Documentation

◆ brLenConstraint_

std::auto_ptr<Constraint> bpp::AbstractNonHomogeneousTreeLikelihood::brLenConstraint_
protected

◆ brLenParameters_

◆ computeFirstOrderDerivatives_

◆ computeSecondOrderDerivatives_

◆ d2pxy_

◆ data_

◆ dpxy_

◆ idToNode_

std::map<int, const Node*> bpp::AbstractNonHomogeneousTreeLikelihood::idToNode_
mutableprotected

◆ initialized_

◆ maximumBrLen_

double bpp::AbstractNonHomogeneousTreeLikelihood::maximumBrLen_
protected

◆ minimumBrLen_

double bpp::AbstractNonHomogeneousTreeLikelihood::minimumBrLen_
protected

◆ modelSet_

◆ nbClasses_

◆ nbDistinctSites_

◆ nbNodes_

◆ nbSites_

◆ nbStates_

size_t bpp::AbstractNonHomogeneousTreeLikelihood::nbStates_
protected

◆ nodes_

◆ pxy_

◆ rateDistribution_

DiscreteDistribution* bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::rateDistribution_
protectedinherited

Definition at line 61 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.h.

Referenced by bpp::AbstractHomogeneousTreeLikelihood::applyParameters(), applyParameters(), bpp::TwoTreeLikelihood::applyParameters(), bpp::DRHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::AbstractHomogeneousTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::RNonHomogeneousMixedTreeLikelihood::computeTransitionProbabilitiesForNode(), computeTransitionProbabilitiesForNode(), bpp::TwoTreeLikelihood::computeTreeD2Likelihood(), bpp::DRHomogeneousTreeLikelihood::computeTreeD2LikelihoodAtNode(), bpp::DRNonHomogeneousTreeLikelihood::computeTreeD2LikelihoodAtNode(), bpp::TwoTreeLikelihood::computeTreeDLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeTreeDLikelihoodAtNode(), bpp::DRNonHomogeneousTreeLikelihood::computeTreeDLikelihoodAtNode(), bpp::TwoTreeLikelihood::computeTreeLikelihood(), bpp::DRHomogeneousTreeLikelihood::fireParameterChanged(), bpp::DRNonHomogeneousTreeLikelihood::fireParameterChanged(), bpp::RHomogeneousTreeLikelihood::fireParameterChanged(), bpp::RNonHomogeneousTreeLikelihood::fireParameterChanged(), bpp::TwoTreeLikelihood::fireParameterChanged(), bpp::RNonHomogeneousMixedTreeLikelihood::fireParameterChanged(), bpp::RNonHomogeneousTreeLikelihood::getD2LikelihoodForASite(), bpp::RHomogeneousTreeLikelihood::getD2LikelihoodForASite(), bpp::RNonHomogeneousTreeLikelihood::getDLikelihoodForASite(), bpp::RHomogeneousTreeLikelihood::getDLikelihoodForASite(), bpp::RHomogeneousTreeLikelihood::getLikelihoodForASite(), bpp::RNonHomogeneousTreeLikelihood::getLikelihoodForASite(), bpp::RHomogeneousTreeLikelihood::getLogLikelihoodForASite(), bpp::RNonHomogeneousTreeLikelihood::getLogLikelihoodForASite(), bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::getNumberOfClasses(), bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::getRateDistribution(), bpp::RNonHomogeneousMixedTreeLikelihood::init(), bpp::AbstractHomogeneousTreeLikelihood::initParameters(), initParameters(), bpp::TwoTreeLikelihood::initParameters(), and bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::operator=().

◆ reparametrizeRoot_

bool bpp::AbstractNonHomogeneousTreeLikelihood::reparametrizeRoot_
protected

◆ root1_

◆ root2_

◆ rootFreqs_

◆ tree_

TreeTemplate<Node>* bpp::AbstractTreeLikelihood::tree_
mutableprotectedinherited

Definition at line 226 of file AbstractTreeLikelihood.h.

Referenced by bpp::AbstractHomogeneousTreeLikelihood::AbstractHomogeneousTreeLikelihood(), AbstractNonHomogeneousTreeLikelihood(), bpp::AbstractTreeLikelihood::AbstractTreeLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeLikelihoodAtNode(), bpp::DRNonHomogeneousTreeLikelihood::computeLikelihoodAtNode(), bpp::DRHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeD2Likelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeTreeD2Likelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeDLikelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeTreeDLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeTreeLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeTreeLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeLikelihood(), bpp::RHomogeneousTreeLikelihood::computeTreeLikelihood(), bpp::DRHomogeneousTreeLikelihood::DRHomogeneousTreeLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::DRNonHomogeneousTreeLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::fireParameterChanged(), bpp::RNonHomogeneousTreeLikelihood::fireParameterChanged(), bpp::RNonHomogeneousMixedTreeLikelihood::fireParameterChanged(), bpp::RNonHomogeneousTreeLikelihood::getD2LikelihoodForASiteForARateClass(), bpp::RHomogeneousTreeLikelihood::getD2LikelihoodForASiteForARateClass(), bpp::RNonHomogeneousTreeLikelihood::getDLikelihoodForASiteForARateClass(), bpp::RHomogeneousTreeLikelihood::getDLikelihoodForASiteForARateClass(), bpp::RHomogeneousTreeLikelihood::getLikelihoodForASiteForARateClass(), bpp::RNonHomogeneousTreeLikelihood::getLikelihoodForASiteForARateClass(), bpp::RHomogeneousTreeLikelihood::getLikelihoodForASiteForARateClassForAState(), bpp::RNonHomogeneousTreeLikelihood::getLikelihoodForASiteForARateClassForAState(), bpp::RHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClass(), bpp::RNonHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClass(), bpp::RHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClassForAState(), bpp::RNonHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClassForAState(), bpp::AbstractHomogeneousTreeLikelihood::getNewSiteModelIterator(), bpp::AbstractTreeLikelihood::getTree(), bpp::DRHomogeneousTreeLikelihood::operator=(), bpp::DRNonHomogeneousTreeLikelihood::operator=(), bpp::AbstractHomogeneousTreeLikelihood::operator=(), bpp::RHomogeneousTreeLikelihood::operator=(), bpp::RNonHomogeneousTreeLikelihood::operator=(), operator=(), bpp::AbstractTreeLikelihood::operator=(), bpp::RHomogeneousTreeLikelihood::RHomogeneousTreeLikelihood(), bpp::RNonHomogeneousTreeLikelihood::RNonHomogeneousTreeLikelihood(), and bpp::AbstractTreeLikelihood::~AbstractTreeLikelihood().

◆ verbose_

bool bpp::AbstractNonHomogeneousTreeLikelihood::verbose_
protected

Definition at line 123 of file AbstractNonHomogeneousTreeLikelihood.h.

Referenced by operator=().


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