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 
15 namespace bpp
16 {
21  public virtual SequenceSimulatorInterface
22 {
23 private:
24  std::shared_ptr<SiteSimulatorInterface> siteSim_;
25 
26 public:
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  siteSim_(std::make_shared<GivenDataSubstitutionProcessSiteSimulator>(calcul, pos))
38  {}
39 
40  SimpleSubstitutionProcessSequenceSimulator(std::shared_ptr<SiteSimulatorInterface> simul) :
41  siteSim_(simul) {}
42 
43 
45 
47  siteSim_(nhss.siteSim_)
48  {}
49 
51  {
53  }
54 
55 public:
62  std::unique_ptr<SiteContainerInterface> simulate(size_t numberOfSites) const override;
63 
64 
65  const SiteSimulatorInterface& siteSimulator(size_t pos) const override
66  {
67  return *siteSim_;
68  }
69 
70  std::vector<std::string> getSequenceNames() const override
71  {
72  return siteSim_->getSequenceNames();
73  }
74 
82  std::shared_ptr<const Alphabet> getAlphabet() const override { return siteSim_->getAlphabet(); }
83 
84  const Alphabet& alphabet() const override { return siteSim_->alphabet(); }
93  void outputInternalSequences(bool yn) override
94  {
95  siteSim_->outputInternalSites(yn);
96  }
97 };
98 } // end of namespace bpp.
99 #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.
SimpleSubstitutionProcessSequenceSimulator * clone() const override
void outputInternalSequences(bool yn) override
Sets whether we will output the internal sequences or not.
SimpleSubstitutionProcessSequenceSimulator(std::shared_ptr< LikelihoodCalculationSingleProcess > calcul, size_t pos)
A posterior simulation, from a position in an alignment.
std::unique_ptr< SiteContainerInterface > simulate(size_t numberOfSites) const override
SimpleSubstitutionProcessSequenceSimulator(std::shared_ptr< const SubstitutionProcessInterface > process)
std::shared_ptr< const Alphabet > getAlphabet() const override
SimpleSubstitutionProcessSequenceSimulator(std::shared_ptr< SiteSimulatorInterface > simul)
const SiteSimulatorInterface & siteSimulator(size_t pos) const override
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.