bpp-phyl3  3.0.0
AbstractCodonCpGSubstitutionModel.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_ABSTRACTCODONCPGSUBSTITUTIONMODEL_H
6 #define BPP_PHYL_MODEL_CODON_ABSTRACTCODONCPGSUBSTITUTIONMODEL_H
7 
9 
10 #include "CodonSubstitutionModel.h"
11 
12 namespace bpp
13 {
29  public virtual AbstractParameterAliasable
30 {
31 private:
32  double rho_;
33 
34  std::shared_ptr<const StateMapInterface> stateMap_;
35 
36 public:
45  std::shared_ptr<const CodonAlphabet> alphabet,
46  const std::string& prefix);
47 
50  rho_(model.rho_),
51  stateMap_(model.stateMap_)
52  {}
53 
56  {
58  rho_ = model.rho_;
59  stateMap_ = model.stateMap_;
60  return *this;
61  }
62 
64  {
65  return new AbstractCodonCpGSubstitutionModel(*this);
66  }
67 
69 
70 public:
71  void fireParameterChanged(const ParameterList& parameters) override;
72 
73  double getCodonsMulRate(size_t i, size_t j) const override;
74 
76  {
77  throw NullPointerException("AbstractCodonCpGSubstitutionModel::frequencySet. No associated FrequencySet.");
78  }
79 
80  bool hasCodonFrequencySet() const override
81  {
82  return false;
83  }
84 
85  void setFreq(std::map<int, double>& frequencies) override {}
86 };
87 } // end of namespace bpp.
88 #endif // BPP_PHYL_MODEL_CODON_ABSTRACTCODONCPGSUBSTITUTIONMODEL_H
Abstract class for modelling of CpG -> CpA or TpG (symmetric) hypermutability substitution rate insid...
std::shared_ptr< const StateMapInterface > stateMap_
const CodonFrequencySetInterface & codonFrequencySet() const override
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...
void setFreq(std::map< int, double > &frequencies) override
AbstractCodonCpGSubstitutionModel & operator=(const AbstractCodonCpGSubstitutionModel &model)
AbstractCodonCpGSubstitutionModel(const AbstractCodonCpGSubstitutionModel &model)
AbstractCodonCpGSubstitutionModel * clone() const override
void fireParameterChanged(const ParameterList &parameters) override
AbstractCodonCpGSubstitutionModel(std::shared_ptr< const CodonAlphabet > alphabet, const std::string &prefix)
Build a new AbstractCodonCpGSubstitutionModel object from a pointer to NucleotideSubstitutionModel.
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
Parametrize a set of state frequencies for codons.
Defines the basic types of data flow nodes.