bpp-phyl  2.2.0
YN98.h
Go to the documentation of this file.
1 //
2 // File: YN98.h
3 // Created by: Laurent Gueguen
4 // Created on: July 2009
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 _YN98_H_
41 #define _YN98_H_
42 
43 #include "../AbstractBiblioSubstitutionModel.h"
45 
46 namespace bpp
47 {
88 class YN98 :
90  public virtual CodonSubstitutionModel,
91  public virtual ReversibleSubstitutionModel
92 {
93 private:
94  std::auto_ptr<CodonDistanceFrequenciesSubstitutionModel> pmodel_;
95 
96 public:
97  YN98(const GeneticCode* gc, FrequenciesSet* codonFreqs);
98 
99  YN98(const YN98& yn98);
100 
101  YN98& operator=(const YN98&);
102 
103  virtual ~YN98() {}
104 
105  YN98* clone() const { return new YN98(*this); }
106 
107 public:
108  std::string getName() const { return "YN98"; }
109 
110  const SubstitutionModel& getModel() const { return *pmodel_.get(); }
111 
112  const GeneticCode* getGeneticCode() const { return pmodel_->getGeneticCode(); }
113 
114  double getCodonsMulRate(size_t i, size_t j) const { return pmodel_->getCodonsMulRate(i, j); }
115 
116 private:
117  SubstitutionModel& getModel() { return *pmodel_.get(); }
118 
119 };
120 
121 } // end of namespace bpp.
122 
123 #endif // _YN98_H_
124 
const GeneticCode * getGeneticCode() const
Definition: YN98.h:112
Interface for all substitution models.
std::string getName() const
Get the name of the model.
Definition: YN98.h:108
Partial implementation of the SubstitutionModel interface for models that are set for matching the bi...
std::auto_ptr< CodonDistanceFrequenciesSubstitutionModel > pmodel_
Definition: YN98.h:94
const SubstitutionModel & getModel() const
Definition: YN98.h:110
Parametrize a set of state frequencies.
YN98(const GeneticCode *gc, FrequenciesSet *codonFreqs)
Definition: YN98.cpp:51
Interface for reversible substitution models.
double getCodonsMulRate(size_t i, size_t j) const
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
Definition: YN98.h:114
The Yang and Nielsen (1998) substitution model for codons.
Definition: YN98.h:88
virtual ~YN98()
Definition: YN98.h:103
YN98 & operator=(const YN98 &)
Definition: YN98.cpp:80
YN98 * clone() const
Definition: YN98.h:105
SubstitutionModel & getModel()
Definition: YN98.h:117
Abstract class for codon models.