bpp-phyl3  3.0.0
bpp::OptimizationTools Class Reference

Optimization methods for phylogenetic inference. More...

#include <Bpp/Phyl/OptimizationTools.h>

+ Inheritance diagram for bpp::OptimizationTools:
+ Collaboration diagram for bpp::OptimizationTools:

Classes

class  OptimizationOptions
 

Public Member Functions

 OptimizationTools ()
 
virtual ~OptimizationTools ()
 

Static Public Member Functions

static unsigned int optimizeNumericalParameters (std::shared_ptr< PhyloLikelihoodInterface > lik, const OptimizationOptions &optopt)
 Optimize numerical parameters (branch length, substitution model & rate distribution) of a TreeLikelihood function. More...
 
static unsigned int optimizeNumericalParameters2 (std::shared_ptr< PhyloLikelihoodInterface > lik, const OptimizationOptions &optopt)
 Optimize numerical parameters (branch length, substitution model & rate distribution) of a TreeLikelihood function. More...
 
static unsigned int optimizeNumericalParameters2 (std::shared_ptr< SingleProcessPhyloLikelihood > lik, const OptimizationOptions &optopt)
 
static std::unique_ptr< DistanceMatrixestimateDistanceMatrix (DistanceEstimation &estimationMethod, const ParameterList &parametersToIgnore, const std::string &param=DISTANCEMETHOD_INIT, unsigned int verbose=0)
 Estimate a distance matrix using maximum likelihood. More...
 
static std::unique_ptr< TreeTemplate< Node > > buildDistanceTree (DistanceEstimation &estimationMethod, AgglomerativeDistanceMethodInterface &reconstructionMethod, const std::string &param, OptimizationOptions &optopt)
 Build a tree using a distance method. More...
 

Static Public Attributes

static std::string OPTIMIZATION_GRADIENT = "gradient"
 
static std::string OPTIMIZATION_NEWTON = "newton"
 
static std::string OPTIMIZATION_BRENT = "Brent"
 
static std::string OPTIMIZATION_BFGS = "BFGS"
 
static std::string DISTANCEMETHOD_INIT = "init"
 
static std::string DISTANCEMETHOD_PAIRWISE = "pairwise"
 
static std::string DISTANCEMETHOD_ITERATIONS = "iterations"
 

Detailed Description

Optimization methods for phylogenetic inference.

This class provides optimization methods for phylogenetics. Parameters of the optimization methods are set to work with TreeLikelihood object. Some non trivial parameters are left to the user choice (tolerance, maximum number of function evaluation, output streams).

Definition at line 66 of file OptimizationTools.h.

Constructor & Destructor Documentation

◆ OptimizationTools()

OptimizationTools::OptimizationTools ( )

Definition at line 37 of file OptimizationTools.cpp.

◆ ~OptimizationTools()

OptimizationTools::~OptimizationTools ( )
virtual

Definition at line 39 of file OptimizationTools.cpp.

Member Function Documentation

◆ buildDistanceTree()

unique_ptr< TreeTemplate< Node > > OptimizationTools::buildDistanceTree ( DistanceEstimation estimationMethod,
AgglomerativeDistanceMethodInterface reconstructionMethod,
const std::string &  param,
OptimizationOptions optopt 
)
static

Build a tree using a distance method.

This method estimate a distance matrix using a DistanceEstimation object, and then builds the phylogenetic tree using a AgglomerativeDistanceMethod object. The main issue here is to estimate non-branch lengths parameters, as substitution model and rate distribution parameters. Three options are provideed here:

  • DISTANCEMETHOD_INIT (default) keep parameters to there initial value,
  • DISTANCEMETHOD_PAIRWISE estimated parameters in a pairwise manner, which is standard but not that satisfying...
  • DISTANCEMETHOD_ITERATIONS uses Ninio et al's iterative algorithm, which uses Maximum Likelihood to estimate these parameters, and then update the distance matrix. Ninio M, Privman E, Pupko T, Friedman N. Phylogeny reconstruction: increasing the accuracy of pairwise distance estimation using Bayesian inference of evolutionary rates. Bioinformatics. 2007 Jan 15;23(2):e136-41.
Parameters
estimationMethodThe distance estimation object to use.
reconstructionMethodThe tree reconstruction object to use.
paramMethod of for distance calculation
optoptOptimization Options

Definition at line 656 of file OptimizationTools.cpp.

References bpp::ParameterList::addParameters(), bpp::Node::addSon(), bpp::TreeTemplateTools::buildFromPhyloTree(), bpp::PhyloTreeTools::buildFromTreeTemplate(), bpp::SubstitutionProcessInterface::clone(), bpp::DistanceEstimation::computeMatrix(), bpp::DistanceMethodInterface::computeTree(), bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::displayTask(), bpp::ApplicationTools::displayTaskDone(), DISTANCEMETHOD_ITERATIONS, DISTANCEMETHOD_PAIRWISE, bpp::ParameterList::getCommonParametersWith(), bpp::DistanceEstimation::getData(), bpp::DistanceEstimation::getMatrix(), bpp::SubstitutionProcessInterface::getRateDistributionParameters(), bpp::SubstitutionProcessInterface::getRootFrequenciesParameters(), bpp::SubstitutionProcessInterface::getSubstitutionModelParameters(), bpp::DistanceEstimation::getVerbose(), bpp::DistanceEstimation::matchParametersValues(), optimizeNumericalParameters(), bpp::OptimizationTools::OptimizationOptions::parameters, bpp::DistanceEstimation::process(), bpp::DistanceEstimation::resetAdditionalParameters(), bpp::TreeTools::robinsonFouldsDistance(), bpp::DistanceEstimation::setAdditionalParameters(), bpp::DistanceMethodInterface::setDistanceMatrix(), bpp::Node::setDistanceToFather(), bpp::DistanceEstimation::setVerbose(), bpp::TextTools::toString(), bpp::DistanceMethodInterface::tree(), and bpp::OptimizationTools::OptimizationOptions::verbose.

