aaIndex replaces aaHash
[jalview.git] / src / jalview / schemes / ResidueProperties.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer\r
3  * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
4  *\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
9  *\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
14  *\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
18  */\r
19 package jalview.schemes;\r
20 \r
21 import java.util.*;\r
22 \r
23 import java.awt.*;\r
24 \r
25 public class ResidueProperties\r
26 {\r
27   //Stores residue codes/names and colours and other things\r
28   public static final int [] aaIndex; // aaHash version 2.1.1 and below\r
29   public static final int [] nucleotideIndex;\r
30   public static final Hashtable aa3Hash = new Hashtable();\r
31   public static final Hashtable aa2Triplet = new Hashtable();\r
32   public static final Hashtable nucleotideName = new Hashtable();\r
33 \r
34 \r
35   static\r
36   {\r
37     aaIndex = new int[132];\r
38     for(int i=0; i<132; i++)\r
39       aaIndex[i] = -1;\r
40 \r
41     aaIndex['A'] = 0;\r
42     aaIndex['R'] = 1;\r
43     aaIndex['N'] = 2;\r
44     aaIndex['D'] = 3;\r
45     aaIndex['C'] = 4;\r
46     aaIndex['Q'] = 5;\r
47     aaIndex['E'] = 6;\r
48     aaIndex['G'] = 7;\r
49     aaIndex['H'] = 8;\r
50     aaIndex['I'] = 9;\r
51     aaIndex['L'] = 10;\r
52     aaIndex['K'] = 11;\r
53     aaIndex['M'] = 12;\r
54     aaIndex['F'] = 13;\r
55     aaIndex['P'] = 14;\r
56     aaIndex['S'] = 15;\r
57     aaIndex['T'] = 16;\r
58     aaIndex['W'] = 17;\r
59     aaIndex['Y'] = 18;\r
60     aaIndex['V'] = 19;\r
61     aaIndex['B'] = 20;\r
62     aaIndex['Z'] = 21;\r
63     aaIndex['X'] = 22;\r
64     aaIndex['U'] = 22;\r
65     aaIndex['a'] = 0;\r
66     aaIndex['r'] = 1;\r
67     aaIndex['n'] = 2;\r
68     aaIndex['d'] = 3;\r
69     aaIndex['c'] = 4;\r
70     aaIndex['q'] = 5;\r
71     aaIndex['e'] = 6;\r
72     aaIndex['g'] = 7;\r
73     aaIndex['h'] = 8;\r
74     aaIndex['i'] = 9;\r
75     aaIndex['l'] = 10;\r
76     aaIndex['k'] = 11;\r
77     aaIndex['m'] = 12;\r
78     aaIndex['f'] = 13;\r
79     aaIndex['p'] = 14;\r
80     aaIndex['s'] = 15;\r
81     aaIndex['t'] = 16;\r
82     aaIndex['w'] = 17;\r
83     aaIndex['y'] = 18;\r
84     aaIndex['v'] = 19;\r
85     aaIndex['b'] = 20;\r
86     aaIndex['z'] = 21;\r
87     aaIndex['x'] = 22;\r
88     aaIndex['u'] = 22;\r
89     aaIndex['-'] = 23;\r
90     aaIndex['*'] = 23;\r
91     aaIndex['.'] = 23;\r
92     aaIndex[' '] = 23;\r
93   }\r
94 \r
95   static\r
96   {\r
97     nucleotideIndex = new int[132];\r
98     for (int i = 0; i < 132; i++)\r
99       nucleotideIndex[i] = -1;\r
100 \r
101     nucleotideIndex['A'] = 0;\r
102     nucleotideIndex['a'] = 0;\r
103     nucleotideIndex['C'] = 1;\r
104     nucleotideIndex['c'] = 1;\r
105     nucleotideIndex['G'] = 2;\r
106     nucleotideIndex['g'] = 2;\r
107     nucleotideIndex['T'] = 3;\r
108     nucleotideIndex['t'] = 3;\r
109     nucleotideIndex['U'] = 4;\r
110     nucleotideIndex['u'] = 4;\r
111     nucleotideIndex['I'] = 5;\r
112     nucleotideIndex['i'] = 5;\r
113     nucleotideIndex['X'] = 6;\r
114     nucleotideIndex['x'] = 6;\r
115     nucleotideIndex['R'] = 7;\r
116     nucleotideIndex['r'] = 7;\r
117     nucleotideIndex['Y'] = 8;\r
118     nucleotideIndex['y'] = 8;\r
119     nucleotideIndex['N'] = 9;\r
120     nucleotideIndex['n'] = 9;\r
121 \r
122 \r
123     nucleotideName.put("A", "Adenine");\r
124     nucleotideName.put("a", "Adenine");\r
125     nucleotideName.put("G", "Guanine");\r
126     nucleotideName.put("g", "Guanine");\r
127     nucleotideName.put("C", "Cytosine");\r
128     nucleotideName.put("c", "Cytosine");\r
129     nucleotideName.put("T", "Thymine");\r
130     nucleotideName.put("t", "Thymine");\r
131     nucleotideName.put("U", "Uracil");\r
132     nucleotideName.put("u", "Uracil");\r
133     nucleotideName.put("I", "Inosine");\r
134     nucleotideName.put("i", "Inosine");\r
135     nucleotideName.put("X", "Xanthine");\r
136     nucleotideName.put("x", "Xanthine");\r
137     nucleotideName.put("R", "Unknown Purine");\r
138     nucleotideName.put("r", "Unknown Purine");\r
139     nucleotideName.put("Y", "Unknown Pyrimidine");\r
140     nucleotideName.put("y", "Unknown Pyrimidine");\r
141     nucleotideName.put("N", "Unknown");\r
142     nucleotideName.put("n", "Unknown");\r
143   }\r
144 \r
145 \r
146   static\r
147   {\r
148     aa3Hash.put("ALA", new Integer(0));\r
149     aa3Hash.put("ARG", new Integer(1));\r
150     aa3Hash.put("ASN", new Integer(2));\r
151     aa3Hash.put("ASP", new Integer(3)); //D\r
152     aa3Hash.put("CYS", new Integer(4));\r
153     aa3Hash.put("GLN", new Integer(5)); //Q\r
154     aa3Hash.put("GLU", new Integer(6)); // E\r
155     aa3Hash.put("GLY", new Integer(7));\r
156     aa3Hash.put("HIS", new Integer(8));\r
157     aa3Hash.put("ILE", new Integer(9));\r
158     aa3Hash.put("LEU", new Integer(10));\r
159     aa3Hash.put("LYS", new Integer(11));\r
160     aa3Hash.put("MET", new Integer(12));\r
161     aa3Hash.put("PHE", new Integer(13));\r
162     aa3Hash.put("PRO", new Integer(14));\r
163     aa3Hash.put("SER", new Integer(15));\r
164     aa3Hash.put("THR", new Integer(16));\r
165     aa3Hash.put("TRP", new Integer(17));\r
166     aa3Hash.put("TYR", new Integer(18));\r
167     aa3Hash.put("VAL", new Integer(19));\r
168     // IUB Nomenclature for ambiguous peptides\r
169     aa3Hash.put("ASX", new Integer(20)); // "B";\r
170     aa3Hash.put("GLX", new Integer(21)); // X\r
171     aa3Hash.put("XAA", new Integer(22));// X unknown\r
172     aa3Hash.put("-", new Integer(23));\r
173     aa3Hash.put("*", new Integer(23));\r
174     aa3Hash.put(".", new Integer(23));\r
175     aa3Hash.put(" ", new Integer(23));\r
176     aa3Hash.put("Gap", new Integer(23));\r
177   }\r
178 \r
179   static\r
180   {\r
181     aa2Triplet.put("A", "ALA");\r
182     aa2Triplet.put("a", "ALA");\r
183     aa2Triplet.put("R", "ARG");\r
184     aa2Triplet.put("r", "ARG");\r
185     aa2Triplet.put("N", "ASN");\r
186     aa2Triplet.put("n", "ASN");\r
187     aa2Triplet.put("D", "ASP");\r
188     aa2Triplet.put("d", "ASP");\r
189     aa2Triplet.put("C", "CYS");\r
190     aa2Triplet.put("c", "CYS");\r
191     aa2Triplet.put("Q", "GLN");\r
192     aa2Triplet.put("q", "GLN");\r
193     aa2Triplet.put("E", "GLU");\r
194     aa2Triplet.put("e", "GLU");\r
195     aa2Triplet.put("G", "GLY");\r
196     aa2Triplet.put("g", "GLY");\r
197     aa2Triplet.put("H", "HIS");\r
198     aa2Triplet.put("h", "HIS");\r
199     aa2Triplet.put("I", "ILE");\r
200     aa2Triplet.put("i", "ILE");\r
201     aa2Triplet.put("L", "LEU");\r
202     aa2Triplet.put("l", "LEU");\r
203     aa2Triplet.put("K", "LYS");\r
204     aa2Triplet.put("k", "LYS");\r
205     aa2Triplet.put("M", "MET");\r
206     aa2Triplet.put("m", "MET");\r
207     aa2Triplet.put("F", "PHE");\r
208     aa2Triplet.put("f", "PHE");\r
209     aa2Triplet.put("P", "PRO");\r
210     aa2Triplet.put("p", "PRO");\r
211     aa2Triplet.put("S", "SER");\r
212     aa2Triplet.put("s", "SER");\r
213     aa2Triplet.put("T", "THR");\r
214     aa2Triplet.put("t", "THR");\r
215     aa2Triplet.put("W", "TRP");\r
216     aa2Triplet.put("w", "TRP");\r
217     aa2Triplet.put("Y", "TYR");\r
218     aa2Triplet.put("y", "TYR");\r
219     aa2Triplet.put("V", "VAL");\r
220     aa2Triplet.put("v", "VAL");\r
221   }\r
222 \r
223   public static final String[] aa =\r
224       {\r
225       "A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F",\r
226       "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "_", "*", ".", " "\r
227   };\r
228   public static final Color midBlue = new Color(100, 100, 255);\r
229   public static final Vector scaleColours = new Vector();\r
230 \r
231   static\r
232   {\r
233     scaleColours.addElement(new Color(114, 0, 147));\r
234     scaleColours.addElement(new Color(156, 0, 98));\r
235     scaleColours.addElement(new Color(190, 0, 0));\r
236     scaleColours.addElement(Color.red);\r
237     scaleColours.addElement(new Color(255, 125, 0));\r
238     scaleColours.addElement(Color.orange);\r
239     scaleColours.addElement(new Color(255, 194, 85));\r
240     scaleColours.addElement(Color.yellow);\r
241     scaleColours.addElement(new Color(255, 255, 181));\r
242     scaleColours.addElement(Color.white);\r
243   }\r
244 \r
245   public static final Color[] taylor =\r
246       {\r
247       new Color(204, 255, 0), // A  Greenish-yellowy-yellow\r
248       new Color(0, 0, 255), // R  Blueish-bluey-blue\r
249       new Color(204, 0, 255), // N  Blueish-reddy-blue\r
250       new Color(255, 0, 0), // D  Reddish-reddy-red\r
251       new Color(255, 255, 0), // C  Yellowish-yellowy-yellow\r
252       new Color(255, 0, 204), // Q  Reddish-bluey-red\r
253       new Color(255, 0, 102), // E  Blueish-reddy-red\r
254       new Color(255, 153, 0), // G  Yellowy-reddy-yellow\r
255       new Color(0, 102, 255), // H  Greenish-bluey-blue\r
256       new Color(102, 255, 0), // I  Greenish-yellowy-green\r
257       new Color(51, 255, 0), // L  Yellowish-greeny-green\r
258       new Color(102, 0, 255), // K  Reddish-bluey-blue\r
259       new Color(0, 255, 0), // M  Greenish-greeny-green\r
260       new Color(0, 255, 102), // F  Blueish-greeny-green\r
261       new Color(255, 204, 0), // P  Reddish-yellowy-yellow\r
262       new Color(255, 51, 0), // S  Yellowish-reddy-red\r
263       new Color(255, 102, 0), // T  Reddish-yellowy-red\r
264       new Color(0, 204, 255), // W  Blueish-greeny-green\r
265       new Color(0, 255, 204), // Y  Greenish-bluey-green\r
266       new Color(153, 255, 0), // V  Yellowish-greeny-yellow\r
267       Color.white, // B\r
268       Color.white, // Z\r
269       Color.white, // X\r
270       Color.white, // -\r
271       Color.white, // *\r
272       Color.white // .\r
273   };\r
274   public static final Color[] nucleotide =\r
275       {\r
276       new Color(100, 247, 63), // A\r
277       new Color(255, 179, 64), // C\r
278       new Color(235, 65, 60), // G\r
279       new Color(60, 136, 238), // T\r
280       new Color(60, 136, 238) // U\r
281   };\r
282   public static final Color[] color =\r
283       {\r
284       Color.pink, // A\r
285       midBlue, // R\r
286       Color.green, // N\r
287       Color.red, // D\r
288       Color.yellow, // C\r
289       Color.green, // Q\r
290       Color.red, // E\r
291       Color.magenta, // G\r
292       Color.red, // H\r
293       Color.pink, // I\r
294       Color.pink, // L\r
295       midBlue, // K\r
296       Color.pink, // M\r
297       Color.orange, // F\r
298       Color.magenta, // P\r
299       Color.green, // S\r
300       Color.green, // T\r
301       Color.orange, // W\r
302       Color.orange, // Y\r
303       Color.pink, // V\r
304       Color.white, // B\r
305       Color.white, // Z\r
306       Color.white, // X\r
307       Color.white, // -\r
308       Color.white, // *\r
309       Color.white, // .\r
310       Color.white // ' '\r
311   };\r
312 \r
313   // Dunno where I got these numbers from\r
314   public static final double[] hyd2 =\r
315       {\r
316       0.62, //A\r
317       0.29, //R\r
318       -0.90, //N\r
319       -0.74, //D\r
320       1.19, //C\r
321       0.48, //Q\r
322       -0.40, //E\r
323       1.38, //G\r
324       -1.50, //H\r
325       1.06, //I\r
326       0.64, //L\r
327       -0.78, //K\r
328       0.12, //M\r
329       -0.85, //F\r
330       -2.53, //P\r
331       -0.18, //S\r
332       -0.05, //T\r
333       1.08, //W\r
334       0.81, //Y\r
335       0.0, //V\r
336       0.26, //B\r
337       0.0, //Z\r
338       0.0 //X\r
339   };\r
340   public static final double[] helix =\r
341       {\r
342       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
343       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
344   };\r
345   public static final double helixmin = 0.57;\r
346   public static final double helixmax = 1.51;\r
347   public static final double[] strand =\r
348       {\r
349       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
350       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
351   };\r
352   public static final double strandmin = 0.37;\r
353   public static final double strandmax = 1.7;\r
354   public static final double[] turn =\r
355       {\r
356       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
357       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
358   };\r
359   public static final double turnmin = 0.47;\r
360   public static final double turnmax = 1.56;\r
361   public static final double[] buried =\r
362       {\r
363       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
364       0.6, 0.8, 0.7, 1.6, 0.5, 2.9, 0.4, 0.3, 1.358, 0.00\r
365   };\r
366   public static final double buriedmin = 0.05;\r
367   public static final double buriedmax = 4.6;\r
368 \r
369   // This is hydropathy index\r
370   // Kyte, J., and Doolittle, R.F., J. Mol. Biol.\r
371   // 1157, 105-132, 1982\r
372   public static final double[] hyd =\r
373       {\r
374       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
375       2.8, -1.6, -0.8, -0.7, -0.9, -1.3, 4.2, -3.5, -3.5, -0.49, 0.0\r
376   };\r
377   public static final double hydmax = 4.5;\r
378   public static final double hydmin = -3.9;\r
379 \r
380   //public static final double hydmax = 1.38;\r
381   //public static final double hydmin = -2.53;\r
382   static final int[][] BLOSUM62 =\r
383       {\r
384       {\r
385       4, -1, -2, -2, 0, -1, -1, 0, -2, -1, -1, -1, -1, -2, -1, 1, 0, -3,\r
386       -2, 0, -2, -1, 0, -4\r
387   },\r
388       {\r
389       -1, 5, 0, -2, -3, 1, 0, -2, 0, -3, -2, 2, -1, -3, -2, -1, -1, -3, -2,\r
390       -3, -1, 0, -1, -4\r
391   },\r
392       {\r
393       -2, 0, 6, 1, -3, 0, 0, 0, 1, -3, -3, 0, -2, -3, -2, 1, 0, -4, -2, -3,\r
394       3, 0, -1, -4\r
395   },\r
396       {\r
397       -2, -2, 1, 6, -3, 0, 2, -1, -1, -3, -4, -1, -3, -3, -1, 0, -1, -4,\r
398       -3, -3, 4, 1, -1, -4\r
399   },\r
400       {\r
401       0, 3, -3, -3, 9, -3, -4, -3, -3, -1, -1, -3, -1, -2, -3, -1, -1, -2,\r
402       -2, -1, -3, -3, -2, -4\r
403   },\r
404       {\r
405       -1, 1, 0, 0, -3, 5, 2, -2, 0, -3, -2, 1, 0, -3, -1, 0, -1, -2, -1,\r
406       -2, 0, 3, -1, -4\r
407   },\r
408       {\r
409       -1, 0, 0, 2, -4, 2, 5, -2, 0, -3, -3, 1, -2, -3, -1, 0, -1, -3, -2,\r
410       -2, 1, 4, -1, -4\r
411   },\r
412       {\r
413       0, -2, 0, -1, -3, -2, -2, 6, -2, -4, -4, -2, -3, -3, -2, 0, -2, -2,\r
414       -3, -3, -1, -2, -1, -4\r
415   },\r
416       {\r
417       -2, 0, 1, -1, -3, 0, 0, -2, 8, -3, -3, -1, -2, -1, -2, -1, -2, -2, 2,\r
418       -3, 0, 0, -1, -4\r
419   },\r
420       {\r
421       -1, -3, -3, -3, -1, -3, -3, -4, -3, 4, 2, -3, 1, 0, -3, -2, -1, -3,\r
422       -1, 3, -3, -3, -1, -4\r
423   },\r
424       {\r
425       -1, -2, -3, -4, -1, -2, -3, -4, -3, 2, 4, -2, 2, 0, -3, -2, -1, -2,\r
426       -1, 1, -4, -3, -1, -4\r
427   },\r
428       {\r
429       -1, 2, 0, -1, -3, 1, 1, -2, -1, -3, -2, 5, -1, -3, -1, 0, -1, -3, -2,\r
430       -2, 0, 1, -1, -4\r
431   },\r
432       {\r
433       -1, -1, -2, -3, -1, 0, -2, -3, -2, 1, 2, -1, 5, 0, -2, -1, -1, -1,\r
434       -1, 1, -3, -1, -1, -4\r
435   },\r
436       {\r
437       -2, -3, -3, -3, -2, -3, -3, -3, -1, 0, 0, -3, 0, 6, -4, -2, -2, 1, 3,\r
438       -1, -3, -3, -1, -4\r
439   },\r
440       {\r
441       -1, -2, -2, -1, -3, -1, -1, -2, -2, -3, -3, -1, -2, -4, 7, -1, -1,\r
442       -4, -3, -2, -2, -1, -2, -4\r
443   },\r
444       {\r
445       1, -1, 1, 0, -1, 0, 0, 0, -1, -2, -2, 0, -1, -2, -1, 4, 1, -3, -2,\r
446       -2, 0, 0, 0, -4\r
447   },\r
448       {\r
449       0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, -2, -1, 1, 5, -2,\r
450       -2, 0, -1, -1, 0, -4\r
451   },\r
452       {\r
453       -3, -3, -4, -4, -2, -2, -3, -2, -2, -3, -2, -3, -1, 1, -4, -3, -2,\r
454       11, 2, -3, -4, -3, -2, -4\r
455   },\r
456       {\r
457       -2, -2, -2, -3, -2, -1, -2, -3, 2, -1, -1, -2, -1, 3, -3, -2, -2, 2,\r
458       7, -1, -3, -2, -1, -4\r
459   },\r
460       {\r
461       0, -3, -3, -3, -1, -2, -2, -3, -3, 3, 1, -2, 1, -1, -2, -2, 0, -3,\r
462       -1, 4, -3, -2, -1, -4\r
463   },\r
464       {\r
465       -2, -1, 3, 4, -3, 0, 1, -1, 0, -3, -4, 0, -3, -3, -2, 0, -1, -4, -3,\r
466       -3, 4, 1, -1, -4\r
467   },\r
468       {\r
469       -1, 0, 0, 1, -3, 3, 4, -2, 0, -3, -3, 1, -1, -3, -1, 0, -1, -3, -2,\r
470       -2, 1, 4, -1, -4\r
471   },\r
472       {\r
473       0, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 0, 0, -2,\r
474       -1, -1, -1, -1, -1, -4\r
475   },\r
476       {\r
477       -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,\r
478       -4, -4, -4, -4, -4, -4, 1\r
479   },\r
480   };\r
481   static final int[][] PAM250 =\r
482       {\r
483       {\r
484       2, -2, 0, 0, -2, 0, 0, 1, -1, -1, -2, -1, -1, -3, 1, 1, 1, -6, -3, 0,\r
485       0, 0, 0, -8\r
486   },\r
487       {\r
488       -2, 6, 0, -1, -4, 1, -1, -3, 2, -2, -3, 3, 0, -4, 0, 0, -1, 2, -4,\r
489       -2, -1, 0, -1, -8\r
490   },\r
491       {\r
492       0, 0, 2, 2, -4, 1, 1, 0, 2, -2, -3, 1, -2, -3, 0, 1, 0, -4, -2, -2,\r
493       2, 1, 0, -8\r
494   },\r
495       {\r
496       0, -1, 2, 4, -5, 2, 3, 1, 1, -2, -4, 0, -3, -6, -1, 0, 0, -7, -4, -2,\r
497       3, 3, -1, -8\r
498   },\r
499       {\r
500       -2, -4, -4, -5, 12, -5, -5, -3, -3, -2, -6, -5, -5, -4, -3, 0, -2,\r
501       -8, 0, -2, -4, -5, -3, -8\r
502   },\r
503       {\r
504       0, 1, 1, 2, -5, 4, 2, -1, 3, -2, -2, 1, -1, -5, 0, -1, -1, -5, -4,\r
505       -2, 1, 3, -1, -8\r
506   },\r
507       {\r
508       0, -1, 1, 3, -5, 2, 4, 0, 1, -2, -3, 0, -2, -5, -1, 0, 0, -7, -4, -2,\r
509       3, 3, -1, -8\r
510   },\r
511       {\r
512       1, -3, 0, 1, -3, -1, 0, 5, -2, -3, -4, -2, -3, -5, 0, 1, 0, -7, -5,\r
513       -1, 0, 0, -1, -8\r
514   },\r
515       {\r
516       -1, 2, 2, 1, -3, 3, 1, -2, 6, -2, -2, 0, -2, -2, 0, -1, -1, -3, 0,\r
517       -2, 1, 2, -1, -8\r
518   },\r
519       {\r
520       -1, -2, -2, -2, -2, -2, -2, -3, -2, 5, 2, -2, 2, 1, -2, -1, 0, -5,\r
521       -1, 4, -2, -2, -1, -8\r
522   },\r
523       {\r
524       -2, -3, -3, -4, -6, -2, -3, -4, -2, 2, 6, -3, 4, 2, -3, -3, -2, -2,\r
525       -1, 2, -3, -3, -1, -8\r
526   },\r
527       {\r
528       -1, 3, 1, 0, -5, 1, 0, -2, 0, -2, -3, 5, 0, -5, -1, 0, 0, -3, -4, -2,\r
529       1, 0, -1, -8\r
530   },\r
531       {\r
532       -1, 0, -2, -3, -5, -1, -2, -3, -2, 2, 4, 0, 6, 0, -2, -2, -1, -4, -2,\r
533       2, -2, -2, -1, -8\r
534   },\r
535       {\r
536       -3, -4, -3, -6, -4, -5, -5, -5, -2, 1, 2, -5, 0, 9, -5, -3, -3, 0, 7,\r
537       -1, -4, -5, -2, -8\r
538   },\r
539       {\r
540       1, 0, 0, -1, -3, 0, -1, 0, 0, -2, -3, -1, -2, -5, 6, 1, 0, -6, -5,\r
541       -1, -1, 0, -1, -8\r
542   },\r
543       {\r
544       1, 0, 1, 0, 0, -1, 0, 1, -1, -1, -3, 0, -2, -3, 1, 2, 1, -2, -3, -1,\r
545       0, 0, 0, -8\r
546   },\r
547       {\r
548       1, -1, 0, 0, -2, -1, 0, 0, -1, 0, -2, 0, -1, -3, 0, 1, 3, -5, -3, 0,\r
549       0, -1, 0, -8\r
550   },\r
551       {\r
552       -6, 2, -4, -7, -8, -5, -7, -7, -3, -5, -2, -3, -4, 0, -6, -2, -5, 17,\r
553       0, -6, -5, -6, -4, -8\r
554   },\r
555       {\r
556       -3, -4, -2, -4, 0, -4, -4, -5, 0, -1, -1, -4, -2, 7, -5, -3, -3, 0,\r
557       10, -2, -3, -4, -2, -8\r
558   },\r
559       {\r
560       0, -2, -2, -2, -2, -2, -2, -1, -2, 4, 2, -2, 2, -1, -1, -1, 0, -6,\r
561       -2, 4, -2, -2, -1, -8\r
562   },\r
563       {\r
564       0, -1, 2, 3, -4, 1, 3, 0, 1, -2, -3, 1, -2, -4, -1, 0, 0, -5, -3, -2,\r
565       3, 2, -1, -8\r
566   },\r
567       {\r
568       0, 0, 1, 3, -5, 3, 3, 0, 2, -2, -3, 0, -2, -5, 0, 0, -1, -6, -4, -2,\r
569       2, 3, -1, -8\r
570   },\r
571       {\r
572       0, -1, 0, -1, -3, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, 0, 0, -4,\r
573       -2, -1, -1, -1, -1, -8\r
574   },\r
575       {\r
576       -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,\r
577       -8, -8, -8, -8, -8, -8, 1\r
578   },\r
579   };\r
580   public static final Hashtable ssHash = new Hashtable(); // stores the number value of the aa\r
581 \r
582   static\r
583   {\r
584     ssHash.put("H", Color.magenta);\r
585     ssHash.put("E", Color.yellow);\r
586     ssHash.put("-", Color.white);\r
587     ssHash.put(".", Color.white);\r
588     ssHash.put("S", Color.cyan);\r
589     ssHash.put("T", Color.blue);\r
590     ssHash.put("G", Color.pink);\r
591     ssHash.put("I", Color.pink);\r
592     ssHash.put("B", Color.yellow);\r
593   }\r
594 \r
595   static final int[][] DNA =\r
596       {\r
597       {\r
598       5, -4, -4, -4, 1}, // C\r
599       {\r
600       -4, 5, -4, -4, 1}, // T\r
601       {\r
602       -4, -4, 5, -4, 1}, // A\r
603       {\r
604       -4, -4, -4, 5, 1}, // G\r
605       {\r
606       1, 1, 1, 1, 1}, // -\r
607   };\r
608   public static final Color[] pidColours =\r
609       {\r
610       midBlue, new Color(153, 153, 255),\r
611       //    Color.lightGray,\r
612       new Color(204, 204, 255),\r
613   };\r
614   public static final float[] pidThresholds =\r
615       {\r
616       80, 60, 40, };\r
617   public static Hashtable codonHash = new Hashtable();\r
618   public static Vector Lys = new Vector();\r
619   public static Vector Asn = new Vector();\r
620   public static Vector Gln = new Vector();\r
621   public static Vector His = new Vector();\r
622   public static Vector Glu = new Vector();\r
623   public static Vector Asp = new Vector();\r
624   public static Vector Tyr = new Vector();\r
625   public static Vector Thr = new Vector();\r
626   public static Vector Pro = new Vector();\r
627   public static Vector Ala = new Vector();\r
628   public static Vector Ser = new Vector();\r
629   public static Vector Arg = new Vector();\r
630   public static Vector Gly = new Vector();\r
631   public static Vector Trp = new Vector();\r
632   public static Vector Cys = new Vector();\r
633   public static Vector Ile = new Vector();\r
634   public static Vector Met = new Vector();\r
635   public static Vector Leu = new Vector();\r
636   public static Vector Val = new Vector();\r
637   public static Vector Phe = new Vector();\r
638   public static Vector STOP = new Vector();\r
639 \r
640   static\r
641   {\r
642     codonHash.put("K", Lys);\r
643     codonHash.put("N", Asn);\r
644     codonHash.put("Q", Gln);\r
645     codonHash.put("H", His);\r
646     codonHash.put("E", Glu);\r
647     codonHash.put("D", Asp);\r
648     codonHash.put("Y", Tyr);\r
649     codonHash.put("T", Thr);\r
650     codonHash.put("P", Pro);\r
651     codonHash.put("A", Ala);\r
652     codonHash.put("S", Ser);\r
653     codonHash.put("R", Arg);\r
654     codonHash.put("G", Gly);\r
655     codonHash.put("W", Trp);\r
656     codonHash.put("C", Cys);\r
657     codonHash.put("I", Ile);\r
658     codonHash.put("M", Met);\r
659     codonHash.put("L", Leu);\r
660     codonHash.put("V", Val);\r
661     codonHash.put("F", Phe);\r
662     codonHash.put("STOP", STOP);\r
663   }\r
664 \r
665   public static Hashtable codonHash2 = new Hashtable();\r
666 \r
667   static\r
668   {\r
669     codonHash2.put("AAA", "K");\r
670     codonHash2.put("AAG", "K");\r
671     codonHash2.put("AAC", "N");\r
672     codonHash2.put("AAT", "N");\r
673 \r
674     codonHash2.put("CAA", "E");\r
675     codonHash2.put("CAG", "E");\r
676     codonHash2.put("CAC", "H");\r
677     codonHash2.put("CAT", "H");\r
678 \r
679     codonHash2.put("GAA", "Q");\r
680     codonHash2.put("GAG", "Q");\r
681     codonHash2.put("GAC", "D");\r
682     codonHash2.put("GAT", "D");\r
683 \r
684     codonHash2.put("TAC", "Y");\r
685     codonHash2.put("TAT", "Y");\r
686 \r
687     codonHash2.put("ACA", "T");\r
688     codonHash2.put("AAG", "T");\r
689     codonHash2.put("ACC", "T");\r
690     codonHash2.put("ACT", "T");\r
691 \r
692     codonHash2.put("CCA", "P");\r
693     codonHash2.put("CCG", "P");\r
694     codonHash2.put("CCC", "P");\r
695     codonHash2.put("CCT", "P");\r
696 \r
697     codonHash2.put("GCA", "A");\r
698     codonHash2.put("GCG", "A");\r
699     codonHash2.put("GCC", "A");\r
700     codonHash2.put("GCT", "A");\r
701 \r
702     codonHash2.put("TCA", "S");\r
703     codonHash2.put("TCG", "S");\r
704     codonHash2.put("TCC", "S");\r
705     codonHash2.put("TCT", "S");\r
706     codonHash2.put("AGC", "S");\r
707     codonHash2.put("AGT", "S");\r
708 \r
709     codonHash2.put("AGA", "R");\r
710     codonHash2.put("AGG", "R");\r
711     codonHash2.put("CGA", "R");\r
712     codonHash2.put("CGG", "R");\r
713     codonHash2.put("CGC", "R");\r
714     codonHash2.put("CGT", "R");\r
715 \r
716     codonHash2.put("GGA", "G");\r
717     codonHash2.put("GGG", "G");\r
718     codonHash2.put("GGC", "G");\r
719     codonHash2.put("GGT", "G");\r
720 \r
721     codonHash2.put("TGA", "*");\r
722     codonHash2.put("TAA", "*");\r
723     codonHash2.put("TAG", "*");\r
724 \r
725     codonHash2.put("TGG", "W");\r
726 \r
727     codonHash2.put("TGC", "C");\r
728     codonHash2.put("TGT", "C");\r
729 \r
730     codonHash2.put("ATA", "I");\r
731     codonHash2.put("ATC", "I");\r
732     codonHash2.put("ATT", "I");\r
733 \r
734     codonHash2.put("ATG", "M");\r
735 \r
736     codonHash2.put("CTA", "L");\r
737     codonHash2.put("CTG", "L");\r
738     codonHash2.put("CTC", "L");\r
739     codonHash2.put("CTT", "L");\r
740     codonHash2.put("TTA", "L");\r
741     codonHash2.put("TTG", "L");\r
742 \r
743     codonHash2.put("GTA", "V");\r
744     codonHash2.put("GTG", "V");\r
745     codonHash2.put("GTC", "V");\r
746     codonHash2.put("GTT", "V");\r
747 \r
748     codonHash2.put("TTC", "F");\r
749     codonHash2.put("TTT", "F");\r
750   }\r
751 \r
752   static\r
753   {\r
754     Lys.addElement("AAA");\r
755     Lys.addElement("AAG");\r
756     Asn.addElement("AAC");\r
757     Asn.addElement("AAT");\r
758 \r
759     Gln.addElement("CAA");\r
760     Gln.addElement("CAG");\r
761     His.addElement("CAC");\r
762     His.addElement("CAT");\r
763 \r
764     Glu.addElement("GAA");\r
765     Glu.addElement("GAG");\r
766     Asp.addElement("GAC");\r
767     Asp.addElement("GAT");\r
768 \r
769     Tyr.addElement("TAC");\r
770     Tyr.addElement("TAT");\r
771 \r
772     Thr.addElement("ACA");\r
773     Thr.addElement("ACG");\r
774     Thr.addElement("ACC");\r
775     Thr.addElement("ACT");\r
776 \r
777     Pro.addElement("CCA");\r
778     Pro.addElement("CCG");\r
779     Pro.addElement("CCC");\r
780     Pro.addElement("CCT");\r
781 \r
782     Ala.addElement("GCA");\r
783     Ala.addElement("GCG");\r
784     Ala.addElement("GCC");\r
785     Ala.addElement("GCT");\r
786 \r
787     Ser.addElement("TCA");\r
788     Ser.addElement("TCG");\r
789     Ser.addElement("TCC");\r
790     Ser.addElement("TCT");\r
791     Ser.addElement("AGC");\r
792     Ser.addElement("AGT");\r
793 \r
794     Arg.addElement("AGA");\r
795     Arg.addElement("AGG");\r
796     Arg.addElement("CGA");\r
797     Arg.addElement("CGG");\r
798     Arg.addElement("CGC");\r
799     Arg.addElement("CGT");\r
800 \r
801     Gly.addElement("GGA");\r
802     Gly.addElement("GGG");\r
803     Gly.addElement("GGC");\r
804     Gly.addElement("GGT");\r
805 \r
806     STOP.addElement("TGA");\r
807     STOP.addElement("TAA");\r
808     STOP.addElement("TAG");\r
809 \r
810     Trp.addElement("TGG");\r
811 \r
812     Cys.addElement("TGC");\r
813     Cys.addElement("TGT");\r
814 \r
815     Ile.addElement("ATA");\r
816     Ile.addElement("ATC");\r
817     Ile.addElement("ATT");\r
818 \r
819     Met.addElement("ATG");\r
820 \r
821     Leu.addElement("CTA");\r
822     Leu.addElement("CTG");\r
823     Leu.addElement("CTC");\r
824     Leu.addElement("CTT");\r
825     Leu.addElement("TTA");\r
826     Leu.addElement("TTG");\r
827 \r
828     Val.addElement("GTA");\r
829     Val.addElement("GTG");\r
830     Val.addElement("GTC");\r
831     Val.addElement("GTT");\r
832 \r
833     Phe.addElement("TTC");\r
834     Phe.addElement("TTT");\r
835   }\r
836 \r
837 \r
838   //Stores residue codes/names and colours and other things\r
839   public static Hashtable propHash = new Hashtable();\r
840   public static Hashtable hydrophobic = new Hashtable();\r
841   public static Hashtable polar = new Hashtable();\r
842   public static Hashtable small = new Hashtable();\r
843   public static Hashtable positive = new Hashtable();\r
844   public static Hashtable negative = new Hashtable();\r
845   public static Hashtable charged = new Hashtable();\r
846   public static Hashtable aromatic = new Hashtable();\r
847   public static Hashtable aliphatic = new Hashtable();\r
848   public static Hashtable tiny = new Hashtable();\r
849   public static Hashtable proline = new Hashtable();\r
850 \r
851   static\r
852   {\r
853     hydrophobic.put("I", new Integer(1));\r
854     hydrophobic.put("L", new Integer(1));\r
855     hydrophobic.put("V", new Integer(1));\r
856     hydrophobic.put("C", new Integer(1));\r
857     hydrophobic.put("A", new Integer(1));\r
858     hydrophobic.put("G", new Integer(1));\r
859     hydrophobic.put("M", new Integer(1));\r
860     hydrophobic.put("F", new Integer(1));\r
861     hydrophobic.put("Y", new Integer(1));\r
862     hydrophobic.put("W", new Integer(1));\r
863     hydrophobic.put("H", new Integer(1));\r
864     hydrophobic.put("K", new Integer(1));\r
865     hydrophobic.put("X", new Integer(1));\r
866     hydrophobic.put("-", new Integer(1));\r
867     hydrophobic.put("*", new Integer(1));\r
868     hydrophobic.put("R", new Integer(0));\r
869     hydrophobic.put("E", new Integer(0));\r
870     hydrophobic.put("Q", new Integer(0));\r
871     hydrophobic.put("D", new Integer(0));\r
872     hydrophobic.put("N", new Integer(0));\r
873     hydrophobic.put("S", new Integer(0));\r
874     hydrophobic.put("T", new Integer(0));\r
875     hydrophobic.put("P", new Integer(0));\r
876   }\r
877 \r
878   static\r
879   {\r
880     polar.put("Y", new Integer(1));\r
881     polar.put("W", new Integer(1));\r
882     polar.put("H", new Integer(1));\r
883     polar.put("K", new Integer(1));\r
884     polar.put("R", new Integer(1));\r
885     polar.put("E", new Integer(1));\r
886     polar.put("Q", new Integer(1));\r
887     polar.put("D", new Integer(1));\r
888     polar.put("N", new Integer(1));\r
889     polar.put("S", new Integer(1));\r
890     polar.put("T", new Integer(1));\r
891     polar.put("X", new Integer(1));\r
892     polar.put("-", new Integer(1));\r
893     polar.put("*", new Integer(1));\r
894     polar.put("I", new Integer(0));\r
895     polar.put("L", new Integer(0));\r
896     polar.put("V", new Integer(0));\r
897     polar.put("C", new Integer(0));\r
898     polar.put("A", new Integer(0));\r
899     polar.put("G", new Integer(0));\r
900     polar.put("M", new Integer(0));\r
901     polar.put("F", new Integer(0));\r
902     polar.put("P", new Integer(0));\r
903   }\r
904 \r
905   static\r
906   {\r
907     small.put("I", new Integer(0));\r
908     small.put("L", new Integer(0));\r
909     small.put("V", new Integer(1));\r
910     small.put("C", new Integer(1));\r
911     small.put("A", new Integer(1));\r
912     small.put("G", new Integer(1));\r
913     small.put("M", new Integer(0));\r
914     small.put("F", new Integer(0));\r
915     small.put("Y", new Integer(0));\r
916     small.put("W", new Integer(0));\r
917     small.put("H", new Integer(0));\r
918     small.put("K", new Integer(0));\r
919     small.put("R", new Integer(0));\r
920     small.put("E", new Integer(0));\r
921     small.put("Q", new Integer(0));\r
922     small.put("D", new Integer(1));\r
923     small.put("N", new Integer(1));\r
924     small.put("S", new Integer(1));\r
925     small.put("T", new Integer(1));\r
926     small.put("P", new Integer(1));\r
927     small.put("-", new Integer(1));\r
928     small.put("*", new Integer(1));\r
929   }\r
930 \r
931   static\r
932   {\r
933     positive.put("I", new Integer(0));\r
934     positive.put("L", new Integer(0));\r
935     positive.put("V", new Integer(0));\r
936     positive.put("C", new Integer(0));\r
937     positive.put("A", new Integer(0));\r
938     positive.put("G", new Integer(0));\r
939     positive.put("M", new Integer(0));\r
940     positive.put("F", new Integer(0));\r
941     positive.put("Y", new Integer(0));\r
942     positive.put("W", new Integer(0));\r
943     positive.put("H", new Integer(1));\r
944     positive.put("K", new Integer(1));\r
945     positive.put("R", new Integer(1));\r
946     positive.put("E", new Integer(0));\r
947     positive.put("Q", new Integer(0));\r
948     positive.put("D", new Integer(0));\r
949     positive.put("N", new Integer(0));\r
950     positive.put("S", new Integer(0));\r
951     positive.put("T", new Integer(0));\r
952     positive.put("P", new Integer(0));\r
953     positive.put("-", new Integer(1));\r
954     positive.put("*", new Integer(1));\r
955   }\r
956 \r
957   static\r
958   {\r
959     negative.put("I", new Integer(0));\r
960     negative.put("L", new Integer(0));\r
961     negative.put("V", new Integer(0));\r
962     negative.put("C", new Integer(0));\r
963     negative.put("A", new Integer(0));\r
964     negative.put("G", new Integer(0));\r
965     negative.put("M", new Integer(0));\r
966     negative.put("F", new Integer(0));\r
967     negative.put("Y", new Integer(0));\r
968     negative.put("W", new Integer(0));\r
969     negative.put("H", new Integer(0));\r
970     negative.put("K", new Integer(0));\r
971     negative.put("R", new Integer(0));\r
972     negative.put("E", new Integer(1));\r
973     negative.put("Q", new Integer(0));\r
974     negative.put("D", new Integer(1));\r
975     negative.put("N", new Integer(0));\r
976     negative.put("S", new Integer(0));\r
977     negative.put("T", new Integer(0));\r
978     negative.put("P", new Integer(0));\r
979     negative.put("-", new Integer(1));\r
980     negative.put("*", new Integer(1));\r
981   }\r
982 \r
983   static\r
984   {\r
985     charged.put("I", new Integer(0));\r
986     charged.put("L", new Integer(0));\r
987     charged.put("V", new Integer(0));\r
988     charged.put("C", new Integer(0));\r
989     charged.put("A", new Integer(0));\r
990     charged.put("G", new Integer(0));\r
991     charged.put("M", new Integer(0));\r
992     charged.put("F", new Integer(0));\r
993     charged.put("Y", new Integer(0));\r
994     charged.put("W", new Integer(0));\r
995     charged.put("H", new Integer(1));\r
996     charged.put("K", new Integer(1));\r
997     charged.put("R", new Integer(1));\r
998     charged.put("E", new Integer(1));\r
999     charged.put("Q", new Integer(0));\r
1000     charged.put("D", new Integer(1));\r
1001     charged.put("N", new Integer(1));\r
1002     charged.put("S", new Integer(0));\r
1003     charged.put("T", new Integer(0));\r
1004     charged.put("P", new Integer(0));\r
1005     charged.put("-", new Integer(1));\r
1006     charged.put("*", new Integer(1));\r
1007   }\r
1008 \r
1009   static\r
1010   {\r
1011     aromatic.put("I", new Integer(0));\r
1012     aromatic.put("L", new Integer(0));\r
1013     aromatic.put("V", new Integer(0));\r
1014     aromatic.put("C", new Integer(0));\r
1015     aromatic.put("A", new Integer(0));\r
1016     aromatic.put("G", new Integer(0));\r
1017     aromatic.put("M", new Integer(0));\r
1018     aromatic.put("F", new Integer(1));\r
1019     aromatic.put("Y", new Integer(1));\r
1020     aromatic.put("W", new Integer(1));\r
1021     aromatic.put("H", new Integer(1));\r
1022     aromatic.put("K", new Integer(0));\r
1023     aromatic.put("R", new Integer(0));\r
1024     aromatic.put("E", new Integer(0));\r
1025     aromatic.put("Q", new Integer(0));\r
1026     aromatic.put("D", new Integer(0));\r
1027     aromatic.put("N", new Integer(0));\r
1028     aromatic.put("S", new Integer(0));\r
1029     aromatic.put("T", new Integer(0));\r
1030     aromatic.put("P", new Integer(0));\r
1031     aromatic.put("-", new Integer(1));\r
1032     aromatic.put("*", new Integer(1));\r
1033   }\r
1034 \r
1035   static\r
1036   {\r
1037     aliphatic.put("I", new Integer(1));\r
1038     aliphatic.put("L", new Integer(1));\r
1039     aliphatic.put("V", new Integer(1));\r
1040     aliphatic.put("C", new Integer(0));\r
1041     aliphatic.put("A", new Integer(0));\r
1042     aliphatic.put("G", new Integer(0));\r
1043     aliphatic.put("M", new Integer(0));\r
1044     aliphatic.put("F", new Integer(0));\r
1045     aliphatic.put("Y", new Integer(0));\r
1046     aliphatic.put("W", new Integer(0));\r
1047     aliphatic.put("H", new Integer(0));\r
1048     aliphatic.put("K", new Integer(0));\r
1049     aliphatic.put("R", new Integer(0));\r
1050     aliphatic.put("E", new Integer(0));\r
1051     aliphatic.put("Q", new Integer(0));\r
1052     aliphatic.put("D", new Integer(0));\r
1053     aliphatic.put("N", new Integer(0));\r
1054     aliphatic.put("S", new Integer(0));\r
1055     aliphatic.put("T", new Integer(0));\r
1056     aliphatic.put("P", new Integer(0));\r
1057     aliphatic.put("-", new Integer(1));\r
1058     aliphatic.put("*", new Integer(1));\r
1059   }\r
1060 \r
1061   static\r
1062   {\r
1063     tiny.put("I", new Integer(0));\r
1064     tiny.put("L", new Integer(0));\r
1065     tiny.put("V", new Integer(0));\r
1066     tiny.put("C", new Integer(0));\r
1067     tiny.put("A", new Integer(1));\r
1068     tiny.put("G", new Integer(1));\r
1069     tiny.put("M", new Integer(0));\r
1070     tiny.put("F", new Integer(0));\r
1071     tiny.put("Y", new Integer(0));\r
1072     tiny.put("W", new Integer(0));\r
1073     tiny.put("H", new Integer(0));\r
1074     tiny.put("K", new Integer(0));\r
1075     tiny.put("R", new Integer(0));\r
1076     tiny.put("E", new Integer(0));\r
1077     tiny.put("Q", new Integer(0));\r
1078     tiny.put("D", new Integer(0));\r
1079     tiny.put("N", new Integer(0));\r
1080     tiny.put("S", new Integer(1));\r
1081     tiny.put("T", new Integer(0));\r
1082     tiny.put("P", new Integer(0));\r
1083     tiny.put("-", new Integer(1));\r
1084     tiny.put("*", new Integer(1));\r
1085   }\r
1086 \r
1087   static\r
1088   {\r
1089     proline.put("I", new Integer(0));\r
1090     proline.put("L", new Integer(0));\r
1091     proline.put("V", new Integer(0));\r
1092     proline.put("C", new Integer(0));\r
1093     proline.put("A", new Integer(0));\r
1094     proline.put("G", new Integer(0));\r
1095     proline.put("M", new Integer(0));\r
1096     proline.put("F", new Integer(0));\r
1097     proline.put("Y", new Integer(0));\r
1098     proline.put("W", new Integer(0));\r
1099     proline.put("H", new Integer(0));\r
1100     proline.put("K", new Integer(0));\r
1101     proline.put("R", new Integer(0));\r
1102     proline.put("E", new Integer(0));\r
1103     proline.put("Q", new Integer(0));\r
1104     proline.put("D", new Integer(0));\r
1105     proline.put("N", new Integer(0));\r
1106     proline.put("S", new Integer(0));\r
1107     proline.put("T", new Integer(0));\r
1108     proline.put("P", new Integer(1));\r
1109     proline.put("-", new Integer(1));\r
1110     proline.put("*", new Integer(1));\r
1111   }\r
1112 \r
1113   static\r
1114   {\r
1115     propHash.put("hydrophobic", hydrophobic);\r
1116     propHash.put("small", small);\r
1117     propHash.put("positive", positive);\r
1118     propHash.put("negative", negative);\r
1119     propHash.put("charged", charged);\r
1120     propHash.put("aromatic", aromatic);\r
1121     propHash.put("aliphatic", aliphatic);\r
1122     propHash.put("tiny", tiny);\r
1123     propHash.put("proline", proline);\r
1124     propHash.put("polar", polar);\r
1125   }\r
1126 \r
1127   private ResidueProperties()\r
1128   {\r
1129   }\r
1130 \r
1131   public static double getHydmax()\r
1132   {\r
1133     return hydmax;\r
1134   }\r
1135 \r
1136   public static double getHydmin()\r
1137   {\r
1138     return hydmin;\r
1139   }\r
1140 \r
1141   public static double[] getHyd()\r
1142   {\r
1143     return hyd;\r
1144   }\r
1145 \r
1146   public static Hashtable getAA3Hash()\r
1147   {\r
1148     return aa3Hash;\r
1149   }\r
1150 \r
1151   public static int[][] getDNA()\r
1152   {\r
1153     return ResidueProperties.DNA;\r
1154   }\r
1155 \r
1156   public static int[][] getBLOSUM62()\r
1157   {\r
1158     return ResidueProperties.BLOSUM62;\r
1159   }\r
1160 \r
1161   public static int getPAM250(String A1, String A2)\r
1162   {\r
1163     int a = aaIndex[A1.charAt(0)];\r
1164     int b = aaIndex[A2.charAt(0)];\r
1165 \r
1166     int pog = ResidueProperties.PAM250[a][b];\r
1167 \r
1168     return pog;\r
1169   }\r
1170 \r
1171   public static int getBLOSUM62(String A1, String A2)\r
1172   {\r
1173     int pog = 0;\r
1174 \r
1175     try\r
1176     {\r
1177       int a = aaIndex[A1.charAt(0)];\r
1178       int b = aaIndex[A2.charAt(0)];\r
1179 \r
1180       pog = ResidueProperties.BLOSUM62[a][b];\r
1181     }\r
1182     catch (Exception e)\r
1183     {\r
1184       //System.out.println("Unknown residue in " + A1 + " " + A2);\r
1185     }\r
1186 \r
1187     return pog;\r
1188   }\r
1189 \r
1190   public static Vector getCodons(String res)\r
1191   {\r
1192     if (codonHash.containsKey(res))\r
1193     {\r
1194       return (Vector) codonHash.get(res);\r
1195     }\r
1196 \r
1197     return null;\r
1198   }\r
1199 \r
1200   public static String codonTranslate(String codon)\r
1201   {\r
1202     Enumeration e = codonHash.keys();\r
1203 \r
1204     while (e.hasMoreElements())\r
1205     {\r
1206       String key = (String) e.nextElement();\r
1207       Vector tmp = (Vector) codonHash.get(key);\r
1208 \r
1209       if (tmp.contains(codon.toUpperCase()))\r
1210       {\r
1211         return key;\r
1212       }\r
1213     }\r
1214 \r
1215     return null;\r
1216   }\r
1217 }\r