bpp-phyl  2.4.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 (TransitionModel *model, DiscreteDistribution *rateDist, size_t verbose=1)
 Create a new DistanceEstimation object according to a given substitution model and a rate distribution. More...
 
 DistanceEstimation (TransitionModel *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 ()
 Perform the distance computation. More...
 
DistanceMatrixgetMatrix () const
 Get the distance matrix. More...
 
bool hasModel () const
 
const TransitionModelgetModel () const
 
void resetSubstitutionModel (TransitionModel *model=0)
 
bool hasRateDistribution () const
 
const DiscreteDistributiongetRateDistribution () const
 
void resetRateDistribution (DiscreteDistribution *rateDist=0)
 
void setData (const SiteContainer *sites)
 
const SiteContainergetData () const
 
void resetData ()
 
void setOptimizer (const Optimizer *optimizer)
 
const OptimizergetOptimizer () const
 
OptimizergetOptimizer ()
 
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

std::unique_ptr< TransitionModelmodel_
 
std::unique_ptr< DiscreteDistributionrateDist_
 
const SiteContainersites_
 
DistanceMatrixdist_
 
Optimizeroptimizer_
 
MetaOptimizerdefaultOptimizer_
 
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 307 of file DistanceEstimation.h.

Constructor & Destructor Documentation

bpp::DistanceEstimation::DistanceEstimation ( TransitionModel 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 336 of file DistanceEstimation.h.

bpp::DistanceEstimation::DistanceEstimation ( TransitionModel 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 369 of file DistanceEstimation.h.

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 395 of file DistanceEstimation.h.

References dist_.

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

Definition at line 435 of file DistanceEstimation.h.

Member Function Documentation

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

Implements bpp::Clonable.

Definition at line 442 of file DistanceEstimation.h.

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

Definition at line 504 of file DistanceEstimation.h.

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

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

Get the distance matrix.

Returns
A pointer toward the computed distance matrix.

Definition at line 478 of file DistanceEstimation.h.

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

const TransitionModel& bpp::DistanceEstimation::getModel ( ) const
inline
const Optimizer* bpp::DistanceEstimation::getOptimizer ( ) const
inline

Definition at line 512 of file DistanceEstimation.h.

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

Definition at line 513 of file DistanceEstimation.h.

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

Definition at line 543 of file DistanceEstimation.h.

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

Definition at line 480 of file DistanceEstimation.h.

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

Definition at line 492 of file DistanceEstimation.h.

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 419 of file DistanceEstimation.h.

References bpp::Optimizer::clone(), dist_, model_, optimizer_, parameters_, rateDist_, sites_, and verbose_.

void bpp::DistanceEstimation::resetAdditionalParameters ( )
inline

Reset all additional parameters.

Definition at line 531 of file DistanceEstimation.h.

References bpp::ParameterList::reset().

Referenced by bpp::OptimizationTools::buildDistanceTree(), and bpp::OptimizationTools::estimateDistanceMatrix().

void bpp::DistanceEstimation::resetData ( )
inline

Definition at line 505 of file DistanceEstimation.h.

void bpp::DistanceEstimation::resetOptimizer ( )
inline

Definition at line 514 of file DistanceEstimation.h.

References bpp::MetaOptimizer::clone().

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

Definition at line 501 of file DistanceEstimation.h.

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

Definition at line 490 of file DistanceEstimation.h.

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 523 of file DistanceEstimation.h.

Referenced by bpp::OptimizationTools::buildDistanceTree(), and bpp::OptimizationTools::estimateDistanceMatrix().

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

Definition at line 503 of file DistanceEstimation.h.

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

Definition at line 507 of file DistanceEstimation.h.

References bpp::Optimizer::clone().

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

Definition at line 539 of file DistanceEstimation.h.

Referenced by bpp::OptimizationTools::buildDistanceTree(), and bpp::OptimizationTools::estimateDistanceMatrix().

Member Data Documentation

MetaOptimizer* bpp::DistanceEstimation::defaultOptimizer_
private

Definition at line 316 of file DistanceEstimation.h.

DistanceMatrix* bpp::DistanceEstimation::dist_
private

Definition at line 314 of file DistanceEstimation.h.

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

std::unique_ptr<TransitionModel> bpp::DistanceEstimation::model_
private

Definition at line 311 of file DistanceEstimation.h.

Referenced by operator=().

Optimizer* bpp::DistanceEstimation::optimizer_
private

Definition at line 315 of file DistanceEstimation.h.

Referenced by operator=().

ParameterList bpp::DistanceEstimation::parameters_
private

Definition at line 318 of file DistanceEstimation.h.

Referenced by operator=().

std::unique_ptr<DiscreteDistribution> bpp::DistanceEstimation::rateDist_
private

Definition at line 312 of file DistanceEstimation.h.

Referenced by operator=().

const SiteContainer* bpp::DistanceEstimation::sites_
private

Definition at line 313 of file DistanceEstimation.h.

Referenced by operator=().

size_t bpp::DistanceEstimation::verbose_
private

Definition at line 317 of file DistanceEstimation.h.

Referenced by operator=().


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