bpp-phyl3 3.0.0
CodonDistanceSubstitutionModel.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
7using namespace bpp;
8
9using namespace std;
10
11/******************************************************************************/
12
13CodonDistanceSubstitutionModel::CodonDistanceSubstitutionModel(
14 std::shared_ptr<const GeneticCode> gCode,
15 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod,
16 std::shared_ptr<const AlphabetIndex2> pdist) :
17 AbstractParameterAliasable("CodonDist."),
18 AbstractCodonSubstitutionModel(gCode, std::move(pmod), "CodonDist."),
19 AbstractCodonDistanceSubstitutionModel(pdist, gCode, "CodonDist.")
20{
23}
24
26 std::shared_ptr<const GeneticCode> gCode,
27 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod1,
28 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod2,
29 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod3,
30 std::shared_ptr<const AlphabetIndex2> pdist) :
31 AbstractParameterAliasable("CodonDist."),
32 AbstractCodonSubstitutionModel(gCode, std::move(pmod1), std::move(pmod2), std::move(pmod3), "CodonDist."),
33 AbstractCodonDistanceSubstitutionModel(pdist, gCode, "CodonDist.")
34{
37}
38
40{
41 return "CodonDist";
42}
43
45{
47
48 // Beware: must be call at the end
50}
51
53{
55}
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.
void updateMatrices_() override
Diagonalize the matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVe...
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
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
CodonDistanceSubstitutionModel(std::shared_ptr< const GeneticCode > gCode, std::unique_ptr< NucleotideSubstitutionModelInterface > pmod, std::shared_ptr< const AlphabetIndex2 > pdist)
Build a new CodonDistanceSubstitutionModel object from a pointer to NucleotideSubstitutionModel.
void fireParameterChanged(const ParameterList &parameterlist)
std::string getName() const
Get the name of the model.
Defines the basic types of data flow nodes.