Debian Codegraph @

src/dr/oldevomodel/substmodel/CPREV.java

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