bpp-phyl  2.2.0
AbstractCodonPhaseFrequenciesSubstitutionModel.h
Go to the documentation of this file.
1 //
2 // File: AbstractCodonPhaseFrequenciesSubstitutionModel.h
3 // Created by: vendredi 23 septembre 2011, à 16h 29
4 //
5 
6 /*
7  Copyright or © or Copr. Bio++ Development Team, (November 16, 2004)
8 
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 #ifndef _ABSTRACTCODONPHASEFREQUENCIESSUBSTITUTIONMODEL_H_
40 #define _ABSTRACTCODONPHASEFREQUENCIESSUBSTITUTIONMODEL_H_
41 
43 #include "../FrequenciesSet/CodonFrequenciesSet.h"
44 
45 namespace bpp
46 {
70  public virtual CodonSubstitutionModel,
71  public virtual AbstractParameterAliasable
72 {
73 private:
78  std::string freqName_;
79 
80 public:
89  FrequenciesSet* pfreq,
90  const std::string& prefix);
91 
93  AbstractParameterAliasable(model),
94  posfreqset_(model.posfreqset_->clone()),
95  freqName_(model.freqName_)
96  {}
97 
99  {
100  AbstractParameterAliasable::operator=(model);
101  if (posfreqset_)
102  delete posfreqset_;
103  posfreqset_ = model.posfreqset_->clone();
104  freqName_ = model.freqName_;
105 
106  return *this;
107  }
108 
110 
111  void fireParameterChanged(const ParameterList& parameters);
112 
113  void setFreq(std::map<int, double>& frequencies);
114 
115  const FrequenciesSet* getFrequenciesSet() const { return posfreqset_; }
116 
117  void setNamespace(const std::string& prefix)
118  {
119  posfreqset_->setNamespace(prefix + freqName_);
120  }
121 
122  double getCodonsMulRate(size_t, size_t) const;
123 };
124 } // end of namespace bpp.
125 
126 #endif
127 
Abstract Class for substitution models on codons parametrized by a frequency.
WordFrequenciesSet * posfreqset_
Position dependent version of Codon Frequencies Set.
const FrequenciesSet * getFrequenciesSet() const
If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0.
Parametrize a set of state frequencies.
AbstractCodonPhaseFrequenciesSubstitutionModel & operator=(const AbstractCodonPhaseFrequenciesSubstitutionModel &model)
Frequencies in words computed from the frequencies on letters. The parameters are the parameters of t...
void setFreq(std::map< int, double > &frequencies)
Set equilibrium frequencies.
AbstractCodonPhaseFrequenciesSubstitutionModel(FrequenciesSet *pfreq, const std::string &prefix)
Build a AbstractCodonPhaseFrequenciesSubstitutionModel instance.
Abstract class for codon models.
WordFrequenciesSet * clone() const =0
AbstractCodonPhaseFrequenciesSubstitutionModel(const AbstractCodonPhaseFrequenciesSubstitutionModel &model)
virtual CodonSubstitutionModel * clone() const =0
double getCodonsMulRate(size_t, size_t) const
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...