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