bpp-phyl3 3.0.0
MG94.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_MG94_H
6#define BPP_PHYL_MODEL_CODON_MG94_H
7
8
9#include "../AbstractBiblioSubstitutionModel.h"
11
12namespace bpp
13{
46class MG94 :
49{
50private:
51 std::unique_ptr<CodonDistancePhaseFrequenciesSubstitutionModel> pmodel_;
52
53public:
54 MG94(
55 std::shared_ptr<const GeneticCode> gc,
56 std::unique_ptr<CodonFrequencySetInterface> codonFreqs);
57
58 MG94(const MG94& mg94);
59
60 MG94& operator=(const MG94& mg94);
61
62 virtual ~MG94();
63
64 MG94* clone() const override { return new MG94(*this); }
65
66public:
67 std::string getName() const override { return "MG94"; }
68
69 const SubstitutionModelInterface& substitutionModel() const override { return *pmodel_; }
70
71 std::shared_ptr<const GeneticCode> getGeneticCode() const override { return pmodel_->getGeneticCode(); }
72
73 double getCodonsMulRate(size_t i, size_t j) const override { return pmodel_->getCodonsMulRate(i, j); }
74
76 {
77 return pmodel_->codonFrequencySet();
78 }
79
80 bool hasCodonFrequencySet() const override
81 {
82 return pmodel_->hasCodonFrequencySet();
83 }
84
85 void setFreq(std::map<int, double>& frequencies) override
86 {
88 }
89
90protected:
92};
93} // end of namespace bpp.
94#endif // BPP_PHYL_MODEL_CODON_MG94_H
void setFreq(std::map< int, double > &frequ) override
Set equilibrium frequencies.
Parametrize a set of state frequencies for codons.
Interface for reversible codon models.
The Muse and Gaut (1994) substitution model for codons.
Definition: MG94.h:49
MG94 * clone() const override
Definition: MG94.h:64
std::unique_ptr< CodonDistancePhaseFrequenciesSubstitutionModel > pmodel_
Definition: MG94.h:51
SubstitutionModelInterface & substitutionModel_() override
Definition: MG94.h:91
void setFreq(std::map< int, double > &frequencies) override
Set equilibrium frequencies.
Definition: MG94.h:85
MG94(std::shared_ptr< const GeneticCode > gc, std::unique_ptr< CodonFrequencySetInterface > codonFreqs)
Definition: MG94.cpp:14
const SubstitutionModelInterface & substitutionModel() const override
Definition: MG94.h:69
std::string getName() const override
Get the name of the model.
Definition: MG94.h:67
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...
Definition: MG94.h:73
MG94 & operator=(const MG94 &mg94)
Definition: MG94.cpp:60
const CodonFrequencySetInterface & codonFrequencySet() const override
Definition: MG94.h:75
std::shared_ptr< const GeneticCode > getGeneticCode() const override
Definition: MG94.h:71
virtual ~MG94()
Definition: MG94.cpp:67
bool hasCodonFrequencySet() const override
Definition: MG94.h:80
Interface for all substitution models.
Defines the basic types of data flow nodes.