bpp-phyl3  3.0.0
DFP07.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_MODEL_CODON_DFP07_H
6 #define BPP_PHYL_MODEL_CODON_DFP07_H
7 
9 
10 #include "../AbstractBiblioMixedTransitionModel.h"
11 #include "../FrequencySet/CodonFrequencySet.h"
12 #include "../MixtureOfASubstitutionModel.h"
13 #include "../Protein/ProteinSubstitutionModel.h"
15 
16 namespace bpp
17 {
49 class DFP07 :
51 {
52 protected:
57 
62  size_t synfrom_, synto_;
63 
64 public:
65  DFP07(
66  std::shared_ptr<const GeneticCode> gCode,
67  std::unique_ptr<ProteinSubstitutionModelInterface> pAAmodel,
68  std::unique_ptr<CodonFrequencySetInterface> codonFreqs);
69 
70  DFP07(const DFP07& mod2) :
77  mixedSubModelPtr_(nullptr),
78  synfrom_(mod2.synfrom_),
79  synto_(mod2.synto_)
80  {
81  mixedSubModelPtr_ = dynamic_cast<const MixtureOfASubstitutionModel*>(&mixedModel());
82  }
83 
84  virtual DFP07* clone() const override
85  {
86  return new DFP07(*this);
87  }
88 
89  DFP07& operator=(const DFP07& mod2)
90  {
91  const auto& eq = AbstractBiblioMixedTransitionModel::operator=(mod2);
92 
93  synfrom_ = mod2.synfrom_;
94  synto_ = mod2.synto_;
95 
96  mixedSubModelPtr_ = dynamic_cast<const MixtureOfASubstitutionModel*>(&eq.mixedModel());
97 
98  return *this;
99  }
100 
102  {
103  return dynamic_cast<const CodonSameAARateSubstitutionModel&>(nModel(0)).proteinModel();
104  }
105 
106  std::string getName() const override { return "DFP07"; }
107 
108 protected:
109  void updateMatrices_() override;
110 };
111 } // end of namespace bpp.
112 #endif // BPP_PHYL_MODEL_CODON_DFP07_H
Abstract class for mixture models based on the bibliography.
AbstractBiblioMixedTransitionModel & operator=(const AbstractBiblioMixedTransitionModel &model)
const MixedTransitionModelInterface & mixedModel() const
const TransitionModelInterface & nModel(size_t i) const override
Returns the submodel from the mixture.
Partial implementation of the SubstitutionModel interface for models that are set for matching the bi...
Abstract class of Wrapping model class, where all methods are redirected from model().
Class for modelling of non-synonymous rates in codon models, such that the substitution rates between...
Class for non-synonymous substitution models on codons with parameterized equilibrium frequencies and...
Definition: DFP07.h:51
size_t synto_
Definition: DFP07.h:62
void updateMatrices_() override
Definition: DFP07.cpp:99
DFP07(const DFP07 &mod2)
Definition: DFP07.h:70
const MixtureOfASubstitutionModel * mixedSubModelPtr_
Definition: DFP07.h:56
const ProteinSubstitutionModelInterface & proteinModel() const
Definition: DFP07.h:101
virtual DFP07 * clone() const override
Definition: DFP07.h:84
std::string getName() const override
Get the name of the model.
Definition: DFP07.h:106
DFP07 & operator=(const DFP07 &mod2)
Definition: DFP07.h:89
size_t synfrom_
indexes of 2 codons states between which the substitution is synonymous, to set a basis to the homoge...
Definition: DFP07.h:62
DFP07(std::shared_ptr< const GeneticCode > gCode, std::unique_ptr< ProteinSubstitutionModelInterface > pAAmodel, std::unique_ptr< CodonFrequencySetInterface > codonFreqs)
Definition: DFP07.cpp:17
Specialized interface for protein substitution model.
Defines the basic types of data flow nodes.