bpp-phyl3  3.0.0
AbstractCodonClusterAASubstitutionModel.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_ABSTRACTCODONCLUSTERAASUBSTITUTIONMODEL_H
6 #define BPP_PHYL_MODEL_CODON_ABSTRACTCODONCLUSTERAASUBSTITUTIONMODEL_H
7 
9 
10 #include "CodonSubstitutionModel.h"
11 
12 // From bpp-seq:
15 
16 namespace bpp
17 {
54  public virtual AbstractParameterAliasable
55 {
56 private:
57  std::shared_ptr<const GeneticCode> pgencode_;
58 
59  double omegaR_, omegaC_;
60 
61  std::vector<uint> assign_;
62 
63  std::shared_ptr<const StateMapInterface> stateMap_;
64 
65 public:
75  std::shared_ptr<const GeneticCode> pgencode,
76  const std::string& prefix,
77  const std::vector<uint>& assign = {1, 2, 3, 3, 3, 2, 2, 1, 2, 4, 4, 2, 4, 4, 1, 3, 3, 2, 2, 1});
78 
81  pgencode_(model.pgencode_),
82  omegaR_(model.omegaR_),
83  omegaC_(model.omegaC_),
84  assign_(model.assign_),
85  stateMap_(model.stateMap_)
86  {}
87 
90  {
92  pgencode_ = model.pgencode_;
93  omegaR_ = model.omegaR_;
94  omegaC_ = model.omegaC_;
95  assign_ = model.assign_;
96  stateMap_ = model.stateMap_;
97 
98  return *this;
99  }
100 
102  {
103  return new AbstractCodonClusterAASubstitutionModel(*this);
104  }
105 
107 
108 public:
109  void fireParameterChanged(const ParameterList& parameters) override;
110 
111  double getCodonsMulRate(size_t i, size_t j) const override;
112 
114  {
115  throw NullPointerException("AbstractCodonClusterAASubstitutionModel::frequencySet. No associated FrequencySet.");
116  }
117 
118  bool hasCodonFrequencySet() const override
119  {
120  return false;
121  }
122 
123  const std::vector<uint>& getAssign() const
124  {
125  return assign_;
126  }
127 
128  void setFreq(std::map<int, double>& frequencies) override {}
129 };
130 } // end of namespace bpp.
131 #endif // BPP_PHYL_MODEL_CODON_ABSTRACTCODONCLUSTERAASUBSTITUTIONMODEL_H
Abstract class for modelling of non-synonymous and synonymous substitution rates in codon models,...
void fireParameterChanged(const ParameterList &parameters) override
AbstractCodonClusterAASubstitutionModel(const AbstractCodonClusterAASubstitutionModel &model)
void setFreq(std::map< int, double > &frequencies) override
const CodonFrequencySetInterface & codonFrequencySet() const override
AbstractCodonClusterAASubstitutionModel(std::shared_ptr< const GeneticCode > pgencode, const std::string &prefix, const std::vector< uint > &assign={1, 2, 3, 3, 3, 2, 2, 1, 2, 4, 4, 2, 4, 4, 1, 3, 3, 2, 2, 1})
Build a new AbstractCodonClusterAASubstitutionModel object.
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...
AbstractCodonClusterAASubstitutionModel & operator=(const AbstractCodonClusterAASubstitutionModel &model)
AbstractCodonClusterAASubstitutionModel * clone() const override
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
Parametrize a set of state frequencies for codons.
Defines the basic types of data flow nodes.