bpp-phyl3  3.0.0
AbstractCodonDistanceSubstitutionModel.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_ABSTRACTCODONDISTANCESUBSTITUTIONMODEL_H
6 #define BPP_PHYL_MODEL_CODON_ABSTRACTCODONDISTANCESUBSTITUTIONMODEL_H
7 
9 
10 #include "CodonSubstitutionModel.h"
11 
12 // From bpp-seq:
15 
16 namespace bpp
17 {
47  public virtual AbstractParameterAliasable
48 {
49 private:
50  std::shared_ptr<const AlphabetIndex2> pdistance_;
51 
52  std::shared_ptr<const GeneticCode> pgencode_;
53 
54  double alpha_, beta_;
55 
56  double gamma_;
57 
58  std::shared_ptr<const StateMapInterface> stateMap_;
59 
60 public:
71  std::shared_ptr<const AlphabetIndex2> pdist,
72  std::shared_ptr<const GeneticCode> pgencode,
73  const std::string& prefix,
74  bool paramSynRate = false);
75 
78  pdistance_(model.pdistance_),
79  pgencode_(model.pgencode_),
80  alpha_(model.alpha_),
81  beta_(model.beta_),
82  gamma_(model.gamma_),
83  stateMap_(model.stateMap_)
84  {}
85 
88  {
90  pdistance_ = model.pdistance_;
91  pgencode_ = model.pgencode_;
92  alpha_ = model.alpha_;
93  beta_ = model.beta_;
94  gamma_ = model.gamma_;
95  stateMap_ = model.stateMap_;
96 
97  return *this;
98  }
99 
101  {
102  return new AbstractCodonDistanceSubstitutionModel(*this);
103  }
104 
106 
107 public:
108  void fireParameterChanged(const ParameterList& parameters) override;
109 
110  double getCodonsMulRate(size_t i, size_t j) const override;
111 
113  {
114  throw NullPointerException("AbstractCodonDistanceSubstitutionModel::frequencySet. No associated FrequencySet.");
115  }
116 
117  bool hasCodonFrequencySet() const override
118  {
119  return false;
120  }
121 
122  void setFreq(std::map<int, double>& frequencies) override {}
123 };
124 } // end of namespace bpp.
125 #endif // BPP_PHYL_MODEL_CODON_ABSTRACTCODONDISTANCESUBSTITUTIONMODEL_H
Abstract class for modelling of non-synonymous and synonymous substitution rates in codon models.
AbstractCodonDistanceSubstitutionModel & operator=(const AbstractCodonDistanceSubstitutionModel &model)
double getCodonsMulRate(size_t i, size_t j) const override
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
AbstractCodonDistanceSubstitutionModel(const AbstractCodonDistanceSubstitutionModel &model)
const CodonFrequencySetInterface & codonFrequencySet() const override
AbstractCodonDistanceSubstitutionModel(std::shared_ptr< const AlphabetIndex2 > pdist, std::shared_ptr< const GeneticCode > pgencode, const std::string &prefix, bool paramSynRate=false)
Build a new AbstractCodonDistanceSubstitutionModel object.
void setFreq(std::map< int, double > &frequencies) override
AbstractCodonDistanceSubstitutionModel * clone() const override
void fireParameterChanged(const ParameterList &parameters) override
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
Parametrize a set of state frequencies for codons.
Defines the basic types of data flow nodes.