Debian Codegraph @

src/dr/evomodel/substmodel/aminoacid/WAG.java

raw symbols SCIP
1 /*
2 * WAG.java
3 *
4 * Copyright (c) 2002-2016 Alexei Drummond, Andrew Rambaut and Marc Suchard
5 *
6 * This file is part of BEAST.
7 * See the NOTICE file distributed with this work for additional
8 * information regarding copyright ownership and licensing.
9 *
10 * BEAST is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * BEAST is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with BEAST; if not, write to the
22 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23 * Boston, MA 02110-1301 USA
24 */
25
26 package dr.evomodel.substmodel.aminoacid;
27
28 import dr.evomodel.substmodel.EmpiricalRateMatrix;
29 import dr.evolution.datatype.AminoAcids;
30 import dr.util.Author;
31 import dr.util.Citation;
32
33 import java.util.Collections;
34 import java.util.List;
35
36 /**
37 * WAG model of amino acid evolution (S. Whelan and N. Goldman 2000)
38 * Whelan, S. and N. Goldman. 2000. Bioinformatics ?.
39 *
40 * @version $Id: WAG.java,v 1.3 2005/05/24 20:25:58 rambaut Exp $
41 *
42 * @author Andrew Rambaut
43 * @author Alexei Drummond
44 */
45 public class WAG extends EmpiricalRateMatrix.AbstractAminoAcid {
46
47 public static final WAG INSTANCE = new WAG();
48
49 // The rates below are specified assuming that the amino acids are in this order:
50 // ARNDCQEGHILKMFPSTWYV
51 // but the AminoAcids dataType wants them in this order:
52 // ACDEFGHIKLMNPQRSTVWY
53 // This is solved by calling the setEmpiricalRates and setEmpiricalFrequencies methods
54 private WAG() { super("WAG");
55
56 int n = AminoAcids.INSTANCE.getStateCount();
57
58 double[][] rate = new double[n][n];
59
60 // Q matrix
61 rate[0][1] = 0.610810; rate[0][2] = 0.569079;
62 rate[0][3] = 0.821500; rate[0][4] = 1.141050;
63 rate[0][5] = 1.011980; rate[0][6] = 1.756410;
64 rate[0][7] = 1.572160; rate[0][8] = 0.354813;
65 rate[0][9] = 0.219023; rate[0][10] = 0.443935;
66 rate[0][11] = 1.005440; rate[0][12] = 0.989475;
67 rate[0][13] = 0.233492; rate[0][14] = 1.594890;
68 rate[0][15] = 3.733380; rate[0][16] = 2.349220;
69 rate[0][17] = 0.125227; rate[0][18] = 0.268987;
70 rate[0][19] = 2.221870;
71
72 rate[1][2] = 0.711690; rate[1][3] = 0.165074;
73 rate[1][4] = 0.585809; rate[1][5] = 3.360330;
74 rate[1][6] = 0.488649; rate[1][7] = 0.650469;
75 rate[1][8] = 2.362040; rate[1][9] = 0.206722;
76 rate[1][10] = 0.551450; rate[1][11] = 5.925170;
77 rate[1][12] = 0.758446; rate[1][13] = 0.116821;
78 rate[1][14] = 0.753467; rate[1][15] = 1.357640;
79 rate[1][16] = 0.613776; rate[1][17] = 1.294610;
80 rate[1][18] = 0.423612; rate[1][19] = 0.280336;
81
82 rate[2][3] = 6.013660; rate[2][4] = 0.296524;
83 rate[2][5] = 1.716740; rate[2][6] = 1.056790;
84 rate[2][7] = 1.253910; rate[2][8] = 4.378930;
85 rate[2][9] = 0.615636; rate[2][10] = 0.147156;
86 rate[2][11] = 3.334390; rate[2][12] = 0.224747;
87 rate[2][13] = 0.110793; rate[2][14] = 0.217538;
88 rate[2][15] = 4.394450; rate[2][16] = 2.257930;
89 rate[2][17] = 0.078463; rate[2][18] = 1.208560;
90 rate[2][19] = 0.221176;
91
92 rate[3][4] = 0.033379; rate[3][5] = 0.691268;
93 rate[3][6] = 6.833400; rate[3][7] = 0.961142;
94 rate[3][8] = 1.032910; rate[3][9] = 0.043523;
95 rate[3][10] = 0.093930; rate[3][11] = 0.533362;
96 rate[3][12] = 0.116813; rate[3][13] = 0.052004;
97 rate[3][14] = 0.472601; rate[3][15] = 1.192810;
98 rate[3][16] = 0.417372; rate[3][17] = 0.146348;
99 rate[3][18] = 0.363243; rate[3][19] = 0.169417;
100
101 rate[4][5] = 0.109261; rate[4][6] = 0.023920;
102 rate[4][7] = 0.341086; rate[4][8] = 0.275403;
103 rate[4][9] = 0.189890; rate[4][10] = 0.428414;
104 rate[4][11] = 0.083649; rate[4][12] = 0.437393;
105 rate[4][13] = 0.441300; rate[4][14] = 0.122303;
106 rate[4][15] = 1.560590; rate[4][16] = 0.570186;
107 rate[4][17] = 0.795736; rate[4][18] = 0.604634;
108 rate[4][19] = 1.114570;
109
110 rate[5][6] = 6.048790; rate[5][7] = 0.366510;
111 rate[5][8] = 4.749460; rate[5][9] = 0.131046;
112 rate[5][10] = 0.964886; rate[5][11] = 4.308310;
113 rate[5][12] = 1.705070; rate[5][13] = 0.110744;
114 rate[5][14] = 1.036370; rate[5][15] = 1.141210;
115 rate[5][16] = 0.954144; rate[5][17] = 0.243615;
116 rate[5][18] = 0.252457; rate[5][19] = 0.333890;
117
118 rate[6][7] = 0.630832; rate[6][8] = 0.635025;
119 rate[6][9] = 0.141320; rate[6][10] = 0.172579;
120 rate[6][11] = 2.867580; rate[6][12] = 0.353912;
121 rate[6][13] = 0.092310; rate[6][14] = 0.755791;
122 rate[6][15] = 0.782467; rate[6][16] = 0.914814;
123 rate[6][17] = 0.172682; rate[6][18] = 0.217549;
124 rate[6][19] = 0.655045;
125
126 rate[7][8] = 0.276379; rate[7][9] = 0.034151;
127 rate[7][10] = 0.068651; rate[7][11] = 0.415992;
128 rate[7][12] = 0.194220; rate[7][13] = 0.055288;
129 rate[7][14] = 0.273149; rate[7][15] = 1.486700;
130 rate[7][16] = 0.251477; rate[7][17] = 0.374321;
131 rate[7][18] = 0.114187; rate[7][19] = 0.209108;
132
133 rate[8][9] = 0.152215; rate[8][10] = 0.555096;
134 rate[8][11] = 0.992083; rate[8][12] = 0.450867;
135 rate[8][13] = 0.756080; rate[8][14] = 0.771387;
136 rate[8][15] = 0.822459; rate[8][16] = 0.525511;
137 rate[8][17] = 0.289998; rate[8][18] = 4.290350;
138 rate[8][19] = 0.131869;
139
140 rate[9][10] = 3.517820; rate[9][11] = 0.360574;
141 rate[9][12] = 4.714220; rate[9][13] = 1.177640;
142 rate[9][14] = 0.111502; rate[9][15] = 0.353443;
143 rate[9][16] = 1.615050; rate[9][17] = 0.234326;
144 rate[9][18] = 0.468951; rate[9][19] = 8.659740;
145
146 rate[10][11] = 0.287583; rate[10][12] = 5.375250;
147 rate[10][13] = 2.348200; rate[10][14] = 0.462018;
148 rate[10][15] = 0.382421; rate[10][16] = 0.364222;
149 rate[10][17] = 0.740259; rate[10][18] = 0.443205;
150 rate[10][19] = 1.997370;
151
152 rate[11][12] = 1.032220; rate[11][13] = 0.098843;
153 rate[11][14] = 0.619503; rate[11][15] = 1.073780;
154 rate[11][16] = 1.537920; rate[11][17] = 0.152232;
155 rate[11][18] = 0.147411; rate[11][19] = 0.342012;
156
157 rate[12][13] = 1.320870; rate[12][14] = 0.194864;
158 rate[12][15] = 0.556353; rate[12][16] = 1.681970;
159 rate[12][17] = 0.570369; rate[12][18] = 0.473810;
160 rate[12][19] = 2.282020;
161
162 rate[13][14] = 0.179896; rate[13][15] = 0.606814;
163 rate[13][16] = 0.191467; rate[13][17] = 1.699780;
164 rate[13][18] = 7.154480; rate[13][19] = 0.725096;
165
166 rate[14][15] = 1.786490; rate[14][16] = 0.885349;
167 rate[14][17] = 0.156619; rate[14][18] = 0.239607;
168 rate[14][19] = 0.351250;
169
170 rate[15][16] = 4.847130; rate[15][17] = 0.578784;
171 rate[15][18] = 0.872519; rate[15][19] = 0.258861;
172
173 rate[16][17] = 0.126678; rate[16][18] = 0.325490;
174 rate[16][19] = 1.547670;
175
176 rate[17][18] = 2.763540; rate[17][19] = 0.409817;
177
178 rate[18][19] = 0.347826;
179
180 setEmpiricalRates(rate, "ARNDCQEGHILKMFPSTWYV");
181
182 double[] f = new double[n];
183 f[0] = 0.0866;
184 f[1] = 0.0440;
185 f[2] = 0.0391;
186 f[3] = 0.0570;
187 f[4] = 0.0193;
188 f[5] = 0.0367;
189 f[6] = 0.0581;
190 f[7] = 0.0833;
191 f[8] = 0.0244;
192 f[9] = 0.0485;
193 f[10] = 0.0862;
194 f[11] = 0.0620;
195 f[12] = 0.0195;
196 f[13] = 0.0384;
197 f[14] = 0.0458;
198 f[15] = 0.0695;
199 f[16] = 0.0610;
200 f[17] = 0.0144;
201 f[18] = 0.0353;
202 f[19] = 0.0709;
203 setEmpiricalFrequencies(f, "ARNDCQEGHILKMFPSTWYV");
204 }
205
206 @Override
207 public Citation.Category getCategory() {
208 return Citation.Category.SUBSTITUTION_MODELS;
209 }
210
211 @Override
212 public String getDescription() {
213 return "WAG amino acid substitution model";
214 }
215
216 @Override
217 public List<Citation> getCitations() {
218 return Collections.singletonList(CITATION);
219 }
220
221 public static Citation CITATION = new Citation(
222 new Author[]{
223 new Author("S", "Whelan"),
224 new Author("N", "Goldman")
225 },
226 "A General Empirical Model of Protein Evolution Derived from Multiple Protein Families Using a Maximum-Likelihood Approach",
227 2001,
228 "Mol Biol Evol",
229 18,
230 691, 699,
231 Citation.Status.PUBLISHED
232 );
233 }