bpp-phyl  2.2.0
AbstractCodonDistanceSubstitutionModel.h
Go to the documentation of this file.
1 //
2 // File: AbstractCodonDistanceSubstitutionModel.h
3 // Created by: Laurent Gueguen
4 // Created on: jeudi 15 septembre 2011, à 21h 11
5 //
6 
7 /*
8  Copyright or © or Copr. Bio++ Development Team, (November 16, 2004)
9 
10  This software is a computer program whose purpose is to provide classes
11  for phylogenetic data analysis.
12 
13  This software is governed by the CeCILL license under French law and
14  abiding by the rules of distribution of free software. You can use,
15  modify and/ or redistribute the software under the terms of the CeCILL
16  license as circulated by CEA, CNRS and INRIA at the following URL
17  "http://www.cecill.info".
18 
19  As a counterpart to the access to the source code and rights to copy,
20  modify and redistribute granted by the license, users are provided only
21  with a limited warranty and the software's author, the holder of the
22  economic rights, and the successive licensors have only limited
23  liability.
24 
25  In this respect, the user's attention is drawn to the risks associated
26  with loading, using, modifying and/or developing or reproducing the
27  software by the user in light of its specific status of free software,
28  that may mean that it is complicated to manipulate, and that also
29  therefore means that it is reserved for developers and experienced
30  professionals having in-depth computer knowledge. Users are therefore
31  encouraged to load and test the software's suitability as regards their
32  requirements in conditions enabling the security of their systems and/or
33  data to be ensured and, more generally, to use and operate it in the
34  same conditions as regards security.
35 
36  The fact that you are presently reading this means that you have had
37  knowledge of the CeCILL license and that you accept its terms.
38  */
39 
40 #ifndef _ABSTRACTCODONDISTANCESUBSTITUTIONMODEL_H_
41 #define _ABSTRACTCODONDISTANCESUBSTITUTIONMODEL_H_
42 
43 #include "CodonSubstitutionModel.h"
44 #include <Bpp/Numeric/AbstractParameterAliasable.h>
45 
46 
47 // From bpp-seq:
48 #include <Bpp/Seq/GeneticCode/GeneticCode.h>
49 #include <Bpp/Seq/AlphabetIndex/AlphabetIndex2.h>
50 
51 namespace bpp
52 {
82  public virtual CodonSubstitutionModel,
83  public virtual AbstractParameterAliasable
84 {
85 private:
86  const AlphabetIndex2* pdistance_;
87 
88  double alpha_, beta_;
89 
90  double gamma_;
91 public:
102  const AlphabetIndex2* pdist,
103  const std::string& prefix,
104  bool paramSynRate = false);
105 
107  AbstractParameterAliasable(model),
108  pdistance_(model.pdistance_),
109  alpha_(model.alpha_),
110  beta_(model.beta_),
111  gamma_(model.gamma_)
112  {}
113 
116  {
117  AbstractParameterAliasable::operator=(model);
118  pdistance_ = model.pdistance_;
119  alpha_ = model.alpha_;
120  beta_ = model.beta_;
121  gamma_ = model.gamma_;
122  return *this;
123  }
124 
126 
127 public:
128  void fireParameterChanged(const ParameterList& parameters);
129 
130 public:
131  double getCodonsMulRate(size_t i, size_t j) const;
132 };
133 
134 } // end of namespace bpp.
135 
136 #endif
137 
double getCodonsMulRate(size_t i, size_t j) const
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
AbstractCodonDistanceSubstitutionModel(const AlphabetIndex2 *pdist, const std::string &prefix, bool paramSynRate=false)
Build a new AbstractCodonDistanceSubstitutionModel object from a pointer to NucleotideSubstitutionMod...
Abstract class for modelling of non-synonymous abd synonymous substitution rates in codon models...
AbstractCodonDistanceSubstitutionModel(const AbstractCodonDistanceSubstitutionModel &model)
Abstract class for codon models.
AbstractCodonDistanceSubstitutionModel & operator=(const AbstractCodonDistanceSubstitutionModel &model)