bpp-phyl3  3.0.0
AbstractCodonFrequenciesSubstitutionModel.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  unique_ptr<CodonFrequencySetInterface> pfreq,
14  const string& prefix) :
16  pfreqset_(std::move(pfreq)),
17  freqName_("")
18 {
19  freqName_ = pfreqset_->getNamespace();
20  pfreqset_->setNamespace(prefix + freqName_);
21  addParameters_(pfreqset_->getParameters());
22 }
23 
24 /******************************************************************************/
25 
27 
28 /******************************************************************************/
29 
31 {
32  pfreqset_->matchParametersValues(parameters);
33 }
34 
35 /******************************************************************************/
36 
37 void AbstractCodonFrequenciesSubstitutionModel::setFreq(map<int, double>& frequencies)
38 {
39  pfreqset_->setFrequenciesFromAlphabetStatesFrequencies(frequencies);
40  matchParametersValues(pfreqset_->getParameters());
41 }
42 
43 /******************************************************************************/
44 
46 {
47  return pfreqset_->getFrequencies()[j];
48 }
49 
50 /******************************************************************************/
void setFreq(std::map< int, double > &frequencies) override
void fireParameterChanged(const ParameterList &parameters) override
double getCodonsMulRate(size_t, size_t) const override
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
AbstractCodonFrequenciesSubstitutionModel(std::unique_ptr< CodonFrequencySetInterface > pfreq, const std::string &prefix)
Build a AbstractCodonFrequenciesSubstitutionModel instance.
void addParameters_(const ParameterList &parameters)
bool matchParametersValues(const ParameterList &parameters) override
Defines the basic types of data flow nodes.