◆ estimateDistanceMatrix()

unique_ptr< DistanceMatrix > OptimizationTools::estimateDistanceMatrix ( DistanceEstimation estimationMethod,
const ParameterList parametersToIgnore,
const std::string &  param = DISTANCEMETHOD_INIT,
unsigned int  verbose = 0 
)
static

Estimate a distance matrix using maximum likelihood.

This method estimate a distance matrix using a DistanceEstimation object. The main issue here is to estimate non-branch lengths parameters, as substitution model and rate distribution parameters. Twoe options are provideed here:

  • DISTANCEMETHOD_INIT (default) keep parameters to there initial value,
  • DISTANCEMETHOD_PAIRWISE estimated parameters in a pairwise manner, which is standard but not that satisfying...
Parameters
estimationMethodThe distance estimation object to use.
parametersToIgnoreA list of parameters to ignore while optimizing parameters.
paramString describing the type of optimization to use.
verboseVerbose level.
See also
buildDistanceTree for a procedure to jointly estimate the distance matrix and underlying tree.

Definition at line 624 of file OptimizationTools.cpp.

References bpp::ParameterList::addParameters(), bpp::DistanceEstimation::computeMatrix(), bpp::ParameterList::deleteParameters(), bpp::ApplicationTools::displayTask(), bpp::ApplicationTools::displayTaskDone(), DISTANCEMETHOD_INIT, DISTANCEMETHOD_PAIRWISE, bpp::DistanceEstimation::getMatrix(), bpp::ParameterList::getParameterNames(), bpp::SubstitutionProcessInterface::getRateDistributionParameters(), bpp::SubstitutionProcessInterface::getRootFrequenciesParameters(), bpp::SubstitutionProcessInterface::getSubstitutionModelParameters(), bpp::DistanceEstimation::process(), bpp::DistanceEstimation::resetAdditionalParameters(), bpp::DistanceEstimation::setAdditionalParameters(), and bpp::DistanceEstimation::setVerbose().

◆ optimizeNumericalParameters()

unsigned int OptimizationTools::optimizeNumericalParameters ( std::shared_ptr< PhyloLikelihoodInterface lik,
const OptimizationOptions optopt 
)
static

Optimize numerical parameters (branch length, substitution model & rate distribution) of a TreeLikelihood function.

Uses Newton's method for branch length and Brent or BFGS one dimensional method for other parameters.

A condition over function values is used as a stop condition for the algorithm.

See also
BrentOneDimension, BFGSMultiDimensions
Parameters
likA pointer toward the PhyloLikelihood object to optimize.
optoptOptimization Options

Definition at line 353 of file OptimizationTools.cpp.

References bpp::ParameterList::addParameters(), bpp::AutoParameter::CONSTRAINTS_AUTO, bpp::ParameterList::createSubList(), bpp::ApplicationTools::displayMessage(), bpp::ParameterList::getCommonParametersWith(), bpp::ParameterList::getParameterNames(), bpp::MetaOptimizerInfos::IT_TYPE_FULL, bpp::MetaOptimizerInfos::IT_TYPE_STEP, bpp::OptimizationTools::OptimizationOptions::listener, bpp::OptimizationTools::OptimizationOptions::messenger, bpp::OptimizationTools::OptimizationOptions::nbEvalMax, bpp::OptimizationTools::OptimizationOptions::nstep, OPTIMIZATION_BFGS, OPTIMIZATION_BRENT, OPTIMIZATION_GRADIENT, OPTIMIZATION_NEWTON, bpp::OptimizationTools::OptimizationOptions::optMethodDeriv, bpp::OptimizationTools::OptimizationOptions::optMethodModel, bpp::OptimizationTools::OptimizationOptions::parameters, bpp::OptimizationTools::OptimizationOptions::profiler, bpp::OptimizationTools::OptimizationOptions::reparametrization, bpp::OptimizationTools::OptimizationOptions::tolerance, and bpp::OptimizationTools::OptimizationOptions::verbose.

Referenced by buildDistanceTree(), and bpp::PhylogeneticsApplicationTools::optimizeParameters().

◆ optimizeNumericalParameters2() [1/2]

unsigned int OptimizationTools::optimizeNumericalParameters2 ( std::shared_ptr< PhyloLikelihoodInterface lik,
const OptimizationOptions optopt 
)
static

◆ optimizeNumericalParameters2() [2/2]

Member Data Documentation

◆ DISTANCEMETHOD_INIT

std::string OptimizationTools::DISTANCEMETHOD_INIT = "init"
static

Definition at line 223 of file OptimizationTools.h.

Referenced by estimateDistanceMatrix().

◆ DISTANCEMETHOD_ITERATIONS

std::string OptimizationTools::DISTANCEMETHOD_ITERATIONS = "iterations"
static

Definition at line 225 of file OptimizationTools.h.

Referenced by buildDistanceTree().

◆ DISTANCEMETHOD_PAIRWISE

std::string OptimizationTools::DISTANCEMETHOD_PAIRWISE = "pairwise"
static

Definition at line 224 of file OptimizationTools.h.

Referenced by buildDistanceTree(), and estimateDistanceMatrix().

◆ OPTIMIZATION_BFGS

◆ OPTIMIZATION_BRENT

◆ OPTIMIZATION_GRADIENT

◆ OPTIMIZATION_NEWTON


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