bpp-phyl3  3.0.0
GY94.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 "GY94.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("GY94."),
25  gacd_(new GranthamAAChemicalDistance()),
27  gc,
28  make_unique<K80>(gc->codonAlphabet().getNucleicAlphabet()),
29  std::move(codonFreqs),
30  gacd_))
31 {
32  addParameter_(new Parameter("GY94.kappa", 1, Parameter::R_PLUS_STAR));
33  addParameter_(new Parameter("GY94.V", 10000, Parameter::R_PLUS_STAR));
34 
35  pmodel_->setNamespace("GY94.");
36  addParameters_(pmodel_->frequencySet().getParameters());
37 
38  lParPmodel_.addParameters(pmodel_->getParameters());
39 
40  vector<std::string> v = pmodel_->frequencySet().getParameters().getParameterNames();
41  for (unsigned int i = 0; i < v.size(); i++)
42  {
44  }
45 
46  mapParNamesFromPmodel_["GY94.123_K80.kappa"] = "kappa";
47  mapParNamesFromPmodel_["GY94.alpha"] = "V";
48 
50 }
51 
52 GY94::GY94(const GY94& gy94) :
61  gacd_(),
62  pmodel_(new CodonDistanceFrequenciesSubstitutionModel(*gy94.pmodel_))
63 {}
64 
65 GY94& GY94::operator=(const GY94& gy94)
66 {
69  return *this;
70 }
71 
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 Goldman and Yang (1994) substitution model for codons.
Definition: GY94.h:50
virtual ~GY94()
Definition: GY94.cpp:72
std::unique_ptr< CodonDistanceFrequenciesSubstitutionModel > pmodel_
Definition: GY94.h:53
GY94 & operator=(const GY94 &gy94)
Definition: GY94.cpp:65
GY94(std::shared_ptr< const GeneticCode > gc, std::unique_ptr< CodonFrequencySetInterface > codonFreqs)
Definition: GY94.cpp:14
The Kimura 2-rates substitution model for nucleotides.
Definition: K80.h:116
virtual void addParameters(const ParameterList &params)
static const std::shared_ptr< IntervalConstraint > R_PLUS_STAR
virtual std::string getParameterNameWithoutNamespace(const std::string &name) const=0
Defines the basic types of data flow nodes.