bpp-phyl3  3.0.0
MG94.cpp
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #include "../FrequencySet/CodonFrequencySet.h"
6 #include "../Nucleotide/K80.h"
7 #include "MG94.h"
8 
9 using namespace bpp;
10 using namespace std;
11 
12 /******************************************************************************/
13 
15  std::shared_ptr<const GeneticCode> gc,
16  std::unique_ptr<CodonFrequencySetInterface> codonFreqs) :
18  AbstractWrappedModel("MG94."),
26  gc,
27  make_unique<K80>(gc->codonAlphabet().getNucleicAlphabet()),
28  std::move(codonFreqs)))
29 {
30  addParameter_(new Parameter("MG94.rho", 1, std::make_shared<IntervalConstraint>(0.002, 999, true, true)));
31 
32  pmodel_->setNamespace("MG94.");
33  addParameters_(pmodel_->frequencySet().getParameters());
34 
35  lParPmodel_.addParameters(pmodel_->getParameters());
36 
37  vector<std::string> v = pmodel_->frequencySet().getParameters().getParameterNames();
38  for (unsigned int i = 0; i < v.size(); ++i)
39  {
41  }
42 
43  mapParNamesFromPmodel_["MG94.beta"] = "rho";
44 
46 }
47 
48 MG94::MG94(const MG94& mg94) :
57  pmodel_(new CodonDistancePhaseFrequenciesSubstitutionModel(*mg94.pmodel_))
58 {}
59 
60 MG94& MG94::operator=(const MG94& mg94)
61 {
64  return *this;
65 }
66 
AbstractBiblioSubstitutionModel & operator=(const AbstractBiblioSubstitutionModel &model)
Partial implementation of the SubstitutionModel interface for models that are set for matching the bi...
std::map< std::string, std::string > mapParNamesFromPmodel_
Tools to make the link between the Parameters of the object and those of pmixmodel_.
void addParameters_(const ParameterList &parameters)
void addParameter_(Parameter *parameter)
Abstract class of Wrapping model class, where all methods are redirected from model().
Class for asynonymous substitution models on codons with parameterized equilibrium frequencies and nu...
The Kimura 2-rates substitution model for nucleotides.
Definition: K80.h:116
The Muse and Gaut (1994) substitution model for codons.
Definition: MG94.h:49
std::unique_ptr< CodonDistancePhaseFrequenciesSubstitutionModel > pmodel_
Definition: MG94.h:51
MG94(std::shared_ptr< const GeneticCode > gc, std::unique_ptr< CodonFrequencySetInterface > codonFreqs)
Definition: MG94.cpp:14
MG94 & operator=(const MG94 &mg94)
Definition: MG94.cpp:60
virtual ~MG94()
Definition: MG94.cpp:67
virtual void addParameters(const ParameterList &params)
virtual std::string getParameterNameWithoutNamespace(const std::string &name) const=0
Defines the basic types of data flow nodes.