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
11
12// From bpp-seq:
15
16namespace bpp
17{
54 public virtual AbstractParameterAliasable
55{
56private:
57 std::shared_ptr<const GeneticCode> pgencode_;
58
60
61 std::vector<uint> assign_;
62
63 std::shared_ptr<const StateMapInterface> stateMap_;
64
65public:
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 {
104 }
105
107
108public:
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
const CodonFrequencySetInterface & codonFrequencySet() const override
AbstractCodonClusterAASubstitutionModel * clone() const override
AbstractCodonClusterAASubstitutionModel(const AbstractCodonClusterAASubstitutionModel &model)
void setFreq(std::map< int, double > &frequencies) override
AbstractCodonClusterAASubstitutionModel & operator=(const AbstractCodonClusterAASubstitutionModel &model)
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...
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
Parametrize a set of state frequencies for codons.
Defines the basic types of data flow nodes.