bpp-phyl3 3.0.0
SimpleSubstitutionProcessSequenceSimulator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: The Bio++ Development Group
2//
3// SPDX-License-Identifier: CECILL-2.1
4
5#ifndef BPP_PHYL_SIMULATION_SIMPLESUBSTITUTIONPROCESSSEQUENCESIMULATOR_H
6#define BPP_PHYL_SIMULATION_SIMPLESUBSTITUTIONPROCESSSEQUENCESIMULATOR_H
7
8
9#include "../Likelihood/SequenceEvolution.h"
11#include "SequenceSimulator.h"
13#include "SiteSimulator.h"
14
15namespace bpp
16{
21 public virtual SequenceSimulatorInterface
22{
23private:
24 std::shared_ptr<SiteSimulatorInterface> siteSim_;
25
26public:
27 SimpleSubstitutionProcessSequenceSimulator(std::shared_ptr<const SubstitutionProcessInterface> process) :
28 siteSim_(std::make_shared<SimpleSubstitutionProcessSiteSimulator>(process))
29 {}
30
35 std::shared_ptr<LikelihoodCalculationSingleProcess> calcul,
36 size_t pos,
37 bool shrunked = false,
38 std::vector<uint> vPrior = std::vector<uint>()) :
39 siteSim_(std::make_shared<GivenDataSubstitutionProcessSiteSimulator>(calcul, pos, shrunked, vPrior))
40 {}
41
42 SimpleSubstitutionProcessSequenceSimulator(std::shared_ptr<SiteSimulatorInterface> simul) :
43 siteSim_(simul) {}
44
45
47
49 siteSim_(nhss.siteSim_)
50 {}
51
53 {
55 }
56
57public:
64 std::unique_ptr<SiteContainerInterface> simulate(size_t numberOfSites) const override;
65
66
67 const SiteSimulatorInterface& siteSimulator(size_t pos) const override
68 {
69 return *siteSim_;
70 }
71
72 std::vector<std::string> getSequenceNames() const override
73 {
74 return siteSim_->getSequenceNames();
75 }
76
84 std::shared_ptr<const Alphabet> getAlphabet() const override { return siteSim_->getAlphabet(); }
85
86 const Alphabet& alphabet() const override { return siteSim_->alphabet(); }
95 void outputInternalSequences(bool yn) override
96 {
97 siteSim_->outputInternalSites(yn);
98 }
99};
100} // end of namespace bpp.
101#endif // BPP_PHYL_SIMULATION_SIMPLESUBSTITUTIONPROCESSSEQUENCESIMULATOR_H
Site simulation under a unique substitution process, given data.
The SequenceSimulator interface. SequenceSimulator classes can simulate whole datasets.
Sequences simulation under a unique substitution process.
const SiteSimulatorInterface & siteSimulator(size_t pos) const override
std::shared_ptr< const Alphabet > getAlphabet() const override
void outputInternalSequences(bool yn) override
Sets whether we will output the internal sequences or not.
std::unique_ptr< SiteContainerInterface > simulate(size_t numberOfSites) const override
SimpleSubstitutionProcessSequenceSimulator(std::shared_ptr< LikelihoodCalculationSingleProcess > calcul, size_t pos, bool shrunked=false, std::vector< uint > vPrior=std::vector< uint >())
A posterior simulation, from a position in an alignment.
SimpleSubstitutionProcessSequenceSimulator(std::shared_ptr< const SubstitutionProcessInterface > process)
SimpleSubstitutionProcessSequenceSimulator * clone() const override
SimpleSubstitutionProcessSequenceSimulator(std::shared_ptr< SiteSimulatorInterface > simul)
SimpleSubstitutionProcessSequenceSimulator(const SimpleSubstitutionProcessSequenceSimulator &nhss)
Site simulation under a unique substitution process.
The SiteSimulator interface. SiteSimulator classes can simulate single sites.
Definition: SiteSimulator.h:24
Defines the basic types of data flow nodes.