2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.schemes;
\r
25 public class ResidueProperties
\r
27 //Stores residue codes/names and colours and other things
\r
28 public static final Hashtable aaHash = new Hashtable(); // stores the number value of the aa
\r
29 public static final Hashtable aa3Hash = new Hashtable();
\r
30 public static final Hashtable aa2Triplet = new Hashtable();
\r
31 public static final Hashtable nucleotideHash = new Hashtable();
\r
32 public static final Hashtable nucleotideName = new Hashtable();
\r
36 aaHash.put("A", new Integer(0));
\r
37 aaHash.put("R", new Integer(1));
\r
38 aaHash.put("N", new Integer(2));
\r
39 aaHash.put("D", new Integer(3));
\r
40 aaHash.put("C", new Integer(4));
\r
41 aaHash.put("Q", new Integer(5));
\r
42 aaHash.put("E", new Integer(6));
\r
43 aaHash.put("G", new Integer(7));
\r
44 aaHash.put("H", new Integer(8));
\r
45 aaHash.put("I", new Integer(9));
\r
46 aaHash.put("L", new Integer(10));
\r
47 aaHash.put("K", new Integer(11));
\r
48 aaHash.put("M", new Integer(12));
\r
49 aaHash.put("F", new Integer(13));
\r
50 aaHash.put("P", new Integer(14));
\r
51 aaHash.put("S", new Integer(15));
\r
52 aaHash.put("T", new Integer(16));
\r
53 aaHash.put("W", new Integer(17));
\r
54 aaHash.put("Y", new Integer(18));
\r
55 aaHash.put("V", new Integer(19));
\r
56 aaHash.put("B", new Integer(20));
\r
57 aaHash.put("Z", new Integer(21));
\r
58 aaHash.put("X", new Integer(22));
\r
59 aaHash.put("U", new Integer(22));
\r
60 aaHash.put("a", new Integer(0));
\r
61 aaHash.put("r", new Integer(1));
\r
62 aaHash.put("n", new Integer(2));
\r
63 aaHash.put("d", new Integer(3));
\r
64 aaHash.put("c", new Integer(4));
\r
65 aaHash.put("q", new Integer(5));
\r
66 aaHash.put("e", new Integer(6));
\r
67 aaHash.put("g", new Integer(7));
\r
68 aaHash.put("h", new Integer(8));
\r
69 aaHash.put("i", new Integer(9));
\r
70 aaHash.put("l", new Integer(10));
\r
71 aaHash.put("k", new Integer(11));
\r
72 aaHash.put("m", new Integer(12));
\r
73 aaHash.put("f", new Integer(13));
\r
74 aaHash.put("p", new Integer(14));
\r
75 aaHash.put("s", new Integer(15));
\r
76 aaHash.put("t", new Integer(16));
\r
77 aaHash.put("w", new Integer(17));
\r
78 aaHash.put("y", new Integer(18));
\r
79 aaHash.put("v", new Integer(19));
\r
80 aaHash.put("b", new Integer(20));
\r
81 aaHash.put("z", new Integer(21));
\r
82 aaHash.put("x", new Integer(22));
\r
83 aaHash.put("u", new Integer(22));
\r
84 aaHash.put("-", new Integer(23));
\r
85 aaHash.put("*", new Integer(23));
\r
86 aaHash.put(".", new Integer(23));
\r
87 aaHash.put(" ", new Integer(23));
\r
92 nucleotideHash.put("A", new Integer(0));
\r
93 nucleotideHash.put("a", new Integer(0));
\r
94 nucleotideHash.put("C", new Integer(1));
\r
95 nucleotideHash.put("c", new Integer(1));
\r
96 nucleotideHash.put("G", new Integer(2));
\r
97 nucleotideHash.put("g", new Integer(2));
\r
98 nucleotideHash.put("T", new Integer(3));
\r
99 nucleotideHash.put("t", new Integer(3));
\r
100 nucleotideHash.put("U", new Integer(4));
\r
101 nucleotideHash.put("u", new Integer(4));
\r
102 nucleotideHash.put("I", new Integer(5));
\r
103 nucleotideHash.put("i", new Integer(5));
\r
104 nucleotideHash.put("X", new Integer(6));
\r
105 nucleotideHash.put("x", new Integer(6));
\r
106 nucleotideHash.put("R", new Integer(7));
\r
107 nucleotideHash.put("r", new Integer(7));
\r
108 nucleotideHash.put("Y", new Integer(8));
\r
109 nucleotideHash.put("y", new Integer(8));
\r
110 nucleotideHash.put("N", new Integer(9));
\r
111 nucleotideHash.put("n", new Integer(9));
\r
114 nucleotideName.put("A", "Adenine");
\r
115 nucleotideName.put("a", "Adenine");
\r
116 nucleotideName.put("G", "Guanine");
\r
117 nucleotideName.put("g", "Guanine");
\r
118 nucleotideName.put("C", "Cytosine");
\r
119 nucleotideName.put("c", "Cytosine");
\r
120 nucleotideName.put("T", "Thymine");
\r
121 nucleotideName.put("t", "Thymine");
\r
122 nucleotideName.put("U", "Uracil");
\r
123 nucleotideName.put("u", "Uracil");
\r
124 nucleotideName.put("I", "Inosine");
\r
125 nucleotideName.put("i", "Inosine");
\r
126 nucleotideName.put("X", "Xanthine");
\r
127 nucleotideName.put("x", "Xanthine");
\r
128 nucleotideName.put("R", "Unknown Purine");
\r
129 nucleotideName.put("r", "Unknown Purine");
\r
130 nucleotideName.put("Y", "Unknown Pyrimidine");
\r
131 nucleotideName.put("y", "Unknown Pyrimidine");
\r
132 nucleotideName.put("N", "Unknown");
\r
133 nucleotideName.put("n", "Unknown");
\r
139 aa3Hash.put("ALA", new Integer(0));
\r
140 aa3Hash.put("ARG", new Integer(1));
\r
141 aa3Hash.put("ASN", new Integer(2));
\r
142 aa3Hash.put("ASP", new Integer(3)); //D
\r
143 aa3Hash.put("CYS", new Integer(4));
\r
144 aa3Hash.put("GLN", new Integer(5)); //Q
\r
145 aa3Hash.put("GLU", new Integer(6)); // E
\r
146 aa3Hash.put("GLY", new Integer(7));
\r
147 aa3Hash.put("HIS", new Integer(8));
\r
148 aa3Hash.put("ILE", new Integer(9));
\r
149 aa3Hash.put("LEU", new Integer(10));
\r
150 aa3Hash.put("LYS", new Integer(11));
\r
151 aa3Hash.put("MET", new Integer(12));
\r
152 aa3Hash.put("PHE", new Integer(13));
\r
153 aa3Hash.put("PRO", new Integer(14));
\r
154 aa3Hash.put("SER", new Integer(15));
\r
155 aa3Hash.put("THR", new Integer(16));
\r
156 aa3Hash.put("TRP", new Integer(17));
\r
157 aa3Hash.put("TYR", new Integer(18));
\r
158 aa3Hash.put("VAL", new Integer(19));
\r
159 // IUB Nomenclature for ambiguous peptides
\r
160 aa3Hash.put("ASX", new Integer(20)); // "B";
\r
161 aa3Hash.put("GLX", new Integer(21)); // X
\r
162 aa3Hash.put("XAA", new Integer(22));// X unknown
\r
163 aa3Hash.put("-", new Integer(23));
\r
164 aa3Hash.put("*", new Integer(23));
\r
165 aa3Hash.put(".", new Integer(23));
\r
166 aa3Hash.put(" ", new Integer(23));
\r
171 aa2Triplet.put("A", "ALA");
\r
172 aa2Triplet.put("a", "ALA");
\r
173 aa2Triplet.put("R", "ARG");
\r
174 aa2Triplet.put("r", "ARG");
\r
175 aa2Triplet.put("N", "ASN");
\r
176 aa2Triplet.put("n", "ASN");
\r
177 aa2Triplet.put("D", "ASP");
\r
178 aa2Triplet.put("d", "ASP");
\r
179 aa2Triplet.put("C", "CYS");
\r
180 aa2Triplet.put("c", "CYS");
\r
181 aa2Triplet.put("Q", "GLN");
\r
182 aa2Triplet.put("q", "GLN");
\r
183 aa2Triplet.put("E", "GLU");
\r
184 aa2Triplet.put("e", "GLU");
\r
185 aa2Triplet.put("G", "GLY");
\r
186 aa2Triplet.put("g", "GLY");
\r
187 aa2Triplet.put("H", "HIS");
\r
188 aa2Triplet.put("h", "HIS");
\r
189 aa2Triplet.put("I", "ILE");
\r
190 aa2Triplet.put("i", "ILE");
\r
191 aa2Triplet.put("L", "LEU");
\r
192 aa2Triplet.put("l", "LEU");
\r
193 aa2Triplet.put("K", "LYS");
\r
194 aa2Triplet.put("k", "LYS");
\r
195 aa2Triplet.put("M", "MET");
\r
196 aa2Triplet.put("m", "MET");
\r
197 aa2Triplet.put("F", "PHE");
\r
198 aa2Triplet.put("f", "PHE");
\r
199 aa2Triplet.put("P", "PRO");
\r
200 aa2Triplet.put("p", "PRO");
\r
201 aa2Triplet.put("S", "SER");
\r
202 aa2Triplet.put("s", "SER");
\r
203 aa2Triplet.put("T", "THR");
\r
204 aa2Triplet.put("t", "THR");
\r
205 aa2Triplet.put("W", "TRP");
\r
206 aa2Triplet.put("w", "TRP");
\r
207 aa2Triplet.put("Y", "TYR");
\r
208 aa2Triplet.put("y", "TYR");
\r
209 aa2Triplet.put("V", "VAL");
\r
210 aa2Triplet.put("v", "VAL");
\r
213 public static final String[] aa =
\r
215 "A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F",
\r
216 "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "_", "*", ".", " "
\r
218 public static final Color midBlue = new Color(100, 100, 255);
\r
219 public static final Vector scaleColours = new Vector();
\r
223 scaleColours.addElement(new Color(114, 0, 147));
\r
224 scaleColours.addElement(new Color(156, 0, 98));
\r
225 scaleColours.addElement(new Color(190, 0, 0));
\r
226 scaleColours.addElement(Color.red);
\r
227 scaleColours.addElement(new Color(255, 125, 0));
\r
228 scaleColours.addElement(Color.orange);
\r
229 scaleColours.addElement(new Color(255, 194, 85));
\r
230 scaleColours.addElement(Color.yellow);
\r
231 scaleColours.addElement(new Color(255, 255, 181));
\r
232 scaleColours.addElement(Color.white);
\r
235 public static final Color[] taylor =
\r
237 new Color(204, 255, 0), // A Greenish-yellowy-yellow
\r
238 new Color(0, 0, 255), // R Blueish-bluey-blue
\r
239 new Color(204, 0, 255), // N Blueish-reddy-blue
\r
240 new Color(255, 0, 0), // D Reddish-reddy-red
\r
241 new Color(255, 255, 0), // C Yellowish-yellowy-yellow
\r
242 new Color(255, 0, 204), // Q Reddish-bluey-red
\r
243 new Color(255, 0, 102), // E Blueish-reddy-red
\r
244 new Color(255, 153, 0), // G Yellowy-reddy-yellow
\r
245 new Color(0, 102, 255), // H Greenish-bluey-blue
\r
246 new Color(102, 255, 0), // I Greenish-yellowy-green
\r
247 new Color(51, 255, 0), // L Yellowish-greeny-green
\r
248 new Color(102, 0, 255), // K Reddish-bluey-blue
\r
249 new Color(0, 255, 0), // M Greenish-greeny-green
\r
250 new Color(0, 255, 102), // F Blueish-greeny-green
\r
251 new Color(255, 204, 0), // P Reddish-yellowy-yellow
\r
252 new Color(255, 51, 0), // S Yellowish-reddy-red
\r
253 new Color(255, 102, 0), // T Reddish-yellowy-red
\r
254 new Color(0, 204, 255), // W Blueish-greeny-green
\r
255 new Color(0, 255, 204), // Y Greenish-bluey-green
\r
256 new Color(153, 255, 0), // V Yellowish-greeny-yellow
\r
264 public static final Color[] nucleotide =
\r
266 new Color(100, 247, 63), // A
\r
267 new Color(255, 179, 64), // C
\r
268 new Color(235, 65, 60), // G
\r
269 new Color(60, 136, 238), // T
\r
270 new Color(60, 136, 238) // U
\r
272 public static final Color[] color =
\r
281 Color.magenta, // G
\r
288 Color.magenta, // P
\r
303 // Dunno where I got these numbers from
\r
304 public static final double[] hyd2 =
\r
330 public static final double[] helix =
\r
332 1.42, 0.98, 0.67, 1.01, 0.70, 1.11, 1.51, 0.57, 1.00, 1.08, 1.21, 1.16,
\r
333 1.45, 1.13, 0.57, 0.77, 0.83, 1.08, 0.69, 1.06, 0.84, 1.31, 1.00, 0.0
\r
335 public static final double helixmin = 0.57;
\r
336 public static final double helixmax = 1.51;
\r
337 public static final double[] strand =
\r
339 0.83, 0.93, 0.89, 0.54, 1.19, 1.10, 0.37, 0.75, 0.87, 1.60, 1.30, 0.74,
\r
340 1.05, 1.38, 0.55, 0.75, 1.19, 1.37, 1.47, 1.70, 0.72, 0.74, 1.0, 0.0
\r
342 public static final double strandmin = 0.37;
\r
343 public static final double strandmax = 1.7;
\r
344 public static final double[] turn =
\r
346 0.66, 0.95, 1.56, 1.46, 1.19, 0.98, 0.74, 1.56, 0.95, 0.47, 0.59, 1.01,
\r
347 0.60, 0.60, 1.52, 1.43, 0.96, 0.96, 1.14, 0.50, 1.51, 0.86, 1.00, 0, 0
\r
349 public static final double turnmin = 0.47;
\r
350 public static final double turnmax = 1.56;
\r
351 public static final double[] buried =
\r
353 1.7, 0.1, 0.4, 0.4, 4.6, 0.3, 0.3, 1.8, 0.8, 3.1, 2.4, 0.05, 1.9, 2.2,
\r
354 0.6, 0.8, 0.7, 1.6, 0.5, 2.9, 0.4, 0.3, 1.358, 0.00
\r
356 public static final double buriedmin = 0.05;
\r
357 public static final double buriedmax = 4.6;
\r
359 // This is hydropathy index
\r
360 // Kyte, J., and Doolittle, R.F., J. Mol. Biol.
\r
361 // 1157, 105-132, 1982
\r
362 public static final double[] hyd =
\r
364 1.8, -4.5, -3.5, -3.5, 2.5, -3.5, -3.5, -0.4, -3.2, 4.5, 3.8, -3.9, 1.9,
\r
365 2.8, -1.6, -0.8, -0.7, -0.9, -1.3, 4.2, -3.5, -3.5, -0.49, 0.0
\r
367 public static final double hydmax = 4.5;
\r
368 public static final double hydmin = -3.9;
\r
370 //public static final double hydmax = 1.38;
\r
371 //public static final double hydmin = -2.53;
\r
372 static final int[][] BLOSUM62 =
\r
375 4, -1, -2, -2, 0, -1, -1, 0, -2, -1, -1, -1, -1, -2, -1, 1, 0, -3,
\r
376 -2, 0, -2, -1, 0, -4
\r
379 -1, 5, 0, -2, -3, 1, 0, -2, 0, -3, -2, 2, -1, -3, -2, -1, -1, -3, -2,
\r
383 -2, 0, 6, 1, -3, 0, 0, 0, 1, -3, -3, 0, -2, -3, -2, 1, 0, -4, -2, -3,
\r
387 -2, -2, 1, 6, -3, 0, 2, -1, -1, -3, -4, -1, -3, -3, -1, 0, -1, -4,
\r
388 -3, -3, 4, 1, -1, -4
\r
391 0, 3, -3, -3, 9, -3, -4, -3, -3, -1, -1, -3, -1, -2, -3, -1, -1, -2,
\r
392 -2, -1, -3, -3, -2, -4
\r
395 -1, 1, 0, 0, -3, 5, 2, -2, 0, -3, -2, 1, 0, -3, -1, 0, -1, -2, -1,
\r
399 -1, 0, 0, 2, -4, 2, 5, -2, 0, -3, -3, 1, -2, -3, -1, 0, -1, -3, -2,
\r
403 0, -2, 0, -1, -3, -2, -2, 6, -2, -4, -4, -2, -3, -3, -2, 0, -2, -2,
\r
404 -3, -3, -1, -2, -1, -4
\r
407 -2, 0, 1, -1, -3, 0, 0, -2, 8, -3, -3, -1, -2, -1, -2, -1, -2, -2, 2,
\r
411 -1, -3, -3, -3, -1, -3, -3, -4, -3, 4, 2, -3, 1, 0, -3, -2, -1, -3,
\r
412 -1, 3, -3, -3, -1, -4
\r
415 -1, -2, -3, -4, -1, -2, -3, -4, -3, 2, 4, -2, 2, 0, -3, -2, -1, -2,
\r
416 -1, 1, -4, -3, -1, -4
\r
419 -1, 2, 0, -1, -3, 1, 1, -2, -1, -3, -2, 5, -1, -3, -1, 0, -1, -3, -2,
\r
423 -1, -1, -2, -3, -1, 0, -2, -3, -2, 1, 2, -1, 5, 0, -2, -1, -1, -1,
\r
424 -1, 1, -3, -1, -1, -4
\r
427 -2, -3, -3, -3, -2, -3, -3, -3, -1, 0, 0, -3, 0, 6, -4, -2, -2, 1, 3,
\r
431 -1, -2, -2, -1, -3, -1, -1, -2, -2, -3, -3, -1, -2, -4, 7, -1, -1,
\r
432 -4, -3, -2, -2, -1, -2, -4
\r
435 1, -1, 1, 0, -1, 0, 0, 0, -1, -2, -2, 0, -1, -2, -1, 4, 1, -3, -2,
\r
439 0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, -2, -1, 1, 5, -2,
\r
440 -2, 0, -1, -1, 0, -4
\r
443 -3, -3, -4, -4, -2, -2, -3, -2, -2, -3, -2, -3, -1, 1, -4, -3, -2,
\r
444 11, 2, -3, -4, -3, -2, -4
\r
447 -2, -2, -2, -3, -2, -1, -2, -3, 2, -1, -1, -2, -1, 3, -3, -2, -2, 2,
\r
448 7, -1, -3, -2, -1, -4
\r
451 0, -3, -3, -3, -1, -2, -2, -3, -3, 3, 1, -2, 1, -1, -2, -2, 0, -3,
\r
452 -1, 4, -3, -2, -1, -4
\r
455 -2, -1, 3, 4, -3, 0, 1, -1, 0, -3, -4, 0, -3, -3, -2, 0, -1, -4, -3,
\r
459 -1, 0, 0, 1, -3, 3, 4, -2, 0, -3, -3, 1, -1, -3, -1, 0, -1, -3, -2,
\r
463 0, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 0, 0, -2,
\r
464 -1, -1, -1, -1, -1, -4
\r
467 -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
\r
468 -4, -4, -4, -4, -4, -4, 1
\r
471 static final int[][] PAM250 =
\r
474 2, -2, 0, 0, -2, 0, 0, 1, -1, -1, -2, -1, -1, -3, 1, 1, 1, -6, -3, 0,
\r
478 -2, 6, 0, -1, -4, 1, -1, -3, 2, -2, -3, 3, 0, -4, 0, 0, -1, 2, -4,
\r
482 0, 0, 2, 2, -4, 1, 1, 0, 2, -2, -3, 1, -2, -3, 0, 1, 0, -4, -2, -2,
\r
486 0, -1, 2, 4, -5, 2, 3, 1, 1, -2, -4, 0, -3, -6, -1, 0, 0, -7, -4, -2,
\r
490 -2, -4, -4, -5, 12, -5, -5, -3, -3, -2, -6, -5, -5, -4, -3, 0, -2,
\r
491 -8, 0, -2, -4, -5, -3, -8
\r
494 0, 1, 1, 2, -5, 4, 2, -1, 3, -2, -2, 1, -1, -5, 0, -1, -1, -5, -4,
\r
498 0, -1, 1, 3, -5, 2, 4, 0, 1, -2, -3, 0, -2, -5, -1, 0, 0, -7, -4, -2,
\r
502 1, -3, 0, 1, -3, -1, 0, 5, -2, -3, -4, -2, -3, -5, 0, 1, 0, -7, -5,
\r
506 -1, 2, 2, 1, -3, 3, 1, -2, 6, -2, -2, 0, -2, -2, 0, -1, -1, -3, 0,
\r
510 -1, -2, -2, -2, -2, -2, -2, -3, -2, 5, 2, -2, 2, 1, -2, -1, 0, -5,
\r
511 -1, 4, -2, -2, -1, -8
\r
514 -2, -3, -3, -4, -6, -2, -3, -4, -2, 2, 6, -3, 4, 2, -3, -3, -2, -2,
\r
515 -1, 2, -3, -3, -1, -8
\r
518 -1, 3, 1, 0, -5, 1, 0, -2, 0, -2, -3, 5, 0, -5, -1, 0, 0, -3, -4, -2,
\r
522 -1, 0, -2, -3, -5, -1, -2, -3, -2, 2, 4, 0, 6, 0, -2, -2, -1, -4, -2,
\r
526 -3, -4, -3, -6, -4, -5, -5, -5, -2, 1, 2, -5, 0, 9, -5, -3, -3, 0, 7,
\r
530 1, 0, 0, -1, -3, 0, -1, 0, 0, -2, -3, -1, -2, -5, 6, 1, 0, -6, -5,
\r
534 1, 0, 1, 0, 0, -1, 0, 1, -1, -1, -3, 0, -2, -3, 1, 2, 1, -2, -3, -1,
\r
538 1, -1, 0, 0, -2, -1, 0, 0, -1, 0, -2, 0, -1, -3, 0, 1, 3, -5, -3, 0,
\r
542 -6, 2, -4, -7, -8, -5, -7, -7, -3, -5, -2, -3, -4, 0, -6, -2, -5, 17,
\r
543 0, -6, -5, -6, -4, -8
\r
546 -3, -4, -2, -4, 0, -4, -4, -5, 0, -1, -1, -4, -2, 7, -5, -3, -3, 0,
\r
547 10, -2, -3, -4, -2, -8
\r
550 0, -2, -2, -2, -2, -2, -2, -1, -2, 4, 2, -2, 2, -1, -1, -1, 0, -6,
\r
551 -2, 4, -2, -2, -1, -8
\r
554 0, -1, 2, 3, -4, 1, 3, 0, 1, -2, -3, 1, -2, -4, -1, 0, 0, -5, -3, -2,
\r
558 0, 0, 1, 3, -5, 3, 3, 0, 2, -2, -3, 0, -2, -5, 0, 0, -1, -6, -4, -2,
\r
562 0, -1, 0, -1, -3, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, 0, 0, -4,
\r
563 -2, -1, -1, -1, -1, -8
\r
566 -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
\r
567 -8, -8, -8, -8, -8, -8, 1
\r
570 public static final Hashtable ssHash = new Hashtable(); // stores the number value of the aa
\r
574 ssHash.put("H", Color.magenta);
\r
575 ssHash.put("E", Color.yellow);
\r
576 ssHash.put("-", Color.white);
\r
577 ssHash.put(".", Color.white);
\r
578 ssHash.put("S", Color.cyan);
\r
579 ssHash.put("T", Color.blue);
\r
580 ssHash.put("G", Color.pink);
\r
581 ssHash.put("I", Color.pink);
\r
582 ssHash.put("B", Color.yellow);
\r
585 static final int[][] DNA =
\r
588 5, -4, -4, -4, 1}, // C
\r
590 -4, 5, -4, -4, 1}, // T
\r
592 -4, -4, 5, -4, 1}, // A
\r
594 -4, -4, -4, 5, 1}, // G
\r
596 1, 1, 1, 1, 1}, // -
\r
598 public static final Color[] pidColours =
\r
600 midBlue, new Color(153, 153, 255),
\r
601 // Color.lightGray,
\r
602 new Color(204, 204, 255),
\r
604 public static final float[] pidThresholds =
\r
607 public static Hashtable codonHash = new Hashtable();
\r
608 public static Vector Lys = new Vector();
\r
609 public static Vector Asn = new Vector();
\r
610 public static Vector Gln = new Vector();
\r
611 public static Vector His = new Vector();
\r
612 public static Vector Glu = new Vector();
\r
613 public static Vector Asp = new Vector();
\r
614 public static Vector Tyr = new Vector();
\r
615 public static Vector Thr = new Vector();
\r
616 public static Vector Pro = new Vector();
\r
617 public static Vector Ala = new Vector();
\r
618 public static Vector Ser = new Vector();
\r
619 public static Vector Arg = new Vector();
\r
620 public static Vector Gly = new Vector();
\r
621 public static Vector Trp = new Vector();
\r
622 public static Vector Cys = new Vector();
\r
623 public static Vector Ile = new Vector();
\r
624 public static Vector Met = new Vector();
\r
625 public static Vector Leu = new Vector();
\r
626 public static Vector Val = new Vector();
\r
627 public static Vector Phe = new Vector();
\r
628 public static Vector STOP = new Vector();
\r
632 codonHash.put("K", Lys);
\r
633 codonHash.put("N", Asn);
\r
634 codonHash.put("Q", Gln);
\r
635 codonHash.put("H", His);
\r
636 codonHash.put("E", Glu);
\r
637 codonHash.put("D", Asp);
\r
638 codonHash.put("Y", Tyr);
\r
639 codonHash.put("T", Thr);
\r
640 codonHash.put("P", Pro);
\r
641 codonHash.put("A", Ala);
\r
642 codonHash.put("S", Ser);
\r
643 codonHash.put("R", Arg);
\r
644 codonHash.put("G", Gly);
\r
645 codonHash.put("W", Trp);
\r
646 codonHash.put("C", Cys);
\r
647 codonHash.put("I", Ile);
\r
648 codonHash.put("M", Met);
\r
649 codonHash.put("L", Leu);
\r
650 codonHash.put("V", Val);
\r
651 codonHash.put("F", Phe);
\r
652 codonHash.put("STOP", STOP);
\r
655 public static Hashtable codonHash2 = new Hashtable();
\r
659 codonHash2.put("AAA", "K");
\r
660 codonHash2.put("AAG", "K");
\r
661 codonHash2.put("AAC", "N");
\r
662 codonHash2.put("AAT", "N");
\r
664 codonHash2.put("CAA", "E");
\r
665 codonHash2.put("CAG", "E");
\r
666 codonHash2.put("CAC", "H");
\r
667 codonHash2.put("CAT", "H");
\r
669 codonHash2.put("GAA", "Q");
\r
670 codonHash2.put("GAG", "Q");
\r
671 codonHash2.put("GAC", "D");
\r
672 codonHash2.put("GAT", "D");
\r
674 codonHash2.put("TAC", "Y");
\r
675 codonHash2.put("TAT", "Y");
\r
677 codonHash2.put("ACA", "T");
\r
678 codonHash2.put("AAG", "T");
\r
679 codonHash2.put("ACC", "T");
\r
680 codonHash2.put("ACT", "T");
\r
682 codonHash2.put("CCA", "P");
\r
683 codonHash2.put("CCG", "P");
\r
684 codonHash2.put("CCC", "P");
\r
685 codonHash2.put("CCT", "P");
\r
687 codonHash2.put("GCA", "A");
\r
688 codonHash2.put("GCG", "A");
\r
689 codonHash2.put("GCC", "A");
\r
690 codonHash2.put("GCT", "A");
\r
692 codonHash2.put("TCA", "S");
\r
693 codonHash2.put("TCG", "S");
\r
694 codonHash2.put("TCC", "S");
\r
695 codonHash2.put("TCT", "S");
\r
696 codonHash2.put("AGC", "S");
\r
697 codonHash2.put("AGT", "S");
\r
699 codonHash2.put("AGA", "R");
\r
700 codonHash2.put("AGG", "R");
\r
701 codonHash2.put("CGA", "R");
\r
702 codonHash2.put("CGG", "R");
\r
703 codonHash2.put("CGC", "R");
\r
704 codonHash2.put("CGT", "R");
\r
706 codonHash2.put("GGA", "G");
\r
707 codonHash2.put("GGG", "G");
\r
708 codonHash2.put("GGC", "G");
\r
709 codonHash2.put("GGT", "G");
\r
711 codonHash2.put("TGA", "*");
\r
712 codonHash2.put("TAA", "*");
\r
713 codonHash2.put("TAG", "*");
\r
715 codonHash2.put("TGG", "W");
\r
717 codonHash2.put("TGC", "C");
\r
718 codonHash2.put("TGT", "C");
\r
720 codonHash2.put("ATA", "I");
\r
721 codonHash2.put("ATC", "I");
\r
722 codonHash2.put("ATT", "I");
\r
724 codonHash2.put("ATG", "M");
\r
726 codonHash2.put("CTA", "L");
\r
727 codonHash2.put("CTG", "L");
\r
728 codonHash2.put("CTC", "L");
\r
729 codonHash2.put("CTT", "L");
\r
730 codonHash2.put("TTA", "L");
\r
731 codonHash2.put("TTG", "L");
\r
733 codonHash2.put("GTA", "V");
\r
734 codonHash2.put("GTG", "V");
\r
735 codonHash2.put("GTC", "V");
\r
736 codonHash2.put("GTT", "V");
\r
738 codonHash2.put("TTC", "F");
\r
739 codonHash2.put("TTT", "F");
\r
744 Lys.addElement("AAA");
\r
745 Lys.addElement("AAG");
\r
746 Asn.addElement("AAC");
\r
747 Asn.addElement("AAT");
\r
749 Gln.addElement("CAA");
\r
750 Gln.addElement("CAG");
\r
751 His.addElement("CAC");
\r
752 His.addElement("CAT");
\r
754 Glu.addElement("GAA");
\r
755 Glu.addElement("GAG");
\r
756 Asp.addElement("GAC");
\r
757 Asp.addElement("GAT");
\r
759 Tyr.addElement("TAC");
\r
760 Tyr.addElement("TAT");
\r
762 Thr.addElement("ACA");
\r
763 Thr.addElement("ACG");
\r
764 Thr.addElement("ACC");
\r
765 Thr.addElement("ACT");
\r
767 Pro.addElement("CCA");
\r
768 Pro.addElement("CCG");
\r
769 Pro.addElement("CCC");
\r
770 Pro.addElement("CCT");
\r
772 Ala.addElement("GCA");
\r
773 Ala.addElement("GCG");
\r
774 Ala.addElement("GCC");
\r
775 Ala.addElement("GCT");
\r
777 Ser.addElement("TCA");
\r
778 Ser.addElement("TCG");
\r
779 Ser.addElement("TCC");
\r
780 Ser.addElement("TCT");
\r
781 Ser.addElement("AGC");
\r
782 Ser.addElement("AGT");
\r
784 Arg.addElement("AGA");
\r
785 Arg.addElement("AGG");
\r
786 Arg.addElement("CGA");
\r
787 Arg.addElement("CGG");
\r
788 Arg.addElement("CGC");
\r
789 Arg.addElement("CGT");
\r
791 Gly.addElement("GGA");
\r
792 Gly.addElement("GGG");
\r
793 Gly.addElement("GGC");
\r
794 Gly.addElement("GGT");
\r
796 STOP.addElement("TGA");
\r
797 STOP.addElement("TAA");
\r
798 STOP.addElement("TAG");
\r
800 Trp.addElement("TGG");
\r
802 Cys.addElement("TGC");
\r
803 Cys.addElement("TGT");
\r
805 Ile.addElement("ATA");
\r
806 Ile.addElement("ATC");
\r
807 Ile.addElement("ATT");
\r
809 Met.addElement("ATG");
\r
811 Leu.addElement("CTA");
\r
812 Leu.addElement("CTG");
\r
813 Leu.addElement("CTC");
\r
814 Leu.addElement("CTT");
\r
815 Leu.addElement("TTA");
\r
816 Leu.addElement("TTG");
\r
818 Val.addElement("GTA");
\r
819 Val.addElement("GTG");
\r
820 Val.addElement("GTC");
\r
821 Val.addElement("GTT");
\r
823 Phe.addElement("TTC");
\r
824 Phe.addElement("TTT");
\r
827 public static Color[][] groupColors =
\r
830 Color.red, Color.red.brighter(), Color.red.brighter().brighter()},
\r
832 Color.orange, Color.orange.brighter(),
\r
833 Color.orange.brighter().brighter()
\r
836 Color.green, Color.green.brighter(), Color.green.brighter().brighter()},
\r
838 Color.blue, Color.blue.brighter(), Color.blue.brighter().brighter()},
\r
840 Color.magenta, Color.magenta.brighter(),
\r
841 Color.magenta.brighter().brighter()
\r
844 Color.cyan, Color.cyan.brighter(), Color.cyan.brighter().brighter()},
\r
846 Color.pink, Color.pink.brighter(), Color.pink.brighter().brighter()},
\r
849 //Stores residue codes/names and colours and other things
\r
850 public static Hashtable propHash = new Hashtable();
\r
851 public static Hashtable hydrophobic = new Hashtable();
\r
852 public static Hashtable polar = new Hashtable();
\r
853 public static Hashtable small = new Hashtable();
\r
854 public static Hashtable positive = new Hashtable();
\r
855 public static Hashtable negative = new Hashtable();
\r
856 public static Hashtable charged = new Hashtable();
\r
857 public static Hashtable aromatic = new Hashtable();
\r
858 public static Hashtable aliphatic = new Hashtable();
\r
859 public static Hashtable tiny = new Hashtable();
\r
860 public static Hashtable proline = new Hashtable();
\r
864 hydrophobic.put("I", new Integer(1));
\r
865 hydrophobic.put("L", new Integer(1));
\r
866 hydrophobic.put("V", new Integer(1));
\r
867 hydrophobic.put("C", new Integer(1));
\r
868 hydrophobic.put("A", new Integer(1));
\r
869 hydrophobic.put("G", new Integer(1));
\r
870 hydrophobic.put("M", new Integer(1));
\r
871 hydrophobic.put("F", new Integer(1));
\r
872 hydrophobic.put("Y", new Integer(1));
\r
873 hydrophobic.put("W", new Integer(1));
\r
874 hydrophobic.put("H", new Integer(1));
\r
875 hydrophobic.put("K", new Integer(1));
\r
876 hydrophobic.put("X", new Integer(1));
\r
877 hydrophobic.put("-", new Integer(1));
\r
878 hydrophobic.put("*", new Integer(1));
\r
879 hydrophobic.put("R", new Integer(0));
\r
880 hydrophobic.put("E", new Integer(0));
\r
881 hydrophobic.put("Q", new Integer(0));
\r
882 hydrophobic.put("D", new Integer(0));
\r
883 hydrophobic.put("N", new Integer(0));
\r
884 hydrophobic.put("S", new Integer(0));
\r
885 hydrophobic.put("T", new Integer(0));
\r
886 hydrophobic.put("P", new Integer(0));
\r
891 polar.put("Y", new Integer(1));
\r
892 polar.put("W", new Integer(1));
\r
893 polar.put("H", new Integer(1));
\r
894 polar.put("K", new Integer(1));
\r
895 polar.put("R", new Integer(1));
\r
896 polar.put("E", new Integer(1));
\r
897 polar.put("Q", new Integer(1));
\r
898 polar.put("D", new Integer(1));
\r
899 polar.put("N", new Integer(1));
\r
900 polar.put("S", new Integer(1));
\r
901 polar.put("T", new Integer(1));
\r
902 polar.put("X", new Integer(1));
\r
903 polar.put("-", new Integer(1));
\r
904 polar.put("*", new Integer(1));
\r
905 polar.put("I", new Integer(0));
\r
906 polar.put("L", new Integer(0));
\r
907 polar.put("V", new Integer(0));
\r
908 polar.put("C", new Integer(0));
\r
909 polar.put("A", new Integer(0));
\r
910 polar.put("G", new Integer(0));
\r
911 polar.put("M", new Integer(0));
\r
912 polar.put("F", new Integer(0));
\r
913 polar.put("P", new Integer(0));
\r
918 small.put("I", new Integer(0));
\r
919 small.put("L", new Integer(0));
\r
920 small.put("V", new Integer(1));
\r
921 small.put("C", new Integer(1));
\r
922 small.put("A", new Integer(1));
\r
923 small.put("G", new Integer(1));
\r
924 small.put("M", new Integer(0));
\r
925 small.put("F", new Integer(0));
\r
926 small.put("Y", new Integer(0));
\r
927 small.put("W", new Integer(0));
\r
928 small.put("H", new Integer(0));
\r
929 small.put("K", new Integer(0));
\r
930 small.put("R", new Integer(0));
\r
931 small.put("E", new Integer(0));
\r
932 small.put("Q", new Integer(0));
\r
933 small.put("D", new Integer(1));
\r
934 small.put("N", new Integer(1));
\r
935 small.put("S", new Integer(1));
\r
936 small.put("T", new Integer(1));
\r
937 small.put("P", new Integer(1));
\r
938 small.put("-", new Integer(1));
\r
939 small.put("*", new Integer(1));
\r
944 positive.put("I", new Integer(0));
\r
945 positive.put("L", new Integer(0));
\r
946 positive.put("V", new Integer(0));
\r
947 positive.put("C", new Integer(0));
\r
948 positive.put("A", new Integer(0));
\r
949 positive.put("G", new Integer(0));
\r
950 positive.put("M", new Integer(0));
\r
951 positive.put("F", new Integer(0));
\r
952 positive.put("Y", new Integer(0));
\r
953 positive.put("W", new Integer(0));
\r
954 positive.put("H", new Integer(1));
\r
955 positive.put("K", new Integer(1));
\r
956 positive.put("R", new Integer(1));
\r
957 positive.put("E", new Integer(0));
\r
958 positive.put("Q", new Integer(0));
\r
959 positive.put("D", new Integer(0));
\r
960 positive.put("N", new Integer(0));
\r
961 positive.put("S", new Integer(0));
\r
962 positive.put("T", new Integer(0));
\r
963 positive.put("P", new Integer(0));
\r
964 positive.put("-", new Integer(1));
\r
965 positive.put("*", new Integer(1));
\r
970 negative.put("I", new Integer(0));
\r
971 negative.put("L", new Integer(0));
\r
972 negative.put("V", new Integer(0));
\r
973 negative.put("C", new Integer(0));
\r
974 negative.put("A", new Integer(0));
\r
975 negative.put("G", new Integer(0));
\r
976 negative.put("M", new Integer(0));
\r
977 negative.put("F", new Integer(0));
\r
978 negative.put("Y", new Integer(0));
\r
979 negative.put("W", new Integer(0));
\r
980 negative.put("H", new Integer(0));
\r
981 negative.put("K", new Integer(0));
\r
982 negative.put("R", new Integer(0));
\r
983 negative.put("E", new Integer(1));
\r
984 negative.put("Q", new Integer(0));
\r
985 negative.put("D", new Integer(1));
\r
986 negative.put("N", new Integer(0));
\r
987 negative.put("S", new Integer(0));
\r
988 negative.put("T", new Integer(0));
\r
989 negative.put("P", new Integer(0));
\r
990 negative.put("-", new Integer(1));
\r
991 negative.put("*", new Integer(1));
\r
996 charged.put("I", new Integer(0));
\r
997 charged.put("L", new Integer(0));
\r
998 charged.put("V", new Integer(0));
\r
999 charged.put("C", new Integer(0));
\r
1000 charged.put("A", new Integer(0));
\r
1001 charged.put("G", new Integer(0));
\r
1002 charged.put("M", new Integer(0));
\r
1003 charged.put("F", new Integer(0));
\r
1004 charged.put("Y", new Integer(0));
\r
1005 charged.put("W", new Integer(0));
\r
1006 charged.put("H", new Integer(1));
\r
1007 charged.put("K", new Integer(1));
\r
1008 charged.put("R", new Integer(1));
\r
1009 charged.put("E", new Integer(1));
\r
1010 charged.put("Q", new Integer(0));
\r
1011 charged.put("D", new Integer(1));
\r
1012 charged.put("N", new Integer(1));
\r
1013 charged.put("S", new Integer(0));
\r
1014 charged.put("T", new Integer(0));
\r
1015 charged.put("P", new Integer(0));
\r
1016 charged.put("-", new Integer(1));
\r
1017 charged.put("*", new Integer(1));
\r
1022 aromatic.put("I", new Integer(0));
\r
1023 aromatic.put("L", new Integer(0));
\r
1024 aromatic.put("V", new Integer(0));
\r
1025 aromatic.put("C", new Integer(0));
\r
1026 aromatic.put("A", new Integer(0));
\r
1027 aromatic.put("G", new Integer(0));
\r
1028 aromatic.put("M", new Integer(0));
\r
1029 aromatic.put("F", new Integer(1));
\r
1030 aromatic.put("Y", new Integer(1));
\r
1031 aromatic.put("W", new Integer(1));
\r
1032 aromatic.put("H", new Integer(1));
\r
1033 aromatic.put("K", new Integer(0));
\r
1034 aromatic.put("R", new Integer(0));
\r
1035 aromatic.put("E", new Integer(0));
\r
1036 aromatic.put("Q", new Integer(0));
\r
1037 aromatic.put("D", new Integer(0));
\r
1038 aromatic.put("N", new Integer(0));
\r
1039 aromatic.put("S", new Integer(0));
\r
1040 aromatic.put("T", new Integer(0));
\r
1041 aromatic.put("P", new Integer(0));
\r
1042 aromatic.put("-", new Integer(1));
\r
1043 aromatic.put("*", new Integer(1));
\r
1048 aliphatic.put("I", new Integer(1));
\r
1049 aliphatic.put("L", new Integer(1));
\r
1050 aliphatic.put("V", new Integer(1));
\r
1051 aliphatic.put("C", new Integer(0));
\r
1052 aliphatic.put("A", new Integer(0));
\r
1053 aliphatic.put("G", new Integer(0));
\r
1054 aliphatic.put("M", new Integer(0));
\r
1055 aliphatic.put("F", new Integer(0));
\r
1056 aliphatic.put("Y", new Integer(0));
\r
1057 aliphatic.put("W", new Integer(0));
\r
1058 aliphatic.put("H", new Integer(0));
\r
1059 aliphatic.put("K", new Integer(0));
\r
1060 aliphatic.put("R", new Integer(0));
\r
1061 aliphatic.put("E", new Integer(0));
\r
1062 aliphatic.put("Q", new Integer(0));
\r
1063 aliphatic.put("D", new Integer(0));
\r
1064 aliphatic.put("N", new Integer(0));
\r
1065 aliphatic.put("S", new Integer(0));
\r
1066 aliphatic.put("T", new Integer(0));
\r
1067 aliphatic.put("P", new Integer(0));
\r
1068 aliphatic.put("-", new Integer(1));
\r
1069 aliphatic.put("*", new Integer(1));
\r
1074 tiny.put("I", new Integer(0));
\r
1075 tiny.put("L", new Integer(0));
\r
1076 tiny.put("V", new Integer(0));
\r
1077 tiny.put("C", new Integer(0));
\r
1078 tiny.put("A", new Integer(1));
\r
1079 tiny.put("G", new Integer(1));
\r
1080 tiny.put("M", new Integer(0));
\r
1081 tiny.put("F", new Integer(0));
\r
1082 tiny.put("Y", new Integer(0));
\r
1083 tiny.put("W", new Integer(0));
\r
1084 tiny.put("H", new Integer(0));
\r
1085 tiny.put("K", new Integer(0));
\r
1086 tiny.put("R", new Integer(0));
\r
1087 tiny.put("E", new Integer(0));
\r
1088 tiny.put("Q", new Integer(0));
\r
1089 tiny.put("D", new Integer(0));
\r
1090 tiny.put("N", new Integer(0));
\r
1091 tiny.put("S", new Integer(1));
\r
1092 tiny.put("T", new Integer(0));
\r
1093 tiny.put("P", new Integer(0));
\r
1094 tiny.put("-", new Integer(1));
\r
1095 tiny.put("*", new Integer(1));
\r
1100 proline.put("I", new Integer(0));
\r
1101 proline.put("L", new Integer(0));
\r
1102 proline.put("V", new Integer(0));
\r
1103 proline.put("C", new Integer(0));
\r
1104 proline.put("A", new Integer(0));
\r
1105 proline.put("G", new Integer(0));
\r
1106 proline.put("M", new Integer(0));
\r
1107 proline.put("F", new Integer(0));
\r
1108 proline.put("Y", new Integer(0));
\r
1109 proline.put("W", new Integer(0));
\r
1110 proline.put("H", new Integer(0));
\r
1111 proline.put("K", new Integer(0));
\r
1112 proline.put("R", new Integer(0));
\r
1113 proline.put("E", new Integer(0));
\r
1114 proline.put("Q", new Integer(0));
\r
1115 proline.put("D", new Integer(0));
\r
1116 proline.put("N", new Integer(0));
\r
1117 proline.put("S", new Integer(0));
\r
1118 proline.put("T", new Integer(0));
\r
1119 proline.put("P", new Integer(1));
\r
1120 proline.put("-", new Integer(1));
\r
1121 proline.put("*", new Integer(1));
\r
1126 propHash.put("hydrophobic", hydrophobic);
\r
1127 propHash.put("small", small);
\r
1128 propHash.put("positive", positive);
\r
1129 propHash.put("negative", negative);
\r
1130 propHash.put("charged", charged);
\r
1131 propHash.put("aromatic", aromatic);
\r
1132 propHash.put("aliphatic", aliphatic);
\r
1133 propHash.put("tiny", tiny);
\r
1134 propHash.put("proline", proline);
\r
1135 propHash.put("polar", polar);
\r
1138 private ResidueProperties()
\r
1142 public static double getHydmax()
\r
1147 public static double getHydmin()
\r
1152 public static double[] getHyd()
\r
1157 public static Hashtable getAAHash()
\r
1162 public static Hashtable getAA3Hash()
\r
1167 public static int[][] getDNA()
\r
1169 return ResidueProperties.DNA;
\r
1172 public static int[][] getBLOSUM62()
\r
1174 return ResidueProperties.BLOSUM62;
\r
1177 public static int getPAM250(String A1, String A2)
\r
1179 Integer pog1 = (Integer) aaHash.get(A1);
\r
1180 Integer pog2 = (Integer) aaHash.get(A2);
\r
1181 int pog = ResidueProperties.PAM250[pog1.intValue()][pog2.intValue()];
\r
1186 public static int getBLOSUM62(String A1, String A2)
\r
1192 Integer pog1 = (Integer) aaHash.get(A1);
\r
1193 Integer pog2 = (Integer) aaHash.get(A2);
\r
1194 pog = ResidueProperties.BLOSUM62[pog1.intValue()][pog2.intValue()];
\r
1196 catch (Exception e)
\r
1198 //System.out.println("Unknown residue in " + A1 + " " + A2);
\r
1204 public static Vector getCodons(String res)
\r
1206 if (codonHash.containsKey(res))
\r
1208 return (Vector) codonHash.get(res);
\r
1214 public static String codonTranslate(String codon)
\r
1216 Enumeration e = codonHash.keys();
\r
1218 while (e.hasMoreElements())
\r
1220 String key = (String) e.nextElement();
\r
1221 Vector tmp = (Vector) codonHash.get(key);
\r
1223 if (tmp.contains(codon.toUpperCase()))
\r