bpp-phyl  2.2.0
bpp::DistanceEstimation Class Reference

Estimate a distance matrix from sequence data, according to a given model. More...

#include <Bpp/Phyl/Distance/DistanceEstimation.h>

+ Inheritance diagram for bpp::DistanceEstimation:
+ Collaboration diagram for bpp::DistanceEstimation:

Public Member Functions

 DistanceEstimation (SubstitutionModel *model, DiscreteDistribution *rateDist, size_t verbose=1)
 Create a new DistanceEstimation object according to a given substitution model and a rate distribution. More...
 
 DistanceEstimation (SubstitutionModel *model, DiscreteDistribution *rateDist, const SiteContainer *sites, size_t verbose=1, bool computeMat=true)
 Create a new DistanceEstimation object and compute distances according to a given substitution model and a rate distribution. More...
 
 DistanceEstimation (const DistanceEstimation &distanceEstimation)
 Copy constructor. More...
 
DistanceEstimationoperator= (const DistanceEstimation &distanceEstimation)
 Assigment operator. More...
 
virtual ~DistanceEstimation ()
 
DistanceEstimationclone () const
 
void computeMatrix () throw (NullPointerException)
 Perform the distance computation. More...
 
DistanceMatrix * getMatrix () const
 Get the distance matrix. More...
 
bool hasSubstitutionModel () const
 
const SubstitutionModelgetSubstitutionModel () const throw (Exception)
 
void resetSubstitutionModel (SubstitutionModel *model=0)
 
bool hasRateDistribution () const
 
const DiscreteDistribution & getRateDistribution () const throw (Exception)
 
void resetRateDistribution (DiscreteDistribution *rateDist=0)
 
void setData (const SiteContainer *sites)
 
const SiteContainer * getData () const
 
void resetData ()
 
void setOptimizer (const Optimizer *optimizer)
 
const Optimizer * getOptimizer () const
 
Optimizer * getOptimizer ()
 
void resetOptimizer ()
 
void setAdditionalParameters (const ParameterList &parameters)
 Specify a list of parameters to be estimated. More...
 
void resetAdditionalParameters ()
 Reset all additional parameters. More...
 
void setVerbose (size_t verbose)
 
size_t getVerbose () const
 

Private Member Functions

void init_ ()
 

Private Attributes

auto_ptr< SubstitutionModelmodel_
 
auto_ptr< DiscreteDistribution > rateDist_
 
const SiteContainer * sites_
 
DistanceMatrix * dist_
 
Optimizer * optimizer_
 
MetaOptimizer * defaultOptimizer_
 
size_t verbose_
 
ParameterList parameters_
 

Detailed Description

Estimate a distance matrix from sequence data, according to a given model.

By default, the parameters of the model are fixed to there given values. It is possible to estimate one or several parameters by setting them with the setAdditionalParameters() method. Parameters will be estimated separately for each pair of sequence.

For now it is not possible to retrieve estimated values. You'll have to specify a 'profiler' to the optimizer and then look at the file if you want to do so.

Definition at line 306 of file DistanceEstimation.h.

Constructor & Destructor Documentation

◆ DistanceEstimation() [1/3]

bpp::DistanceEstimation::DistanceEstimation ( SubstitutionModel model,
DiscreteDistribution *  rateDist,
size_t  verbose = 1 
)
inline

Create a new DistanceEstimation object according to a given substitution model and a rate distribution.

This instance will own the model and distribution, and will take car of their recopy and destruction.

Parameters
modelThe substitution model to use.
rateDistThe discrete rate distribution to use.
verboseThe verbose level:
  • 0=Off,
  • 1=one * by row computation
  • 2=one * by row computation and one . by column computation
  • 3=2 + optimization verbose enabled
  • 4=3 + likelihood object verbose enabled

Definition at line 335 of file DistanceEstimation.h.

◆ DistanceEstimation() [2/3]

