bpp-phyl3  3.0.0
SubstitutionProcess.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_SUBSTITUTIONPROCESS_H
6 #define BPP_PHYL_LIKELIHOOD_SUBSTITUTIONPROCESS_H
7 
8 
9 #include "../Model/SubstitutionModel.h"
10 #include "ModelScenario.h"
12 
13 // From bpp-core:
16 
18 
19 // From the STL:
20 #include <memory>
21 
22 namespace bpp
23 {
46  public virtual ParameterAliasable
47 {
48 public:
49  virtual SubstitutionProcessInterface* clone() const = 0;
50 
51 public:
56  virtual const StateMapInterface& stateMap() const = 0;
57 
58  virtual std::shared_ptr<const StateMapInterface> getStateMap() const = 0;
59 
60  virtual bool isCompatibleWith(const AlignmentDataInterface& data) const = 0;
61 
63 
64  virtual std::shared_ptr<const ParametrizablePhyloTree> getParametrizablePhyloTree() const = 0;
65 
66  virtual size_t getNumberOfClasses() const = 0;
67 
68  virtual size_t getNumberOfStates() const = 0;
69 
74  virtual size_t getNumberOfModels() const = 0;
75 
80  virtual std::vector<size_t> getModelNumbers() const = 0;
81 
85  virtual const BranchModelInterface& model(size_t i) const = 0;
86 
90  virtual std::shared_ptr<const BranchModelInterface> getModel(size_t i) const = 0;
91 
100  virtual const BranchModelInterface& model(
101  unsigned int nodeId,
102  size_t classIndex) const = 0;
103 
112  virtual std::shared_ptr<const BranchModelInterface> getModel(
113  unsigned int nodeId,
114  size_t classIndex) const = 0;
115 
127  virtual std::shared_ptr<const ModelScenario> getModelScenario() const = 0;
128 
137  virtual const std::vector<unsigned int> getNodesWithModel(size_t i) const = 0;
138 
147  virtual size_t getModelNumberForNode(unsigned int nodeId) const = 0;
148 
156  virtual std::shared_ptr<const BranchModelInterface> getModelForNode(unsigned int nodeId) const = 0;
157 
163 
169 
174  virtual std::shared_ptr<const DiscreteDistributionInterface> getRateDistribution() const = 0;
175 
180  virtual std::shared_ptr<DiscreteDistributionInterface> getRateDistribution() = 0;
181 
182 
186  virtual ParameterList getSubstitutionModelParameters(bool independent) const = 0;
187 
188  virtual ParameterList getRateDistributionParameters(bool independent) const = 0;
189 
190  virtual ParameterList getRootFrequenciesParameters(bool independent) const = 0;
191 
192  virtual ParameterList getBranchLengthParameters(bool independent) const = 0;
193 
195 
205  virtual const std::vector<double>& getRootFrequencies() const = 0;
206 
210  virtual bool hasRootFrequencySet() const = 0;
211 
215  virtual const FrequencySetInterface& rootFrequencySet() const = 0;
216 
220  virtual std::shared_ptr<const FrequencySetInterface> getRootFrequencySet() const = 0;
221 
226 
230  virtual std::shared_ptr<FrequencySetInterface> getRootFrequencySet() = 0;
231 
237  virtual double getProbabilityForModel(size_t classIndex) const = 0;
238 
243  virtual Vdouble getClassProbabilities() const = 0;
244 
250  virtual double getRateForModel(size_t classIndex) const = 0;
251 
257  // virtual bool transitionProbabilitiesHaveChanged() const = 0; Not sure we need that anymore...
258 };
259 } // end namespace bpp
260 #endif // BPP_PHYL_LIKELIHOOD_SUBSTITUTIONPROCESS_H
Interface for all Branch models.
Parametrize a set of state frequencies.
Definition: FrequencySet.h:29
PhyloTree with Parametrizable Phylo Branches. They SHARE their branch length parameters.
Map the states of a given alphabet which have a model state.
Definition: StateMap.h:25
This interface describes the substitution process along the tree and sites of the alignment.
virtual std::shared_ptr< const DiscreteDistributionInterface > getRateDistribution() const =0
Get a pointer to the rate distribution (or null if there is no rate distribution).
virtual ParameterList getSubstitutionModelParameters(bool independent) const =0
Methods to retrieve the parameters of specific objects.
virtual const FrequencySetInterface & rootFrequencySet() const =0
virtual const ParametrizablePhyloTree & parametrizablePhyloTree() const =0
virtual size_t getNumberOfClasses() const =0
virtual FrequencySetInterface & rootFrequencySet()=0
virtual const BranchModelInterface & model(unsigned int nodeId, size_t classIndex) const =0
Get the substitution model corresponding to a certain branch, site pattern, and model class.
virtual const DiscreteDistributionInterface & rateDistribution() const =0
Get the rate distribution.
virtual bool isCompatibleWith(const AlignmentDataInterface &data) const =0
virtual bool hasRootFrequencySet() const =0
virtual double getProbabilityForModel(size_t classIndex) const =0
virtual size_t getNumberOfStates() const =0
virtual std::shared_ptr< const BranchModelInterface > getModel(size_t i) const =0
virtual const std::vector< unsigned int > getNodesWithModel(size_t i) const =0
Get a list of nodes id for which the given model is associated.
virtual Vdouble getClassProbabilities() const =0
virtual DiscreteDistributionInterface & rateDistribution()=0
Get the rate distribution.
virtual size_t getNumberOfModels() const =0
virtual std::shared_ptr< const StateMapInterface > getStateMap() const =0
virtual const std::vector< double > & getRootFrequencies() const =0
Get the values of the frequencies for each state in the alphabet at the root node.
virtual std::vector< size_t > getModelNumbers() const =0
virtual const StateMapInterface & stateMap() const =0
virtual const BranchModelInterface & model(size_t i) const =0
virtual size_t getModelNumberForNode(unsigned int nodeId) const =0
Get the number of the model associated to a particular node id.
virtual ParameterList getRootFrequenciesParameters(bool independent) const =0
virtual std::shared_ptr< const FrequencySetInterface > getRootFrequencySet() const =0
virtual SubstitutionProcessInterface * clone() const =0
virtual std::shared_ptr< const BranchModelInterface > getModel(unsigned int nodeId, size_t classIndex) const =0
Get the substitution model corresponding to a certain branch, site pattern, and model class.
virtual double getRateForModel(size_t classIndex) const =0
virtual std::shared_ptr< const BranchModelInterface > getModelForNode(unsigned int nodeId) const =0
Get the model associated to a particular node id.
virtual std::shared_ptr< FrequencySetInterface > getRootFrequencySet()=0
virtual ParameterList getNonDerivableParameters() const =0
virtual ParameterList getRateDistributionParameters(bool independent) const =0
virtual std::shared_ptr< const ModelScenario > getModelScenario() const =0
Get the Model Scenario associated with this process, in case there are mixture models involved.
virtual std::shared_ptr< DiscreteDistributionInterface > getRateDistribution()=0
Get a pointer to the rate distribution (or null if there is no rate distribution).
virtual ParameterList getBranchLengthParameters(bool independent) const =0
virtual std::shared_ptr< const ParametrizablePhyloTree > getParametrizablePhyloTree() const =0
Defines the basic types of data flow nodes.
std::vector< double > Vdouble