3
// Created by: Laurent Gueguen
4
// Created on: May 2010
8
Copyright or © or Copr. CNRS, (November 16, 2004)
10
This software is a computer program whose purpose is to provide classes
11
for phylogenetic data analysis.
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".
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
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.
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.
43
#include "MixtureOfASubstitutionModel.h"
44
#include "FrequenciesSet.h"
46
#include <Bpp/Seq/GeneticCode/GeneticCode.h>
52
* @brief The Yang et al (2000) M8 substitution model for codons.
53
* @author Laurent Guéguen
55
* This model is a mixture of models as described in YN98 class, the
56
* mixture being defined on the selection parameter oomega to allow it
57
* to vary among sites, following a mixture of a Beta distribution and
58
* of another value above 1.
60
* This model includes 5 parameters (@f$\kappa@f$, @f$ \alpha @f$ and
61
* @f$\beta@f$) of the Beta distribution, @f$p0@f$ the weight of the
62
* Beta distribution and @f$\omega @f$ the selection parameter above 1
63
* (with weight @f$ 1-p0 @f$). The codon frequencies @f$ \pi_j @f$ are
64
* either observed or infered.
68
* Yang, Z., R. Nielsen, N. Goldman, and A.-M. K. Pedersen (2000)
69
* Genetics 155:431-449.
73
public AbstractMixedSubstitutionModel
76
MixtureOfASubstitutionModel* pmixmodel_;
79
*@brief indexes of 2 codons between which the substitution is
80
* synonymous, to set a basis to the homogeneization of the rates.
88
* @brief Tools to make the link between the Parameters of the
89
* object and those of pmixmodel_.
93
std::map<std::string,std::string> mapParNamesFromPmodel_;
95
ParameterList lParPmodel_;
100
*@brief Constructor that requires the number of classes of the
101
* BetaDiscreteDistribution.
105
YNGKP_M8(const GeneticCode* gc, FrequenciesSet* codonFreqs, unsigned int nbclass);
109
YNGKP_M8* clone() const { return new YNGKP_M8(*this); }
111
YNGKP_M8(const YNGKP_M8&);
113
YNGKP_M8& operator=(const YNGKP_M8&);
115
unsigned int getNumberOfStates() const { return pmixmodel_->getNumberOfStates(); }
118
void updateMatrices();
121
const SubstitutionModel* getNModel(unsigned int i) const {
122
return pmixmodel_->getNModel(i);
125
SubstitutionModel* getNModel(unsigned int i) {
126
return pmixmodel_->getNModel(i);
130
* @brief Returns the probability of a specific model from the mixture
133
double getNProbability(unsigned int i) const {
134
return pmixmodel_->getNProbability(i);
137
const std::vector<double>& getProbabilities() const {
138
return pmixmodel_->getProbabilities();
141
unsigned int getNumberOfModels() const {
142
return pmixmodel_->getNumberOfModels();
145
std::string getName() const { return "YNGKP_M8"; }
148
* @brief inactivated method to prevent out of model manipulations
152
void setVRates(Vdouble & vd){};
154
double Pij_t(unsigned int i, unsigned int j, double t) const {
155
return pmixmodel_->Pij_t(i,j,t);
157
double dPij_dt(unsigned int i, unsigned int j, double t) const {
158
return pmixmodel_->dPij_dt(i,j,t);
160
double d2Pij_dt2(unsigned int i, unsigned int j, double t) const {
161
return pmixmodel_->dPij_dt(i,j,t);
163
const Matrix<double>& getPij_t(double t) const {
164
return pmixmodel_->getPij_t(t);
166
const Matrix<double>& getdPij_dt(double t) const {
167
return pmixmodel_->getdPij_dt(t);
169
const Matrix<double>& getd2Pij_dt2(double t) const {
170
return pmixmodel_->getd2Pij_dt2(t);
173
const Vdouble& getFrequencies() const {
174
return pmixmodel_->getFrequencies();
177
double freq(unsigned int i) const {
178
return pmixmodel_->freq(i);
181
void setFreq(std::map<int,double>& m);
183
double getRate() const { return pmixmodel_->getRate();}
185
void setRate(double rate) { pmixmodel_->setRate(rate);}
188
} //end of namespace bpp.
190
#endif //_YNGKP_M8_H_