bpp::DistanceEstimation::DistanceEstimation ( SubstitutionModel model,
DiscreteDistribution *  rateDist,
const SiteContainer *  sites,
size_t  verbose = 1,
bool  computeMat = true 
)
inline

Create a new DistanceEstimation object and compute distances according to a given substitution model and a rate distribution.

This instance will own the model and distribution, and will take car of their recopy and destruction.

Parameters
modelThe substitution model to use.
rateDistThe discrete rate distribution to use.
sitesThe sequence data.
verboseThe verbose level:
  • 0=Off,
  • 1=one * by row computation
  • 2=one * by row computation and one . by column computation
  • 3=2 + optimization verbose enabled
  • 4=3 + likelihood object verbose enabled
computeMatif true the computeMatrix() method is called.

Definition at line 368 of file DistanceEstimation.h.

◆ DistanceEstimation() [3/3]

bpp::DistanceEstimation::DistanceEstimation ( const DistanceEstimation distanceEstimation)
inline

Copy constructor.

Only the distance matrix is hard-copied, if there is one.

Parameters
distanceEstimationThe object to copy.

Definition at line 394 of file DistanceEstimation.h.

References dist_.

◆ ~DistanceEstimation()

virtual bpp::DistanceEstimation::~DistanceEstimation ( )
inlinevirtual

Definition at line 434 of file DistanceEstimation.h.

Member Function Documentation

◆ clone()

DistanceEstimation* bpp::DistanceEstimation::clone ( ) const
inline

Definition at line 446 of file DistanceEstimation.h.

◆ computeMatrix()

void DistanceEstimation::computeMatrix ( )
throw (NullPointerException
)

Perform the distance computation.

Result can be called by the getMatrix() method.

Exceptions
NullPointerExceptionif at least one of the model, rate distribution or data are not initialized.

Definition at line 652 of file DistanceEstimation.cpp.

References dist_, bpp::AbstractTreeLikelihood::enableDerivatives(), bpp::TwoTreeLikelihood::getBranchLengthsParameters(), bpp::TwoTreeLikelihood::getMinimumBranchLength(), bpp::TwoTreeLikelihood::initialize(), model_, optimizer_, parameters_, rateDist_, sites_, and verbose_.

◆ getData()

const SiteContainer* bpp::DistanceEstimation::getData ( ) const
inline

Definition at line 507 of file DistanceEstimation.h.

◆ getMatrix()

DistanceMatrix* bpp::DistanceEstimation::getMatrix ( ) const
inline

Get the distance matrix.

Returns
A pointer toward the computed distance matrix.

Definition at line 482 of file DistanceEstimation.h.

Referenced by bpp::TreeTools::MRP(), and bpp::TreeTools::MRPMultilabel().

◆ getOptimizer() [1/2]

const Optimizer* bpp::DistanceEstimation::getOptimizer ( ) const
inline

Definition at line 515 of file DistanceEstimation.h.

◆ getOptimizer() [2/2]

Optimizer* bpp::DistanceEstimation::getOptimizer ( )
inline

Definition at line 516 of file DistanceEstimation.h.

◆ getRateDistribution()

const DiscreteDistribution& bpp::DistanceEstimation::getRateDistribution ( ) const
throw (Exception
)
inline

Definition at line 497 of file DistanceEstimation.h.

◆ getSubstitutionModel()

const SubstitutionModel& bpp::DistanceEstimation::getSubstitutionModel ( ) const
throw (Exception
)
inline

Definition at line 486 of file DistanceEstimation.h.

References bpp::TwoTreeLikelihood::model_.

◆ getVerbose()

size_t bpp::DistanceEstimation::getVerbose ( ) const
inline
Returns
Verbose level.

Definition at line 546 of file DistanceEstimation.h.

◆ hasRateDistribution()

bool bpp::DistanceEstimation::hasRateDistribution ( ) const
inline

Definition at line 495 of file DistanceEstimation.h.

◆ hasSubstitutionModel()

bool bpp::DistanceEstimation::hasSubstitutionModel ( ) const
inline

