bpp-phyl3  3.0.0
bpp::DistanceEstimation Class Reference

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

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

Public Member Functions

 DistanceEstimation (std::shared_ptr< SubstitutionProcessInterface > process, size_t verbose=1)
 Create a new DistanceEstimation object according to a given substitution process. More...
 
 DistanceEstimation (std::shared_ptr< BranchModelInterface > model, std::shared_ptr< DiscreteDistributionInterface > rateDist, size_t verbose=1)
 Create a new DistanceEstimation object according to a given substitution model and a rate distribution. More...
 
 DistanceEstimation (std::shared_ptr< SubstitutionProcessInterface > process, std::shared_ptr< const AlignmentDataInterface > sites, size_t verbose=1, bool computeMat=true)
 Create a new DistanceEstimation object and compute distances according to a given substitution process. More...
 
 DistanceEstimation (std::shared_ptr< BranchModelInterface > model, std::shared_ptr< DiscreteDistributionInterface > rateDist, std::shared_ptr< const AlignmentDataInterface > 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)
 Assignment operator. More...
 
virtual ~DistanceEstimation ()
 
DistanceEstimationclone () const override
 
void computeMatrix ()
 Perform the distance computation. More...
 
std::unique_ptr< DistanceMatrixgetMatrix () const
 Get the distance matrix. More...
 
bool hasProcess () const
 
const SubstitutionProcessInterfaceprocess () const
 
std::shared_ptr< const SubstitutionProcessInterfacegetProcess () const
 
void setProcess (std::shared_ptr< SubstitutionProcessInterface > process=nullptr)
 
void setData (std::shared_ptr< const AlignmentDataInterface > sites=nullptr)
 
std::shared_ptr< const AlignmentDataInterfacegetData () const
 
const AlignmentDataInterfacedata () const
 
void setOptimizer (std::shared_ptr< OptimizerInterface > optimizer)
 
std::shared_ptr< const OptimizerInterfacegetOptimizer () const
 
std::shared_ptr< OptimizerInterfacegetOptimizer ()
 
const OptimizerInterfaceoptimizer () const
 
OptimizerInterfaceoptimizer ()
 
void resetOptimizer ()
 
bool matchParametersValues (const ParameterList &parameters)
 
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::shared_ptr< SubstitutionProcessInterfaceprocess_
 
size_t numProc_
 
std::shared_ptr< const AlignmentDataInterfacesites_
 
std::shared_ptr< DistanceMatrixdist_
 
std::shared_ptr< OptimizerInterfaceoptimizer_
 
std::shared_ptr< MetaOptimizerdefaultOptimizer_
 
size_t verbose_
 
ParameterList parameters_
 

Detailed Description

Definition at line 28 of file DistanceEstimation.h.

Constructor & Destructor Documentation

◆ DistanceEstimation() [1/5]

bpp::DistanceEstimation::DistanceEstimation ( std::shared_ptr< SubstitutionProcessInterface process,
size_t  verbose = 1 
)
inline

Create a new DistanceEstimation object according to a given substitution process.

Parameters
processThe substitution process 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 53 of file DistanceEstimation.h.

References init_().

Referenced by clone().

◆ DistanceEstimation() [2/5]

bpp::DistanceEstimation::DistanceEstimation ( std::shared_ptr< BranchModelInterface model,
std::shared_ptr< DiscreteDistributionInterface rateDist,
size_t  verbose = 1 
)
inline

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

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

References init_(), and process_.

◆ DistanceEstimation() [3/5]

bpp::DistanceEstimation::DistanceEstimation ( std::shared_ptr< SubstitutionProcessInterface process,
std::shared_ptr< const AlignmentDataInterface sites,
size_t  verbose = 1,
bool  computeMat = true 
)
inline

Create a new DistanceEstimation object and compute distances according to a given substitution process.

Parameters
processThe substitution process 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 111 of file DistanceEstimation.h.

References computeMatrix(), and init_().

◆ DistanceEstimation() [4/5]

