bpp-phyl3  3.0.0
bpp::SequenceSimulationTools Class Reference

Tools for sites and sequences simulation. More...

#include <Bpp/Phyl/Simulation/SequenceSimulationTools.h>

Public Member Functions

 SequenceSimulationTools ()
 
 ~SequenceSimulationTools ()
 

Static Public Member Functions

static std::unique_ptr< SiteContainerInterfacesimulateSites (const SequenceSimulatorInterface &simulator, const std::vector< double > &rates)
 Simulate a set of sites knowing their rate. More...
 
static std::unique_ptr< SiteContainerInterfacesimulateSites (const SequenceSimulatorInterface &simulator, const std::vector< double > &rates, const std::vector< size_t > &states)
 Simulate a set of sites knowing their rate and ancestral state. More...
 
static std::unique_ptr< SiteContainerInterfacesimulateSites (const SequenceSimulatorInterface &simulator, const std::vector< size_t > &states)
 Simulate a set of sites knowing ancestral state. More...
 

Detailed Description

Tools for sites and sequences simulation.

Definition at line 22 of file SequenceSimulationTools.h.

Constructor & Destructor Documentation

◆ SequenceSimulationTools()

bpp::SequenceSimulationTools::SequenceSimulationTools ( )
inline

Definition at line 25 of file SequenceSimulationTools.h.

◆ ~SequenceSimulationTools()

bpp::SequenceSimulationTools::~SequenceSimulationTools ( )
inline

Definition at line 26 of file SequenceSimulationTools.h.

Member Function Documentation

◆ simulateSites() [1/3]

unique_ptr< SiteContainerInterface > SequenceSimulationTools::simulateSites ( const SequenceSimulatorInterface simulator,
const std::vector< double > &  rates 
)
static

Simulate a set of sites knowing their rate.

This method is rather slow. consider using a discrete rate distribution and a SequenceSimulator, which is really faster. This method should be used only for continuous rate distribution, or as estimated from posterior rates for instance.

See also
SequenceSimulator
Parameters
simulatorA SiteSimulator object to use to simulate sites.
ratesthe rates to use, one for each site to simulate.
Returns
A container with all simulated sites.

Definition at line 17 of file SequenceSimulationTools.cpp.

References bpp::SequenceSimulatorInterface::getAlphabet(), bpp::SequenceSimulatorInterface::getSequenceNames(), bpp::SiteSimulatorInterface::simulateSite(), and bpp::SequenceSimulatorInterface::siteSimulator().

◆ simulateSites() [2/3]

unique_ptr< SiteContainerInterface > SequenceSimulationTools::simulateSites ( const SequenceSimulatorInterface simulator,
const std::vector< double > &  rates,
const std::vector< size_t > &  states 
)
static

Simulate a set of sites knowing their rate and ancestral state.

This method is rather slow. consider using a discrete rate distribution and a SequenceSimulator, which is really faster. This method should be used only for continuous rate distribution, or as estimated from posterior rates for instance.

See also
SequenceSimulator
Parameters
simulatorA SiteSimulator object to use to simulate sites.
ratesthe rates to use, one for each site to simulate.
statesthe ancestral states to use, one for each site to simulate.
Returns
A container with all simulated sites.

Definition at line 35 of file SequenceSimulationTools.cpp.

References bpp::SequenceSimulatorInterface::getAlphabet(), bpp::SequenceSimulatorInterface::getSequenceNames(), bpp::SiteSimulatorInterface::simulateSite(), and bpp::SequenceSimulatorInterface::siteSimulator().

◆ simulateSites() [3/3]

unique_ptr< SiteContainerInterface > SequenceSimulationTools::simulateSites ( const SequenceSimulatorInterface simulator,
const std::vector< size_t > &  states 
)
static

Simulate a set of sites knowing ancestral state.

See also
SequenceSimulator
Parameters
simulatorA SiteSimulator object to use to simulate sites.
statesthe ancestral states to use, one for each site to simulate.
Returns
A container with all simulated sites.

Definition at line 57 of file SequenceSimulationTools.cpp.

References bpp::SequenceSimulatorInterface::getAlphabet(), bpp::SequenceSimulatorInterface::getSequenceNames(), bpp::SiteSimulatorInterface::simulateSite(), and bpp::SequenceSimulatorInterface::siteSimulator().


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