bpp-phyl3 3.0.0
YN98.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_YN98_H
6#define BPP_PHYL_MODEL_CODON_YN98_H
7
8
9#include "../AbstractBiblioSubstitutionModel.h"
11
12namespace bpp
13{
54class YN98 :
57{
58private:
59 std::unique_ptr<CodonDistanceFrequenciesSubstitutionModel> pmodel_;
60
61public:
62 YN98(
63 std::shared_ptr<const GeneticCode> gc,
64 std::unique_ptr<CodonFrequencySetInterface> codonFreqs);
65
66 YN98(const YN98& yn98);
67
68 YN98& operator=(const YN98&);
69
70 virtual ~YN98() {}
71
72 YN98* clone() const override { return new YN98(*this); }
73
74public:
75 std::string getName() const override { return "YN98"; }
76
77 const SubstitutionModelInterface& substitutionModel() const override { return *pmodel_; }
78
79 std::shared_ptr<const GeneticCode> getGeneticCode() const override
80 {
81 return pmodel_->getGeneticCode();
82 }
83
84 const FrequencySetInterface& frequencySet() const override
85 {
87 }
88
89 double getCodonsMulRate(size_t i, size_t j) const override
90 {
91 return pmodel_->getCodonsMulRate(i, j);
92 }
93
95 {
96 return pmodel_->codonFrequencySet();
97 }
98
99 bool hasCodonFrequencySet() const override
100 {
101 return pmodel_->hasCodonFrequencySet();
102 }
103
104 void setFreq(std::map<int, double>& frequencies) override
105 {
107 }
108
110
111protected:
113};
114} // end of namespace bpp.
115#endif // BPP_PHYL_MODEL_CODON_YN98_H
void setFreq(std::map< int, double > &frequ) override
Set equilibrium frequencies.
const FrequencySetInterface & frequencySet() const override
const FrequencySetInterface & frequencySet() const override
Parametrize a set of state frequencies for codons.
Interface for reversible codon models.
Parametrize a set of state frequencies.
Definition: FrequencySet.h:29
Interface for all substitution models.
The Yang and Nielsen (1998) substitution model for codons.
Definition: YN98.h:57
YN98 & operator=(const YN98 &)
Definition: YN98.cpp:64
void setFreq(std::map< int, double > &frequencies) override
Set equilibrium frequencies.
Definition: YN98.h:104
const FrequencySetInterface & frequencySet() const override
Definition: YN98.h:84
const SubstitutionModelInterface & substitutionModel() const override
Definition: YN98.h:77
std::unique_ptr< CodonDistanceFrequenciesSubstitutionModel > pmodel_
Definition: YN98.h:59
virtual ~YN98()
Definition: YN98.h:70
std::string getName() const override
Get the name of the model.
Definition: YN98.h:75
bool hasCodonFrequencySet() const override
Definition: YN98.h:99
SubstitutionModelInterface & substitutionModel_() override
Definition: YN98.h:112
std::shared_ptr< const GeneticCode > getGeneticCode() const override
Definition: YN98.h:79
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: YN98.h:89
YN98 * clone() const override
Definition: YN98.h:72
const CodonFrequencySetInterface & codonFrequencySet() const override
Definition: YN98.h:94
YN98(std::shared_ptr< const GeneticCode > gc, std::unique_ptr< CodonFrequencySetInterface > codonFreqs)
Definition: YN98.cpp:16
Defines the basic types of data flow nodes.