bpp::DistanceEstimation::DistanceEstimation ( std::shared_ptr< BranchModelInterface model,
std::shared_ptr< DiscreteDistributionInterface rateDist,
std::shared_ptr< const AlignmentDataInterface 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.

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

References computeMatrix(), init_(), and process_.

◆ DistanceEstimation() [5/5]

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

References dist_.

◆ ~DistanceEstimation()

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

Definition at line 211 of file DistanceEstimation.h.

Member Function Documentation

◆ clone()

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

Implements bpp::Clonable.

Definition at line 213 of file DistanceEstimation.h.

References DistanceEstimation().

◆ computeMatrix()

void DistanceEstimation::computeMatrix ( )

◆ data()

const AlignmentDataInterface& bpp::DistanceEstimation::data ( ) const
inline

Definition at line 260 of file DistanceEstimation.h.

References sites_.

◆ getData()

std::shared_ptr<const AlignmentDataInterface> bpp::DistanceEstimation::getData ( ) const
inline

Definition at line 258 of file DistanceEstimation.h.

References sites_.

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

◆ getMatrix()

std::unique_ptr<DistanceMatrix> bpp::DistanceEstimation::getMatrix ( ) const
inline

Get the distance matrix.

Returns
A pointer toward the computed distance matrix.

Definition at line 234 of file DistanceEstimation.h.

References dist_.

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

◆ getOptimizer() [1/2]

std::shared_ptr<OptimizerInterface> bpp::DistanceEstimation::getOptimizer ( )
inline

Definition at line 269 of file DistanceEstimation.h.

References optimizer_.

◆ getOptimizer() [2/2]

std::shared_ptr<const OptimizerInterface> bpp::DistanceEstimation::getOptimizer ( ) const
inline

Definition at line 267 of file DistanceEstimation.h.

References optimizer_.

◆ getProcess()

std::shared_ptr<const SubstitutionProcessInterface> bpp::DistanceEstimation::getProcess ( ) const
inline

Definition at line 249 of file DistanceEstimation.h.

References process_.

◆ getVerbose()

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

Definition at line 311 of file DistanceEstimation.h.

References verbose_.

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

◆ hasProcess()

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

Definition at line 239 of file DistanceEstimation.h.

References process_.

Referenced by matchParametersValues(), and process().

◆ init_()

◆ matchParametersValues()

bool bpp::DistanceEstimation::matchParametersValues ( const ParameterList parameters)
inline

Definition at line 277 of file DistanceEstimation.h.

References hasProcess(), and process_.

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

◆ operator=()

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

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

References dist_, numProc_, optimizer_, parameters_, process_, sites_, and verbose_.

◆ optimizer() [1/2]

OptimizerInterface& bpp::DistanceEstimation::optimizer ( )
inline

Definition at line 273 of file DistanceEstimation.h.

References optimizer_.

◆ optimizer() [2/2]

const OptimizerInterface& bpp::DistanceEstimation::optimizer ( ) const
inline

Definition at line 271 of file DistanceEstimation.h.

References optimizer_.

Referenced by setOptimizer().

◆ process()

const SubstitutionProcessInterface& bpp::DistanceEstimation::process ( ) const
inline

◆ resetAdditionalParameters()

void bpp::DistanceEstimation::resetAdditionalParameters ( )
inline

Reset all additional parameters.

Definition at line 299 of file DistanceEstimation.h.

References parameters_, and bpp::ParameterList::reset().

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

◆ resetOptimizer()

void bpp::DistanceEstimation::resetOptimizer ( )
inline

Definition at line 275 of file DistanceEstimation.h.

References defaultOptimizer_, and optimizer_.

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

References parameters_.

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

◆ setData()

void bpp::DistanceEstimation::setData ( std::shared_ptr< const AlignmentDataInterface sites = nullptr)
inline

Definition at line 256 of file DistanceEstimation.h.

References sites_.

◆ setOptimizer()

void bpp::DistanceEstimation::setOptimizer ( std::shared_ptr< OptimizerInterface optimizer)
inline

Definition at line 262 of file DistanceEstimation.h.

References optimizer(), and optimizer_.

◆ setProcess()

void bpp::DistanceEstimation::setProcess ( std::shared_ptr< SubstitutionProcessInterface process = nullptr)
inline

Definition at line 254 of file DistanceEstimation.h.

References process(), and process_.

◆ setVerbose()

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

Definition at line 307 of file DistanceEstimation.h.

References verbose_.

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

Member Data Documentation

◆ defaultOptimizer_

std::shared_ptr<MetaOptimizer> bpp::DistanceEstimation::defaultOptimizer_
private

Definition at line 37 of file DistanceEstimation.h.

Referenced by resetOptimizer().

◆ dist_

std::shared_ptr<DistanceMatrix> bpp::DistanceEstimation::dist_
private

Definition at line 35 of file DistanceEstimation.h.

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

◆ numProc_

size_t bpp::DistanceEstimation::numProc_
private

Definition at line 33 of file DistanceEstimation.h.

Referenced by operator=().

◆ optimizer_

std::shared_ptr<OptimizerInterface> bpp::DistanceEstimation::optimizer_
private

Definition at line 36 of file DistanceEstimation.h.

Referenced by getOptimizer(), operator=(), optimizer(), resetOptimizer(), and setOptimizer().

◆ parameters_

ParameterList bpp::DistanceEstimation::parameters_
private

◆ process_

std::shared_ptr<SubstitutionProcessInterface> bpp::DistanceEstimation::process_
private

◆ sites_

std::shared_ptr<const AlignmentDataInterface> bpp::DistanceEstimation::sites_
private

Definition at line 34 of file DistanceEstimation.h.

Referenced by data(), getData(), operator=(), and setData().

◆ verbose_

size_t bpp::DistanceEstimation::verbose_
private

Definition at line 38 of file DistanceEstimation.h.

Referenced by getVerbose(), operator=(), and setVerbose().


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