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