Definition at line 484 of file DistanceEstimation.h.

References bpp::TwoTreeLikelihood::model_.

◆ init_()

void bpp::DistanceEstimation::init_ ( )
inlineprivate

Definition at line 449 of file DistanceEstimation.h.

References bpp::TwoTreeLikelihood::model_.

◆ operator=()

DistanceEstimation& bpp::DistanceEstimation::operator= ( const DistanceEstimation distanceEstimation)
inline

Assigment operator.

Only the distance matrix is hard-copied, if there is one.

Parameters
distanceEstimationThe object to copy.
Returns
A reference toward this object.

Definition at line 418 of file DistanceEstimation.h.

References dist_, bpp::TwoTreeLikelihood::model_, model_, optimizer_, parameters_, rateDist_, sites_, and verbose_.

◆ resetAdditionalParameters()

void bpp::DistanceEstimation::resetAdditionalParameters ( )
inline

Reset all additional parameters.

Definition at line 534 of file DistanceEstimation.h.

◆ resetData()

void bpp::DistanceEstimation::resetData ( )
inline

Definition at line 508 of file DistanceEstimation.h.

◆ resetOptimizer()

void bpp::DistanceEstimation::resetOptimizer ( )
inline

Definition at line 517 of file DistanceEstimation.h.

◆ resetRateDistribution()

void bpp::DistanceEstimation::resetRateDistribution ( DiscreteDistribution *  rateDist = 0)
inline

Definition at line 504 of file DistanceEstimation.h.

◆ resetSubstitutionModel()

void bpp::DistanceEstimation::resetSubstitutionModel ( SubstitutionModel model = 0)
inline

Definition at line 493 of file DistanceEstimation.h.

References bpp::TwoTreeLikelihood::model_.

◆ setAdditionalParameters()

void bpp::DistanceEstimation::setAdditionalParameters ( const ParameterList &  parameters)
inline

Specify a list of parameters to be estimated.

Parameters will be estimated separately for each distance.

Parameters
parametersA list of parameters to estimate.

Definition at line 526 of file DistanceEstimation.h.

◆ setData()

void bpp::DistanceEstimation::setData ( const SiteContainer *  sites)
inline

Definition at line 506 of file DistanceEstimation.h.

◆ setOptimizer()

void bpp::DistanceEstimation::setOptimizer ( const Optimizer *  optimizer)
inline

Definition at line 510 of file DistanceEstimation.h.

◆ setVerbose()

void bpp::DistanceEstimation::setVerbose ( size_t  verbose)
inline
Parameters
verboseVerbose level.

Definition at line 542 of file DistanceEstimation.h.

Member Data Documentation

◆ defaultOptimizer_

MetaOptimizer* bpp::DistanceEstimation::defaultOptimizer_
private

Definition at line 315 of file DistanceEstimation.h.

◆ dist_

DistanceMatrix* bpp::DistanceEstimation::dist_
private

Definition at line 313 of file DistanceEstimation.h.

Referenced by computeMatrix(), DistanceEstimation(), and operator=().

◆ model_

auto_ptr<SubstitutionModel> bpp::DistanceEstimation::model_
private

Definition at line 310 of file DistanceEstimation.h.

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

◆ optimizer_

Optimizer* bpp::DistanceEstimation::optimizer_
private

Definition at line 314 of file DistanceEstimation.h.

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

◆ parameters_

ParameterList bpp::DistanceEstimation::parameters_
private

Definition at line 317 of file DistanceEstimation.h.

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

◆ rateDist_

auto_ptr<DiscreteDistribution> bpp::DistanceEstimation::rateDist_
private

Definition at line 311 of file DistanceEstimation.h.

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

◆ sites_

const SiteContainer* bpp::DistanceEstimation::sites_
private

Definition at line 312 of file DistanceEstimation.h.

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

◆ verbose_

size_t bpp::DistanceEstimation::verbose_
private

Definition at line 316 of file DistanceEstimation.h.

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


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