bpp-phyl3  3.0.0
CodonDistancePhaseFrequenciesSubstitutionModel.cpp
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
6 
7 using namespace bpp;
8 using namespace std;
9 
10 /******************************************************************************/
11 
13  std::shared_ptr<const GeneticCode> gCode,
14  std::unique_ptr<NucleotideSubstitutionModelInterface> pmod,
15  std::unique_ptr<CodonFrequencySetInterface> pfreq,
16  std::shared_ptr<const AlphabetIndex2> pdist) :
17  AbstractParameterAliasable("CodonDistPhasFreq."),
18  AbstractCodonSubstitutionModel(gCode, std::move(pmod), "CodonDistPhasFreq."),
19  AbstractCodonDistanceSubstitutionModel(pdist, gCode, "CodonDistPhasFreq."),
20  AbstractCodonPhaseFrequenciesSubstitutionModel(std::move(pfreq), "CodonDistPhasFreq.")
21 {
22  computeFrequencies(true); // for init
24  computeFrequencies(false);
25 }
26 
28  std::shared_ptr<const GeneticCode> gCode,
29  std::unique_ptr<NucleotideSubstitutionModelInterface> pmod1,
30  std::unique_ptr<NucleotideSubstitutionModelInterface> pmod2,
31  std::unique_ptr<NucleotideSubstitutionModelInterface> pmod3,
32  std::unique_ptr<CodonFrequencySetInterface> pfreq,
33  std::shared_ptr<const AlphabetIndex2> pdist) :
34  AbstractParameterAliasable("CodonDistPhasFreq."),
35  AbstractCodonSubstitutionModel(gCode, std::move(pmod1), std::move(pmod2), std::move(pmod3), "CodonDistPhasFreq."),
36  AbstractCodonDistanceSubstitutionModel(pdist, gCode, "CodonDistPhasFreq."),
37  AbstractCodonPhaseFrequenciesSubstitutionModel(std::move(pfreq), "CodonDistPhasFreq.")
38 {
39  computeFrequencies(true);
41  computeFrequencies(false);
42 }
43 
45 {
46  return "CodonDistPhasFreq";
47 }
48 
50 {
54 
55  // Beware: must be call at the end
57 }
58 
60 {
63 }
64 
66 {
71 }
72 
74 {
77 }
Abstract class for modelling of non-synonymous and synonymous substitution rates in codon models.
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
Abstract Class for substitution models on codons parametrized by a frequency.
const CodonFrequencySetInterface & codonFrequencySet() const override
double getCodonsMulRate(size_t, size_t) const override
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
Abstract class for substitution models on codons.
void updateMatrices_() override
Diagonalize the matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVe...
void setNamespace(const std::string &prefix) override
void setNamespace(const std::string &prefix)
virtual void fireParameterChanged(const ParameterList &parameters) override
Tells the model that a parameter value has changed.
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...
CodonDistancePhaseFrequenciesSubstitutionModel(std::shared_ptr< const GeneticCode > gCode, std::unique_ptr< NucleotideSubstitutionModelInterface > pmod, std::unique_ptr< CodonFrequencySetInterface > pfreq, std::shared_ptr< const AlphabetIndex2 > pdist=nullptr)
Build a new CodonDistancePhaseFrequenciesSubstitutionModel object from three pointers to AbstractSubs...
virtual const Vdouble & getFrequencies() const =0
Defines the basic types of data flow nodes.