Debian Codegraph @

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

raw symbols SCIP
1 /*
2 * JTT.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 * JTT model for amino acid evolution
38 * D.T. Jones, W.R. Taylor, and J.M. Thornton
39 * The rapid generation of mutation data matrices from protein sequences
40 * CABIOS vol. 8 no. 3 1992 pp. 275-282
41 *
42 * @version $Id: JTT.java,v 1.3 2005/05/24 20:25:58 rambaut Exp $
43 *
44 * @author Andrew Rambaut
45 * @author Alexei Drummond
46 */
47 public class JTT extends EmpiricalRateMatrix.AbstractAminoAcid {
48
49 public static final JTT INSTANCE = new JTT();
50
51 // The rates below are specified assuming that the amino acids are in this order:
52 // ARNDCQEGHILKMFPSTWYV
53 // but the AminoAcids dataType wants them in this order:
54 // ACDEFGHIKLMNPQRSTVWY
55 // This is solved by calling the setEmpiricalRates and setEmpiricalFrequencies methods
56 private JTT() { super("JTT");
57
58 int n = AminoAcids.INSTANCE.getStateCount();
59
60 double[][] rate = new double[n][n];
61
62 // Q matrix
63 rate[0][1]=3.1628651460584e+00; rate[0][2]=3.2804935927860e+00;
64 rate[0][3]=4.8477237048666e+00; rate[0][4]=3.4612244897959e+00;
65 rate[0][5]=3.3130910900946e+00; rate[0][6]=6.3199473337722e+00;
66 rate[0][7]=1.0440154440154e+01; rate[0][8]=1.3061224489796e+00;
67 rate[0][9]=2.1726844583987e+00; rate[0][10]=1.8443597219107e+00;
68 rate[0][11]=2.2137668626773e+00; rate[0][12]=2.7210884353741e+00;
69 rate[0][13]=8.3265306122449e-01; rate[0][14]=1.1537414965986e+01;
70 rate[0][15]=2.2838213546288e+01; rate[0][16]=2.7007955724663e+01;
71 rate[0][17]=5.1311953352770e-01; rate[0][18]=8.3673469387755e-01;
72 rate[0][19]=1.7474335188621e+01;
73
74 rate[1][2]=2.6598918637222e+00; rate[1][3]=9.1014867485456e-01;
75 rate[1][4]=6.1624649859944e+00; rate[1][5]=1.8036482885837e+01;
76 rate[1][6]=1.8924731182796e+00; rate[1][7]=8.1810886516769e+00;
77 rate[1][8]=1.9119717452198e+01; rate[1][9]=1.4410687351864e+00;
78 rate[1][10]=2.2211961707760e+00; rate[1][11]=3.9239234676922e+01;
79 rate[1][12]=2.5060690943044e+00; rate[1][13]=3.9439775910364e-01;
80 rate[1][14]=4.1953094963476e+00; rate[1][15]=5.9016766126741e+00;
81 rate[1][16]=3.8437069743152e+00; rate[1][17]=7.6766706682673e+00;
82 rate[1][18]=1.4173669467787e+00; rate[1][19]=1.0308123249300e+00;
83
84 rate[2][3]=3.2226935854843e+01; rate[2][4]=1.8710963455150e+00;
85 rate[2][5]=4.5351268130622e+00; rate[2][6]=3.3951344979102e+00;
86 rate[2][7]=4.5987249708180e+00; rate[2][8]=2.3693774375271e+01;
87 rate[2][9]=2.9235880398671e+00; rate[2][10]=8.0960899565551e-01;
88 rate[2][11]=1.5024269384537e+01; rate[2][12]=1.9003322259136e+00;
89 rate[2][13]=4.3853820598007e-01; rate[2][14]=7.1083317047749e-01;
90 rate[2][15]=2.9456208772690e+01; rate[2][16]=1.3735908553410e+01;
91 rate[2][17]=1.6706217370669e-01; rate[2][18]=4.1661129568106e+00;
92 rate[2][19]=9.7452934662237e-01;
93
94 rate[3][4]=6.2857142857143e-01; rate[3][5]=3.0662020905923e+00;
95 rate[3][6]=4.5450549450549e+01; rate[3][7]=7.5402435402435e+00;
96 rate[3][8]=6.0544672718586e+00; rate[3][9]=6.8808114961961e-01;
97 rate[3][10]=3.6130902064968e-01; rate[3][11]=1.6718197057180e+00;
98 rate[3][12]=1.0879120879121e+00; rate[3][13]=1.9340659340659e-01;
99 rate[3][14]=7.3949579831933e-01; rate[3][15]=3.4196528109572e+00;
100 rate[3][16]=2.4749487800335e+00; rate[3][17]=3.4536891679749e-01;
101 rate[3][18]=2.6895604395604e+00; rate[3][19]=1.8608058608059e+00;
102
103 rate[4][5]=5.5191637630662e-01; rate[4][6]=3.2442396313364e-01;
104 rate[4][7]=3.3297297297297e+00; rate[4][8]=4.3726708074534e+00;
105 rate[4][9]=9.1868131868132e-01; rate[4][10]=9.9466248037677e-01;
106 rate[4][11]=2.9830508474576e-01; rate[4][12]=2.4095238095238e+00;
107 rate[4][13]=4.1485714285714e+00; rate[4][14]=7.3949579831933e-01;
108 rate[4][15]=1.2862939958592e+01; rate[4][16]=2.8125907990315e+00;
109 rate[4][17]=6.8244897959184e+00; rate[4][18]=1.2885714285714e+01;
110 rate[4][19]=3.7714285714286e+00;
111
112 rate[5][6]=2.0316061593796e+01; rate[5][7]=1.3922214897825e+00;
113 rate[5][8]=3.3861536130889e+01; rate[5][9]=4.7172339855267e-01;
114 rate[5][10]=4.2320327755868e+00; rate[5][11]=1.7835941652395e+01;
115 rate[5][12]=2.6573751451800e+00; rate[5][13]=2.7595818815331e-01;
116 rate[5][14]=9.4992143198743e+00; rate[5][15]=3.2350653941322e+00;
117 rate[5][16]=3.0973838067678e+00; rate[5][17]=1.0512692882031e+00;
118 rate[5][18]=1.5331010452962e+00; rate[5][19]=1.0778164924506e+00;
119
120 rate[6][7]=6.6857641051189e+00; rate[6][8]=1.4458024443999e+00;
121 rate[6][9]=6.7068415455512e-01; rate[6][10]=5.7932850559579e-01;
122 rate[6][11]=1.0365070686558e+01; rate[6][12]=1.0138248847926e+00;
123 rate[6][13]=2.6359447004608e-01; rate[6][14]=1.1291226167887e+00;
124 rate[6][15]=1.8337006611901e+00; rate[6][16]=1.9520424900414e+00;
125 rate[6][17]=6.9519420671494e-01; rate[6][18]=3.8018433179723e-01;
126 rate[6][19]=2.7772657450077e+00;
127
128 rate[7][8]=1.2113479939567e+00; rate[7][9]=3.2670032670033e-01;
129 rate[7][10]=4.1817641817642e-01; rate[7][11]=1.6354950592239e+00;
130 rate[7][12]=7.6447876447876e-01; rate[7][13]=3.0579150579151e-01;
131 rate[7][14]=1.2391551215081e+00; rate[7][15]=1.1138492529797e+01;
132 rate[7][16]=1.8888816176952e+00; rate[7][17]=3.3491450634308e+00;
133 rate[7][18]=3.1853281853282e-01; rate[7][19]=2.8416988416988e+00;
134
135 rate[8][9]=1.0931677018634e+00; rate[8][10]=3.2194389461470e+00;
136 rate[8][11]=3.1498052426571e+00; rate[8][12]=1.9130434782609e+00;
137 rate[8][13]=2.7329192546584e+00; rate[8][14]=6.7304834977469e+00;
138 rate[8][15]=4.3726708074534e+00; rate[8][16]=2.8162964522581e+00;
139 rate[8][17]=7.8083407275954e-01; rate[8][18]=3.5118012422360e+01;
140 rate[8][19]=7.2877846790890e-01;
141
142 rate[9][10]=1.4069798333535e+01; rate[9][11]=1.2292791953809e+00;
143 rate[9][12]=2.8366300366300e+01; rate[9][13]=4.7384615384615e+00;
144 rate[9][14]=5.8780435251023e-01; rate[9][15]=2.4105749323141e+00;
145 rate[9][16]=1.5243062022723e+01; rate[9][17]=8.2888540031397e-01;
146 rate[9][18]=1.8434065934066e+00; rate[9][19]=5.7699633699634e+01;
147
148 rate[10][11]=8.8039805231089e-01; rate[10][12]=2.2425954997384e+01;
149 rate[10][13]=1.5099529042386e+01; rate[10][14]=6.2626896912611e+00;
150 rate[10][15]=3.4917298022888e+00; rate[10][16]=1.6109411169944e+00;
151 rate[10][17]=3.2366001345593e+00; rate[10][18]=1.4505494505495e+00;
152 rate[10][19]=1.0557823129252e+01;
153
154 rate[11][12]=3.6577885391445e+00; rate[11][13]=1.4915254237288e-01;
155 rate[11][14]=1.2868062479229e+00; rate[11][15]=2.8162964522581e+00;
156 rate[11][16]=5.7494151926786e+00; rate[11][17]=5.4790729851263e-01;
157 rate[11][18]=5.3268765133172e-01; rate[11][19]=7.4899112187248e-01;
158
159 rate[12][13]=2.5666666666667e+00; rate[12][14]=9.4491129785247e-01;
160 rate[12][15]=1.6397515527950e+00; rate[12][16]=1.2180790960452e+01;
161 rate[12][17]=1.1972789115646e+00; rate[12][18]=1.1130952380952e+00;
162 rate[12][19]=1.7746031746032e+01;
163
164 rate[13][14]=8.8739495798319e-01; rate[13][15]=5.6298136645963e+00;
165 rate[13][16]=8.3099273607748e-01; rate[13][17]=3.3224489795918e+00;
166 rate[13][18]=3.3392857142857e+01; rate[13][19]=3.6000000000000e+00;
167
168 rate[14][15]=1.6261762676085e+01; rate[14][16]=6.8852490148602e+00;
169 rate[14][17]=4.2256902761104e-01; rate[14][18]=6.7787114845938e-01;
170 rate[14][19]=1.2549019607843e+00;
171
172 rate[15][16]=2.7891216619293e+01; rate[15][17]=1.8740017746229e+00;
173 rate[15][18]=3.7349896480331e+00; rate[15][19]=2.4182194616977e+00;
174
175 rate[16][17]=4.8702870978900e-01; rate[16][18]=1.1985472154964e+00;
176 rate[16][19]=6.7925746569814e+00;
177
178 rate[17][18]=4.6020408163265e+00; rate[17][19]=1.4693877551020e+00;
179
180 rate[18][19]=1.0000000000000e+00;
181
182 setEmpiricalRates(rate, "ARNDCQEGHILKMFPSTWYV");
183
184 double[] f = new double[n];
185 f[0] = 0.077; f[1] = 0.051; f[2] = 0.043; f[3] = 0.052;
186 f[4] = 0.02; f[5] = 0.041; f[6] = 0.062; f[7] = 0.074;
187 f[8] = 0.023; f[9] = 0.052; f[10] = 0.091; f[11] = 0.059;
188 f[12] = 0.024; f[13] = 0.04; f[14] = 0.051; f[15] = 0.069;
189 f[16] = 0.059; f[17] = 0.014; f[18] = 0.032; f[19] = 0.066;
190 setEmpiricalFrequencies(f, "ARNDCQEGHILKMFPSTWYV");
191 }
192
193 @Override
194 public Citation.Category getCategory() {
195 return Citation.Category.SUBSTITUTION_MODELS;
196 }
197
198 @Override
199 public String getDescription() {
200 return "JTT amino acid substitution model";
201 }
202
203 @Override
204 public List<Citation> getCitations() {
205 return Collections.singletonList(CITATION);
206 }
207
208 public static Citation CITATION = new Citation(
209 new Author[]{
210 new Author("DT", "Jones"),
211 new Author("WR", "Taylor"),
212 new Author("JM", "Thornton")
213 },
214 "The rapid generation of mutation data matrices from protein sequences",
215 1992,
216 "CABIOS",
217 8,
218 275, 282,
219 Citation.Status.PUBLISHED
220 );
221 }