3
// Created by: Laurent Gueguen
4
// Created on: jeudi 21 octobre 2010, à 13h 50
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 "MixtureOfSubstitutionModels.h"
44
#include "ProteinSubstitutionModel.h"
45
#include "AbstractSubstitutionModel.h"
53
* @brief The Le et al (2008) EX3 substitution model for proteins.
54
* @author Laurent Guéguen
56
* This model is a mixture of three models corresponding to
57
* buried/intermediate/highly exposed sites in proteins. The models
58
* are considered in this order.
61
* This model includes 4 parameters :
63
* - relrate1 is the relative rate of model of buried sites;
64
* - relrate2 is the relative rate of intermediate sites;
65
* - relproba1 is the proportion of buried sites;
66
* - relproba2 is the ratio of the proportions of intermediate sites
67
* over the sum of the proportion of intermediate sites plus the
68
* proportion of highly exposed sites.
70
* Important: See the relation between these parameters and the
71
* rates and probabilities of the models in the description of
72
* MixtureOfSubstitutionModels class.
76
* Le S.Q., Lartillot N., Gascuel O. (2008) Phil. Trans. R. Soc. B 363:3965--3976.
80
public AbstractMixedSubstitutionModel
84
public virtual ProteinSubstitutionModel,
85
public AbstractReversibleSubstitutionModel
91
EmbeddedModel(const ProteicAlphabet* alpha, string name);
93
EmbeddedModel* clone() const { return new EmbeddedModel(*this); }
94
string getName() const { return name_;}
95
double getProportion() const { return proportion_;}
99
MixtureOfSubstitutionModels* pmixmodel_;
103
* @brief Tools to make the link between the Parameters of the
104
* object and those of pmixmodel_.
108
std::map<std::string,std::string> mapParNamesFromPmodel_;
110
ParameterList lParPmodel_;
116
* @brief Build a EX3 model, with original equilibrium frequencies, probabilities and rates.
118
* @param alpha A proteic alphabet.
122
LLG08_EX3(const ProteicAlphabet* alpha);
126
LLG08_EX3* clone() const { return new LLG08_EX3(*this); }
128
LLG08_EX3(const LLG08_EX3&);
130
LLG08_EX3& operator=(const LLG08_EX3&);
132
unsigned int getNumberOfStates() const { return pmixmodel_->getNumberOfStates(); }
135
void updateMatrices();
138
const SubstitutionModel* getNModel(unsigned int i) const {
139
return pmixmodel_->getNModel(i);
142
SubstitutionModel* getNModel(unsigned int i) {
143
return pmixmodel_->getNModel(i);
147
* @brief Returns the probability of a specific model from the mixture
150
double getNProbability(unsigned int i) const {
151
return pmixmodel_->getNProbability(i);
154
const std::vector<double>& getProbabilities() const {
155
return pmixmodel_->getProbabilities();
158
unsigned int getNumberOfModels() const {
159
return pmixmodel_->getNumberOfModels();
162
std::string getName() const { return "LLG08_EX3"; }
164
void setVRates(Vdouble & vd);
166
double Pij_t(unsigned int i, unsigned int j, double t) const {
167
return pmixmodel_->Pij_t(i,j,t);
169
double dPij_dt(unsigned int i, unsigned int j, double t) const {
170
return pmixmodel_->dPij_dt(i,j,t);
172
double d2Pij_dt2(unsigned int i, unsigned int j, double t) const {
173
return pmixmodel_->dPij_dt(i,j,t);
175
const Matrix<double>& getPij_t(double t) const {
176
return pmixmodel_->getPij_t(t);
178
const Matrix<double>& getdPij_dt(double t) const {
179
return pmixmodel_->getdPij_dt(t);
181
const Matrix<double>& getd2Pij_dt2(double t) const {
182
return pmixmodel_->getd2Pij_dt2(t);
185
const Vdouble& getFrequencies() const {
186
return pmixmodel_->getFrequencies();
189
double freq(unsigned int i) const {
190
return pmixmodel_->freq(i);
193
void setFreq(std::map<int,double>& m);
197
} //end of namespace bpp.
199
#endif //_LLG08_EX3_H_