bpp-phyl3 3.0.0
OneProcessSequenceEvolution.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_LIKELIHOOD_ONEPROCESSSEQUENCEEVOLUTION_H
6#define BPP_PHYL_LIKELIHOOD_ONEPROCESSSEQUENCEEVOLUTION_H
7
8
9// From bpp-core:
11
12// From the STL:
13#include <memory>
14
15#include "SequenceEvolution.h"
16#include "SubstitutionProcess.h"
17
18namespace bpp
19{
27 public virtual SequenceEvolution,
29{
30protected:
31 std::shared_ptr<SubstitutionProcessInterface> subsProc_;
32
36 size_t nProc_;
37
41 std::vector<size_t> vProc_;
42
43public:
44 OneProcessSequenceEvolution(std::shared_ptr<SubstitutionProcessInterface> process, size_t nProc = 0);
45
47
49
51 {
52 return new OneProcessSequenceEvolution(*this);
53 }
54
55 bool isCompatibleWith(const AlignmentDataInterface& data) const override
56 {
57 return subsProc_->isCompatibleWith(data);
58 }
59
60 const size_t getSubstitutionProcessNumber() const
61 {
62 return nProc_;
63 }
64
66 {
67 return *subsProc_;
68 }
69
70 std::shared_ptr<const SubstitutionProcessInterface> getSubstitutionProcess() const
71 {
72 return subsProc_;
73 }
74
76 {
77 return *subsProc_;
78 }
79
80 std::shared_ptr<SubstitutionProcessInterface> getSubstitutionProcess()
81 {
82 return subsProc_;
83 }
84
85 const std::vector<size_t>& getSubstitutionProcessNumbers() const override
86 {
87 return vProc_;
88 }
89
90 const SubstitutionProcessInterface& substitutionProcess(size_t number) const override
91 {
92 return *subsProc_;
93 }
94
95 std::shared_ptr<const SubstitutionProcessInterface> getSubstitutionProcess(size_t number) const override
96 {
97 return subsProc_;
98 }
99
105 std::shared_ptr<const ParametrizablePhyloTree> tree() const
106 {
107 return subsProc_->getParametrizablePhyloTree();
108 }
109
110 void fireParameterChanged(const ParameterList& pl) override
111 {
112 // Updates substitution process:
113 subsProc_->matchParametersValues(pl);
114 }
115
116
121 ParameterList getBranchLengthParameters(bool independent) const override
122 {
123 return subsProc_->getBranchLengthParameters(independent);
124 }
125
126 ParameterList getRootFrequenciesParameters(bool independent) const override
127 {
128 return subsProc_->getRootFrequenciesParameters(independent);
129 }
130
131 ParameterList getRateDistributionParameters(bool independent) const override
132 {
133 return subsProc_->getRateDistributionParameters(independent);
134 }
135
136 ParameterList getSubstitutionModelParameters(bool independent) const override
137 {
138 return subsProc_->getSubstitutionModelParameters(independent);
139 }
140
141 ParameterList getSubstitutionProcessParameters(bool independent) const override
142 {
143 if (independent)
144 return subsProc_->getIndependentParameters();
145 else
146 return subsProc_->getParameters();
147 }
148
149 const ParameterList& getParameters() const override
150 {
151 return subsProc_->getParameters();
152 }
153
155 {
156 return subsProc_->getIndependentParameters();
157 }
158
164 {
165 return subsProc_->getNonDerivableParameters();
166 }
167};
168} // end namespace bpp
169#endif // BPP_PHYL_LIKELIHOOD_ONEPROCESSSEQUENCEEVOLUTION_H
Evolution of a sequence performed by a unique SubstitutionProcess all along the sequence.
OneProcessSequenceEvolution * clone() const override
ParameterList getRateDistributionParameters(bool independent) const override
Get the parameters associated to the rate distribution(s).
SubstitutionProcessInterface & substitutionProcess()
const ParameterList & getIndependentParameters() const override
const std::vector< size_t > & getSubstitutionProcessNumbers() const override
std::shared_ptr< const SubstitutionProcessInterface > getSubstitutionProcess(size_t number) const override
OneProcessSequenceEvolution(std::shared_ptr< SubstitutionProcessInterface > process, size_t nProc=0)
std::shared_ptr< const ParametrizablePhyloTree > tree() const
Get the tree (topology and branch lengths).
bool isCompatibleWith(const AlignmentDataInterface &data) const override
ParameterList getRootFrequenciesParameters(bool independent) const override
Get the parameters associated to the root frequencies(s).
std::shared_ptr< SubstitutionProcessInterface > subsProc_
std::shared_ptr< const SubstitutionProcessInterface > getSubstitutionProcess() const
ParameterList getSubstitutionProcessParameters(bool independent) const override
Get the parameters associated to substitution processes(s).
ParameterList getSubstitutionModelParameters(bool independent) const override
Get the parameters associated to substitution model(s).
const SubstitutionProcessInterface & substitutionProcess(size_t number) const override
ParameterList getBranchLengthParameters(bool independent) const override
Get several categories of parameters.
const ParameterList & getParameters() const override
const SubstitutionProcessInterface & substitutionProcess() const
ParameterList getNonDerivableParameters() const override
get (Non)Derivable INDEPENDENT parameters
void fireParameterChanged(const ParameterList &pl) override
size_t nProc_
the substitution process number.
OneProcessSequenceEvolution & operator=(const OneProcessSequenceEvolution &evol)
std::vector< size_t > vProc_
not nice, for inheritance compatibility.
std::shared_ptr< SubstitutionProcessInterface > getSubstitutionProcess()
This interface describes the evolution process of a sequence.
This interface describes the substitution process along the tree and sites of the alignment.
Defines the basic types of data flow nodes.