Debian Codegraph @

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

raw symbols SCIP
1 /*
2 * CPREV.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 * CPREV 45 model of amino acid evolution
38 * Adachi, J., P.J. Waddell, W. Martin, and M. Hasegawa. 2000. JME 50:348-358
39 *
40 * @version $Id: CPREV.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 CPREV extends EmpiricalRateMatrix.AbstractAminoAcid {
46
47 public static final CPREV INSTANCE = new CPREV();
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 CPREV() { super("cpREV45");
55
56 int n = AminoAcids.INSTANCE.getStateCount();
57
58 double[][] rate = new double[n][n];
59
60 // Q matrix
61 rate[0][1] = 105; rate[0][2] = 227;
62 rate[0][3] = 175; rate[0][4] = 669;
63 rate[0][5] = 157; rate[0][6] = 499;
64 rate[0][7] = 665; rate[0][8] = 66;
65 rate[0][9] = 145; rate[0][10] = 197;
66 rate[0][11] = 236; rate[0][12] = 185;
67 rate[0][13] = 68; rate[0][14] = 490;
68 rate[0][15] = 2440; rate[0][16] = 1340;
69 rate[0][17] = 14; rate[0][18] = 56;
70 rate[0][19] = 968;
71
72 rate[1][2] = 357; rate[1][3] = 43;
73 rate[1][4] = 823; rate[1][5] = 1745;
74 rate[1][6] = 152; rate[1][7] = 243;
75 rate[1][8] = 715; rate[1][9] = 136;
76 rate[1][10] = 203; rate[1][11] = 4482;
77 rate[1][12] = 125; rate[1][13] = 53;
78 rate[1][14] = 87; rate[1][15] = 385;
79 rate[1][16] = 314; rate[1][17] = 230;
80 rate[1][18] = 323; rate[1][19] = 92;
81
82 rate[2][3] = 4435; rate[2][4] = 538;
83 rate[2][5] = 768; rate[2][6] = 1055;
84 rate[2][7] = 653; rate[2][8] = 1405;
85 rate[2][9] = 168; rate[2][10] = 113;
86 rate[2][11] = 2430; rate[2][12] = 61;
87 rate[2][13] = 97; rate[2][14] = 173;
88 rate[2][15] = 2085; rate[2][16] = 1393;
89 rate[2][17] = 40; rate[2][18] = 754;
90 rate[2][19] = 83;
91
92 rate[3][4] = 10; rate[3][5] = 400;
93 rate[3][6] = 3691; rate[3][7] = 431;
94 rate[3][8] = 331; rate[3][9] = 10;
95 rate[3][10] = 10; rate[3][11] = 412;
96 rate[3][12] = 47; rate[3][13] = 22;
97 rate[3][14] = 170; rate[3][15] = 590;
98 rate[3][16] = 266; rate[3][17] = 18;
99 rate[3][18] = 281; rate[3][19] = 75;
100
101 rate[4][5] = 10; rate[4][6] = 10;
102 rate[4][7] = 303; rate[4][8] = 441;
103 rate[4][9] = 280; rate[4][10] = 396;
104 rate[4][11] = 48; rate[4][12] = 159;
105 rate[4][13] = 726; rate[4][14] = 285;
106 rate[4][15] = 2331; rate[4][16] = 576;
107 rate[4][17] = 435; rate[4][18] = 1466;
108 rate[4][19] = 592;
109
110 rate[5][6] = 3122; rate[5][7] = 133;
111 rate[5][8] = 1269; rate[5][9] = 92;
112 rate[5][10] = 286; rate[5][11] = 3313;
113 rate[5][12] = 202; rate[5][13] = 10;
114 rate[5][14] = 323; rate[5][15] = 396;
115 rate[5][16] = 241; rate[5][17] = 53;
116 rate[5][18] = 391; rate[5][19] = 54;
117
118 rate[6][7] = 379; rate[6][8] = 162;
119 rate[6][9] = 148; rate[6][10] = 82;
120 rate[6][11] = 2629; rate[6][12] = 113;
121 rate[6][13] = 145; rate[6][14] = 185;
122 rate[6][15] = 568; rate[6][16] = 369;
123 rate[6][17] = 63; rate[6][18] = 142;
124 rate[6][19] = 200;
125
126 rate[7][8] = 19; rate[7][9] = 40;
127 rate[7][10] = 20; rate[7][11] = 263;
128 rate[7][12] = 21; rate[7][13] = 25;
129 rate[7][14] = 28; rate[7][15] = 691;
130 rate[7][16] = 92; rate[7][17] = 82;
131 rate[7][18] = 10; rate[7][19] = 91;
132
133 rate[8][9] = 29; rate[8][10] = 66;
134 rate[8][11] = 305; rate[8][12] = 10;
135 rate[8][13] = 127; rate[8][14] = 152;
136 rate[8][15] = 303; rate[8][16] = 32;
137 rate[8][17] = 69; rate[8][18] = 1971;
138 rate[8][19] = 25;
139
140 rate[9][10] = 1745; rate[9][11] = 345;
141 rate[9][12] = 1772; rate[9][13] = 454;
142 rate[9][14] = 117; rate[9][15] = 216;
143 rate[9][16] = 1040; rate[9][17] = 42;
144 rate[9][18] = 89; rate[9][19] = 4797;
145
146 rate[10][11] = 218; rate[10][12] = 1351;
147 rate[10][13] = 1268; rate[10][14] = 219;
148 rate[10][15] = 516; rate[10][16] = 156;
149 rate[10][17] = 159; rate[10][18] = 189;
150 rate[10][19] = 865;
151
152 rate[11][12] = 193; rate[11][13] = 72;
153 rate[11][14] = 302; rate[11][15] = 868;
154 rate[11][16] = 918; rate[11][17] = 10;
155 rate[11][18] = 247; rate[11][19] = 249;
156
157 rate[12][13] = 327; rate[12][14] = 100;
158 rate[12][15] = 93; rate[12][16] = 645;
159 rate[12][17] = 86; rate[12][18] = 215;
160 rate[12][19] = 475;
161
162 rate[13][14] = 43; rate[13][15] = 487;
163 rate[13][16] = 148; rate[13][17] = 468;
164 rate[13][18] = 2370; rate[13][19] = 317;
165
166 rate[14][15] = 1202; rate[14][16] = 260;
167 rate[14][17] = 49; rate[14][18] = 97;
168 rate[14][19] = 122;
169
170 rate[15][16] = 2151; rate[15][17] = 73;
171 rate[15][18] = 522; rate[15][19] = 167;
172
173 rate[16][17] = 29; rate[16][18] = 71;
174 rate[16][19] = 760;
175
176 rate[17][18] = 346; rate[17][19] = 10;
177
178 rate[18][19] = 119;
179
180 setEmpiricalRates(rate, "ARNDCQEGHILKMFPSTWYV");
181
182 double[] f = new double[n];
183 f[0] = 0.076;
184 f[1] = 0.062;
185 f[2] = 0.041;
186 f[3] = 0.037;
187 f[4] = 0.009;
188 f[5] = 0.038;
189 f[6] = 0.049;
190 f[7] = 0.084;
191 f[8] = 0.025;
192 f[9] = 0.081;
193 f[10] = 0.101;
194 f[11] = 0.050;
195 f[12] = 0.022;
196 f[13] = 0.051;
197 f[14] = 0.043;
198 f[15] = 0.062;
199 f[16] = 0.054;
200 f[17] = 0.018;
201 f[18] = 0.031;
202 f[19] = 0.066;
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 "CPREV 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("J", "Adachi"),
224 new Author("PJ", "Waddell"),
225 new Author("W", "Martin"),
226 new Author("M", "Hasegawa")
227 },
228 "Plastid Genome Phylogeny and a Model of Amino Acid Substitution for Proteins Encoded by Chloroplast DNA",
229 2000,
230 "J Mol Evol",
231 50,
232 348, 358,
233 Citation.Status.PUBLISHED
234 );
235 }