bpp-phyl  2.2.0
MG94.cpp
Go to the documentation of this file.
1 //
2 // File: MG94.cpp
3 // Created by: Laurent Gueguen
4 // Created on: July 2009
5 //
6 
7 /*
8 Copyright or © or Copr. CNRS, (November 16, 2004)
9 This software is a computer program whose purpose is to provide classes
10 for phylogenetic data analysis.
11 
12 This software is governed by the CeCILL license under French law and
13 abiding by the rules of distribution of free software. You can use,
14 modify and/ or redistribute the software under the terms of the CeCILL
15 license as circulated by CEA, CNRS and INRIA at the following URL
16 "http://www.cecill.info".
17 
18 As a counterpart to the access to the source code and rights to copy,
19 modify and redistribute granted by the license, users are provided only
20 with a limited warranty and the software's author, the holder of the
21 economic rights, and the successive licensors have only limited
22 liability.
23 
24 In this respect, the user's attention is drawn to the risks associated
25 with loading, using, modifying and/or developing or reproducing the
26 software by the user in light of its specific status of free software,
27 that may mean that it is complicated to manipulate, and that also
28 therefore means that it is reserved for developers and experienced
29 professionals having in-depth computer knowledge. Users are therefore
30 encouraged to load and test the software's suitability as regards their
31 requirements in conditions enabling the security of their systems and/or
32 data to be ensured and, more generally, to use and operate it in the
33 same conditions as regards security.
34 
35 The fact that you are presently reading this means that you have had
36 knowledge of the CeCILL license and that you accept its terms.
37 */
38 
39 #include "MG94.h"
40 #include "../FrequenciesSet/CodonFrequenciesSet.h"
41 #include "../Nucleotide/K80.h"
42 
43 using namespace bpp;
44 
45 using namespace std;
46 
47 /******************************************************************************/
48 
49 MG94::MG94(const GeneticCode* gc, FrequenciesSet* codonFreqs) :
51  pmodel_(new CodonDistancePhaseFrequenciesSubstitutionModel(gc, new K80(dynamic_cast<const CodonAlphabet*>(gc->getSourceAlphabet())->getNucleicAlphabet()), codonFreqs))
52 {
53  addParameter_(new Parameter("MG94.rho", 1, &Parameter::R_PLUS_STAR));
54 
55  pmodel_->setNamespace("MG94.");
56  addParameters_(codonFreqs->getParameters());
57 
58  lParPmodel_.addParameters(pmodel_->getParameters());
59 
60  vector<std::string> v=pmodel_->getFrequenciesSet()->getParameters().getParameterNames();
61  for (unsigned int i=0;i<v.size();i++)
62  mapParNamesFromPmodel_[v[i]]=getParameterNameWithoutNamespace(v[i]);
63 
64  mapParNamesFromPmodel_["MG94.beta"]="rho";
65 
67 }
68 
69 MG94::MG94(const MG94& mg94) :
71  pmodel_(new CodonDistancePhaseFrequenciesSubstitutionModel(*mg94.pmodel_))
72 {}
73 
74 MG94& MG94::operator=(const MG94& mg94)
75 {
78  return *this;
79 }
80 
82 
83 
std::map< std::string, std::string > mapParNamesFromPmodel_
Tools to make the link between the Parameters of the object and those of pmixmodel_.
Partial implementation of the SubstitutionModel interface for models that are set for matching the bi...
STL namespace.
The Kimura 2-rates substitution model for nucleotides.
Definition: K80.h:150
AbstractBiblioSubstitutionModel & operator=(const AbstractBiblioSubstitutionModel &model)
Parametrize a set of state frequencies.
~MG94()
Definition: MG94.cpp:81
MG94 & operator=(const MG94 &mg94)
Definition: MG94.cpp:74
The Muse and Gaut (1994) substitution model for codons.
Definition: MG94.h:79
MG94(const GeneticCode *gc, FrequenciesSet *codonFreqs)
Definition: MG94.cpp:49
Class for asynonymous substitution models on codons with parameterized equilibrium frequencies and nu...
std::auto_ptr< CodonDistancePhaseFrequenciesSubstitutionModel > pmodel_
Definition: MG94.h:84