bpp-phyl3 3.0.0
AbstractCodonBGCSubstitutionModel.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_ABSTRACTCODONBGCSUBSTITUTIONMODEL_H
6#define BPP_PHYL_MODEL_CODON_ABSTRACTCODONBGCSUBSTITUTIONMODEL_H
7
9
11
12// From bpp-seq:
15
16namespace bpp
17{
44 public virtual AbstractParameterAliasable
45{
46private:
47 std::shared_ptr<const GeneticCode> pgencode_;
48
49 double B_, S_;
50
51 std::shared_ptr<const StateMapInterface> stateMap_;
52
53public:
61 std::shared_ptr<const GeneticCode> pgencode,
62 const std::string& prefix);
63
66 pgencode_(model.pgencode_),
67 B_(model.B_),
68 S_(model.S_),
69 stateMap_(model.stateMap_)
70 {}
71
74 {
76 pgencode_ = model.pgencode_;
77 B_ = model.B_;
78 S_ = model.S_;
79 stateMap_ = model.stateMap_;
80
81 return *this;
82 }
83
85 {
86 return new AbstractCodonBGCSubstitutionModel(*this);
87 }
88
90
91public:
92 void fireParameterChanged(const ParameterList& parameters) override;
93
94 double getCodonsMulRate(size_t i, size_t j) const override;
95
97 {
98 throw NullPointerException("AbstractCodonBGCSubstitutionModel::frequencySet. No associated FrequencySet.");
99 }
100
101 bool hasCodonFrequencySet() const override
102 {
103 return false;
104 }
105
106 void setFreq(std::map<int, double>& frequencies) override {}
107};
108} // end of namespace bpp.
109#endif // BPP_PHYL_MODEL_CODON_ABSTRACTCODONBGCSUBSTITUTIONMODEL_H
Abstract class for modelling of non-synonymous and synonymous substitution rates in codon models,...
AbstractCodonBGCSubstitutionModel(std::shared_ptr< const GeneticCode > pgencode, const std::string &prefix)
Build a new AbstractCodonBGCSubstitutionModel object.
AbstractCodonBGCSubstitutionModel(const AbstractCodonBGCSubstitutionModel &model)
void setFreq(std::map< int, double > &frequencies) override
std::shared_ptr< const StateMapInterface > stateMap_
AbstractCodonBGCSubstitutionModel * clone() const override
AbstractCodonBGCSubstitutionModel & operator=(const AbstractCodonBGCSubstitutionModel &model)
std::shared_ptr< const GeneticCode > pgencode_
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 fireParameterChanged(const ParameterList &parameters) override
const CodonFrequencySetInterface & codonFrequencySet() const override
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
Parametrize a set of state frequencies for codons.
Defines the basic types of data flow nodes.