bpp-phyl  2.2.0
CodonDistanceFrequenciesSubstitutionModel.cpp
Go to the documentation of this file.
1 //
2 // File: CodonDistanceFrequenciesSubstitutionModel.cpp
3 // Created by: Laurent Gueguen
4 // Created on: Feb 2009
5 //
6 
7 /*
8  Copyright or © or Copr. Bio++ Development Team, (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 
40 
41 using namespace bpp;
42 
43 using namespace std;
44 
45 /******************************************************************************/
46 
48  const GeneticCode* gCode,
50  FrequenciesSet* pfreq,
51  const AlphabetIndex2* pdist,
52  bool paramSynRate) :
53  AbstractParameterAliasable("CodonDistFreq."),
54  AbstractCodonSubstitutionModel(gCode, pmod, "CodonDistFreq."),
55  AbstractCodonDistanceSubstitutionModel(pdist, "CodonDistFreq.", paramSynRate),
56  AbstractCodonFrequenciesSubstitutionModel(pfreq, "CodonDistFreq.")
57 {
59 }
60 
62  const GeneticCode* gCode,
66  FrequenciesSet* pfreq,
67  const AlphabetIndex2* pdist,
68  bool paramSynRate) :
69  AbstractParameterAliasable("CodonDistFreq."),
70  AbstractCodonSubstitutionModel(gCode, pmod1, pmod2, pmod3, "CodonDistFreq."),
71  AbstractCodonDistanceSubstitutionModel(pdist, "CodonDistFreq.", paramSynRate),
72  AbstractCodonFrequenciesSubstitutionModel(pfreq, "CodonDistFreq.")
73 {
75 }
76 
78 {
79  return "CodonDistFreq";
80 }
81 
83 {
86 
87  // Beware: must be call at the end
89 }
90 
92 {
96 }
97 
99 {
100  AbstractParameterAliasable::setNamespace(st);
102  AbstractCodonDistanceSubstitutionModel::setNamespace(st);
104 }
105 
106 void CodonDistanceFrequenciesSubstitutionModel::setFreq(map<int,double>& frequencies)
107 {
109 }
double getCodonsMulRate(size_t i, size_t j) const
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
void setFreq(std::map< int, double > &frequencies)
Set equilibrium frequencies.
virtual void fireParameterChanged(const ParameterList &parameters)
Tells the model that a parameter value has changed.
STL namespace.
Parametrize a set of state frequencies.
Abstract class for modelling of non-synonymous abd synonymous substitution rates in codon models...
CodonDistanceFrequenciesSubstitutionModel(const GeneticCode *gCode, NucleotideSubstitutionModel *pmod, FrequenciesSet *pfreq, const AlphabetIndex2 *pdist=0, bool paramSynRate=false)
Build a new CodonDistanceFrequenciesSubstitutionModel object from three pointers to AbstractSubstitut...
void updateMatrices()
Diagonalize the matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVe...
void fireParameterChanged(const ParameterList &parameterlist)
Tells the model that a parameter value has changed.
Specialisation interface for nucleotide substitution model.
double getCodonsMulRate(size_t, size_t) const
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
Abstract Class for substitution models on codons parametrized by frequencies.
double getCodonsMulRate(size_t i, size_t j) const
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
Abstract class for substitution models on codons.
void setFreq(std::map< int, double > &frequencies)
Set equilibrium frequencies.
virtual double getCodonsMulRate(size_t i, size_t j) const
Method inherited from CodonSubstitutionModel.