2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 package jalview.schemes;
25 public class ResidueProperties
27 public static Hashtable scoreMatrices=new Hashtable();
28 //Stores residue codes/names and colours and other things
29 public static final int [] aaIndex; // aaHash version 2.1.1 and below
30 public static final int [] nucleotideIndex;
31 public static final Hashtable aa3Hash = new Hashtable();
32 public static final Hashtable aa2Triplet = new Hashtable();
33 public static final Hashtable nucleotideName = new Hashtable();
38 aaIndex = new int[132];
39 for(int i=0; i<132; i++)
98 nucleotideIndex = new int[132];
99 for (int i = 0; i < 132; i++)
100 nucleotideIndex[i] = -1;
102 nucleotideIndex['A'] = 0;
103 nucleotideIndex['a'] = 0;
104 nucleotideIndex['C'] = 1;
105 nucleotideIndex['c'] = 1;
106 nucleotideIndex['G'] = 2;
107 nucleotideIndex['g'] = 2;
108 nucleotideIndex['T'] = 3;
109 nucleotideIndex['t'] = 3;
110 nucleotideIndex['U'] = 4;
111 nucleotideIndex['u'] = 4;
112 nucleotideIndex['I'] = 5;
113 nucleotideIndex['i'] = 5;
114 nucleotideIndex['X'] = 6;
115 nucleotideIndex['x'] = 6;
116 nucleotideIndex['R'] = 7;
117 nucleotideIndex['r'] = 7;
118 nucleotideIndex['Y'] = 8;
119 nucleotideIndex['y'] = 8;
120 nucleotideIndex['N'] = 9;
121 nucleotideIndex['n'] = 9;
124 nucleotideName.put("A", "Adenine");
125 nucleotideName.put("a", "Adenine");
126 nucleotideName.put("G", "Guanine");
127 nucleotideName.put("g", "Guanine");
128 nucleotideName.put("C", "Cytosine");
129 nucleotideName.put("c", "Cytosine");
130 nucleotideName.put("T", "Thymine");
131 nucleotideName.put("t", "Thymine");
132 nucleotideName.put("U", "Uracil");
133 nucleotideName.put("u", "Uracil");
134 nucleotideName.put("I", "Inosine");
135 nucleotideName.put("i", "Inosine");
136 nucleotideName.put("X", "Xanthine");
137 nucleotideName.put("x", "Xanthine");
138 nucleotideName.put("R", "Unknown Purine");
139 nucleotideName.put("r", "Unknown Purine");
140 nucleotideName.put("Y", "Unknown Pyrimidine");
141 nucleotideName.put("y", "Unknown Pyrimidine");
142 nucleotideName.put("N", "Unknown");
143 nucleotideName.put("n", "Unknown");
149 aa3Hash.put("ALA", new Integer(0));
150 aa3Hash.put("ARG", new Integer(1));
151 aa3Hash.put("ASN", new Integer(2));
152 aa3Hash.put("ASP", new Integer(3)); //D
153 aa3Hash.put("CYS", new Integer(4));
154 aa3Hash.put("GLN", new Integer(5)); //Q
155 aa3Hash.put("GLU", new Integer(6)); // E
156 aa3Hash.put("GLY", new Integer(7));
157 aa3Hash.put("HIS", new Integer(8));
158 aa3Hash.put("ILE", new Integer(9));
159 aa3Hash.put("LEU", new Integer(10));
160 aa3Hash.put("LYS", new Integer(11));
161 aa3Hash.put("MET", new Integer(12));
162 aa3Hash.put("PHE", new Integer(13));
163 aa3Hash.put("PRO", new Integer(14));
164 aa3Hash.put("SER", new Integer(15));
165 aa3Hash.put("THR", new Integer(16));
166 aa3Hash.put("TRP", new Integer(17));
167 aa3Hash.put("TYR", new Integer(18));
168 aa3Hash.put("VAL", new Integer(19));
169 // IUB Nomenclature for ambiguous peptides
170 aa3Hash.put("ASX", new Integer(20)); // "B";
171 aa3Hash.put("GLX", new Integer(21)); // X
172 aa3Hash.put("XAA", new Integer(22));// X unknown
173 aa3Hash.put("-", new Integer(23));
174 aa3Hash.put("*", new Integer(23));
175 aa3Hash.put(".", new Integer(23));
176 aa3Hash.put(" ", new Integer(23));
177 aa3Hash.put("Gap", new Integer(23));
182 aa2Triplet.put("A", "ALA");
183 aa2Triplet.put("a", "ALA");
184 aa2Triplet.put("R", "ARG");
185 aa2Triplet.put("r", "ARG");
186 aa2Triplet.put("N", "ASN");
187 aa2Triplet.put("n", "ASN");
188 aa2Triplet.put("D", "ASP");
189 aa2Triplet.put("d", "ASP");
190 aa2Triplet.put("C", "CYS");
191 aa2Triplet.put("c", "CYS");
192 aa2Triplet.put("Q", "GLN");
193 aa2Triplet.put("q", "GLN");
194 aa2Triplet.put("E", "GLU");
195 aa2Triplet.put("e", "GLU");
196 aa2Triplet.put("G", "GLY");
197 aa2Triplet.put("g", "GLY");
198 aa2Triplet.put("H", "HIS");
199 aa2Triplet.put("h", "HIS");
200 aa2Triplet.put("I", "ILE");
201 aa2Triplet.put("i", "ILE");
202 aa2Triplet.put("L", "LEU");
203 aa2Triplet.put("l", "LEU");
204 aa2Triplet.put("K", "LYS");
205 aa2Triplet.put("k", "LYS");
206 aa2Triplet.put("M", "MET");
207 aa2Triplet.put("m", "MET");
208 aa2Triplet.put("F", "PHE");
209 aa2Triplet.put("f", "PHE");
210 aa2Triplet.put("P", "PRO");
211 aa2Triplet.put("p", "PRO");
212 aa2Triplet.put("S", "SER");
213 aa2Triplet.put("s", "SER");
214 aa2Triplet.put("T", "THR");
215 aa2Triplet.put("t", "THR");
216 aa2Triplet.put("W", "TRP");
217 aa2Triplet.put("w", "TRP");
218 aa2Triplet.put("Y", "TYR");
219 aa2Triplet.put("y", "TYR");
220 aa2Triplet.put("V", "VAL");
221 aa2Triplet.put("v", "VAL");
224 public static final String[] aa =
226 "A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F",
227 "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "_", "*", ".", " "
229 public static final Color midBlue = new Color(100, 100, 255);
230 public static final Vector scaleColours = new Vector();
234 scaleColours.addElement(new Color(114, 0, 147));
235 scaleColours.addElement(new Color(156, 0, 98));
236 scaleColours.addElement(new Color(190, 0, 0));
237 scaleColours.addElement(Color.red);
238 scaleColours.addElement(new Color(255, 125, 0));
239 scaleColours.addElement(Color.orange);
240 scaleColours.addElement(new Color(255, 194, 85));
241 scaleColours.addElement(Color.yellow);
242 scaleColours.addElement(new Color(255, 255, 181));
243 scaleColours.addElement(Color.white);
246 public static final Color[] taylor =
248 new Color(204, 255, 0), // A Greenish-yellowy-yellow
249 new Color(0, 0, 255), // R Blueish-bluey-blue
250 new Color(204, 0, 255), // N Blueish-reddy-blue
251 new Color(255, 0, 0), // D Reddish-reddy-red
252 new Color(255, 255, 0), // C Yellowish-yellowy-yellow
253 new Color(255, 0, 204), // Q Reddish-bluey-red
254 new Color(255, 0, 102), // E Blueish-reddy-red
255 new Color(255, 153, 0), // G Yellowy-reddy-yellow
256 new Color(0, 102, 255), // H Greenish-bluey-blue
257 new Color(102, 255, 0), // I Greenish-yellowy-green
258 new Color(51, 255, 0), // L Yellowish-greeny-green
259 new Color(102, 0, 255), // K Reddish-bluey-blue
260 new Color(0, 255, 0), // M Greenish-greeny-green
261 new Color(0, 255, 102), // F Blueish-greeny-green
262 new Color(255, 204, 0), // P Reddish-yellowy-yellow
263 new Color(255, 51, 0), // S Yellowish-reddy-red
264 new Color(255, 102, 0), // T Reddish-yellowy-red
265 new Color(0, 204, 255), // W Blueish-greeny-green
266 new Color(0, 255, 204), // Y Greenish-bluey-green
267 new Color(153, 255, 0), // V Yellowish-greeny-yellow
275 public static final Color[] nucleotide =
277 new Color(100, 247, 63), // A
278 new Color(255, 179, 64), // C
279 new Color(235, 65, 60), // G
280 new Color(60, 136, 238), // T
281 new Color(60, 136, 238) // U
283 public static final Color[] color =
314 // Dunno where I got these numbers from
315 public static final double[] hyd2 =
341 public static final double[] helix =
343 1.42, 0.98, 0.67, 1.01, 0.70, 1.11, 1.51, 0.57, 1.00, 1.08, 1.21, 1.16,
344 1.45, 1.13, 0.57, 0.77, 0.83, 1.08, 0.69, 1.06, 0.84, 1.31, 1.00, 0.0
346 public static final double helixmin = 0.57;
347 public static final double helixmax = 1.51;
348 public static final double[] strand =
350 0.83, 0.93, 0.89, 0.54, 1.19, 1.10, 0.37, 0.75, 0.87, 1.60, 1.30, 0.74,
351 1.05, 1.38, 0.55, 0.75, 1.19, 1.37, 1.47, 1.70, 0.72, 0.74, 1.0, 0.0
353 public static final double strandmin = 0.37;
354 public static final double strandmax = 1.7;
355 public static final double[] turn =
357 0.66, 0.95, 1.56, 1.46, 1.19, 0.98, 0.74, 1.56, 0.95, 0.47, 0.59, 1.01,
358 0.60, 0.60, 1.52, 1.43, 0.96, 0.96, 1.14, 0.50, 1.51, 0.86, 1.00, 0, 0
360 public static final double turnmin = 0.47;
361 public static final double turnmax = 1.56;
362 public static final double[] buried =
364 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,
365 0.6, 0.8, 0.7, 1.6, 0.5, 2.9, 0.4, 0.3, 1.358, 0.00
367 public static final double buriedmin = 0.05;
368 public static final double buriedmax = 4.6;
370 // This is hydropathy index
371 // Kyte, J., and Doolittle, R.F., J. Mol. Biol.
372 // 1157, 105-132, 1982
373 public static final double[] hyd =
375 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,
376 2.8, -1.6, -0.8, -0.7, -0.9, -1.3, 4.2, -3.5, -3.5, -0.49, 0.0
378 public static final double hydmax = 4.5;
379 public static final double hydmin = -3.9;
381 //public static final double hydmax = 1.38;
382 //public static final double hydmin = -2.53;
383 private static final int[][] BLOSUM62 =
386 4, -1, -2, -2, 0, -1, -1, 0, -2, -1, -1, -1, -1, -2, -1, 1, 0, -3,
390 -1, 5, 0, -2, -3, 1, 0, -2, 0, -3, -2, 2, -1, -3, -2, -1, -1, -3, -2,
394 -2, 0, 6, 1, -3, 0, 0, 0, 1, -3, -3, 0, -2, -3, -2, 1, 0, -4, -2, -3,
398 -2, -2, 1, 6, -3, 0, 2, -1, -1, -3, -4, -1, -3, -3, -1, 0, -1, -4,
402 0, 3, -3, -3, 9, -3, -4, -3, -3, -1, -1, -3, -1, -2, -3, -1, -1, -2,
403 -2, -1, -3, -3, -2, -4
406 -1, 1, 0, 0, -3, 5, 2, -2, 0, -3, -2, 1, 0, -3, -1, 0, -1, -2, -1,
410 -1, 0, 0, 2, -4, 2, 5, -2, 0, -3, -3, 1, -2, -3, -1, 0, -1, -3, -2,
414 0, -2, 0, -1, -3, -2, -2, 6, -2, -4, -4, -2, -3, -3, -2, 0, -2, -2,
415 -3, -3, -1, -2, -1, -4
418 -2, 0, 1, -1, -3, 0, 0, -2, 8, -3, -3, -1, -2, -1, -2, -1, -2, -2, 2,
422 -1, -3, -3, -3, -1, -3, -3, -4, -3, 4, 2, -3, 1, 0, -3, -2, -1, -3,
423 -1, 3, -3, -3, -1, -4
426 -1, -2, -3, -4, -1, -2, -3, -4, -3, 2, 4, -2, 2, 0, -3, -2, -1, -2,
427 -1, 1, -4, -3, -1, -4
430 -1, 2, 0, -1, -3, 1, 1, -2, -1, -3, -2, 5, -1, -3, -1, 0, -1, -3, -2,
434 -1, -1, -2, -3, -1, 0, -2, -3, -2, 1, 2, -1, 5, 0, -2, -1, -1, -1,
435 -1, 1, -3, -1, -1, -4
438 -2, -3, -3, -3, -2, -3, -3, -3, -1, 0, 0, -3, 0, 6, -4, -2, -2, 1, 3,
442 -1, -2, -2, -1, -3, -1, -1, -2, -2, -3, -3, -1, -2, -4, 7, -1, -1,
443 -4, -3, -2, -2, -1, -2, -4
446 1, -1, 1, 0, -1, 0, 0, 0, -1, -2, -2, 0, -1, -2, -1, 4, 1, -3, -2,
450 0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, -2, -1, 1, 5, -2,
454 -3, -3, -4, -4, -2, -2, -3, -2, -2, -3, -2, -3, -1, 1, -4, -3, -2,
455 11, 2, -3, -4, -3, -2, -4
458 -2, -2, -2, -3, -2, -1, -2, -3, 2, -1, -1, -2, -1, 3, -3, -2, -2, 2,
459 7, -1, -3, -2, -1, -4
462 0, -3, -3, -3, -1, -2, -2, -3, -3, 3, 1, -2, 1, -1, -2, -2, 0, -3,
463 -1, 4, -3, -2, -1, -4
466 -2, -1, 3, 4, -3, 0, 1, -1, 0, -3, -4, 0, -3, -3, -2, 0, -1, -4, -3,
470 -1, 0, 0, 1, -3, 3, 4, -2, 0, -3, -3, 1, -1, -3, -1, 0, -1, -3, -2,
474 0, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 0, 0, -2,
475 -1, -1, -1, -1, -1, -4
478 -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
479 -4, -4, -4, -4, -4, -4, 1
482 static final int[][] PAM250 =
485 2, -2, 0, 0, -2, 0, 0, 1, -1, -1, -2, -1, -1, -3, 1, 1, 1, -6, -3, 0,
489 -2, 6, 0, -1, -4, 1, -1, -3, 2, -2, -3, 3, 0, -4, 0, 0, -1, 2, -4,
493 0, 0, 2, 2, -4, 1, 1, 0, 2, -2, -3, 1, -2, -3, 0, 1, 0, -4, -2, -2,
497 0, -1, 2, 4, -5, 2, 3, 1, 1, -2, -4, 0, -3, -6, -1, 0, 0, -7, -4, -2,
501 -2, -4, -4, -5, 12, -5, -5, -3, -3, -2, -6, -5, -5, -4, -3, 0, -2,
502 -8, 0, -2, -4, -5, -3, -8
505 0, 1, 1, 2, -5, 4, 2, -1, 3, -2, -2, 1, -1, -5, 0, -1, -1, -5, -4,
509 0, -1, 1, 3, -5, 2, 4, 0, 1, -2, -3, 0, -2, -5, -1, 0, 0, -7, -4, -2,
513 1, -3, 0, 1, -3, -1, 0, 5, -2, -3, -4, -2, -3, -5, 0, 1, 0, -7, -5,
517 -1, 2, 2, 1, -3, 3, 1, -2, 6, -2, -2, 0, -2, -2, 0, -1, -1, -3, 0,
521 -1, -2, -2, -2, -2, -2, -2, -3, -2, 5, 2, -2, 2, 1, -2, -1, 0, -5,
522 -1, 4, -2, -2, -1, -8
525 -2, -3, -3, -4, -6, -2, -3, -4, -2, 2, 6, -3, 4, 2, -3, -3, -2, -2,
526 -1, 2, -3, -3, -1, -8
529 -1, 3, 1, 0, -5, 1, 0, -2, 0, -2, -3, 5, 0, -5, -1, 0, 0, -3, -4, -2,
533 -1, 0, -2, -3, -5, -1, -2, -3, -2, 2, 4, 0, 6, 0, -2, -2, -1, -4, -2,
537 -3, -4, -3, -6, -4, -5, -5, -5, -2, 1, 2, -5, 0, 9, -5, -3, -3, 0, 7,
541 1, 0, 0, -1, -3, 0, -1, 0, 0, -2, -3, -1, -2, -5, 6, 1, 0, -6, -5,
545 1, 0, 1, 0, 0, -1, 0, 1, -1, -1, -3, 0, -2, -3, 1, 2, 1, -2, -3, -1,
549 1, -1, 0, 0, -2, -1, 0, 0, -1, 0, -2, 0, -1, -3, 0, 1, 3, -5, -3, 0,
553 -6, 2, -4, -7, -8, -5, -7, -7, -3, -5, -2, -3, -4, 0, -6, -2, -5, 17,
554 0, -6, -5, -6, -4, -8
557 -3, -4, -2, -4, 0, -4, -4, -5, 0, -1, -1, -4, -2, 7, -5, -3, -3, 0,
558 10, -2, -3, -4, -2, -8
561 0, -2, -2, -2, -2, -2, -2, -1, -2, 4, 2, -2, 2, -1, -1, -1, 0, -6,
562 -2, 4, -2, -2, -1, -8
565 0, -1, 2, 3, -4, 1, 3, 0, 1, -2, -3, 1, -2, -4, -1, 0, 0, -5, -3, -2,
569 0, 0, 1, 3, -5, 3, 3, 0, 2, -2, -3, 0, -2, -5, 0, 0, -1, -6, -4, -2,
573 0, -1, 0, -1, -3, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, 0, 0, -4,
574 -2, -1, -1, -1, -1, -8
577 -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
578 -8, -8, -8, -8, -8, -8, 1
581 public static final Hashtable ssHash = new Hashtable(); // stores the number value of the aa
585 ssHash.put("H", Color.magenta);
586 ssHash.put("E", Color.yellow);
587 ssHash.put("-", Color.white);
588 ssHash.put(".", Color.white);
589 ssHash.put("S", Color.cyan);
590 ssHash.put("T", Color.blue);
591 ssHash.put("G", Color.pink);
592 ssHash.put("I", Color.pink);
593 ssHash.put("B", Color.yellow);
596 static final int[][] DNA =
599 5, -4, -4, -4, 1}, // C
601 -4, 5, -4, -4, 1}, // T
603 -4, -4, 5, -4, 1}, // A
605 -4, -4, -4, 5, 1}, // G
610 * register matrices in list
613 scoreMatrices.put("BLOSUM62", new ScoreMatrix("BLOSUM62",BLOSUM62, 0));
614 scoreMatrices.put("PAM250", new ScoreMatrix("PAM250",PAM250, 0));
615 scoreMatrices.put("DNA", new ScoreMatrix("DNA", DNA, 1));
617 public static final Color[] pidColours =
619 midBlue, new Color(153, 153, 255),
621 new Color(204, 204, 255),
623 public static final float[] pidThresholds =
626 public static Hashtable codonHash = new Hashtable();
627 public static Vector Lys = new Vector();
628 public static Vector Asn = new Vector();
629 public static Vector Gln = new Vector();
630 public static Vector His = new Vector();
631 public static Vector Glu = new Vector();
632 public static Vector Asp = new Vector();
633 public static Vector Tyr = new Vector();
634 public static Vector Thr = new Vector();
635 public static Vector Pro = new Vector();
636 public static Vector Ala = new Vector();
637 public static Vector Ser = new Vector();
638 public static Vector Arg = new Vector();
639 public static Vector Gly = new Vector();
640 public static Vector Trp = new Vector();
641 public static Vector Cys = new Vector();
642 public static Vector Ile = new Vector();
643 public static Vector Met = new Vector();
644 public static Vector Leu = new Vector();
645 public static Vector Val = new Vector();
646 public static Vector Phe = new Vector();
647 public static Vector STOP = new Vector();
651 codonHash.put("K", Lys);
652 codonHash.put("N", Asn);
653 codonHash.put("Q", Gln);
654 codonHash.put("H", His);
655 codonHash.put("E", Glu);
656 codonHash.put("D", Asp);
657 codonHash.put("Y", Tyr);
658 codonHash.put("T", Thr);
659 codonHash.put("P", Pro);
660 codonHash.put("A", Ala);
661 codonHash.put("S", Ser);
662 codonHash.put("R", Arg);
663 codonHash.put("G", Gly);
664 codonHash.put("W", Trp);
665 codonHash.put("C", Cys);
666 codonHash.put("I", Ile);
667 codonHash.put("M", Met);
668 codonHash.put("L", Leu);
669 codonHash.put("V", Val);
670 codonHash.put("F", Phe);
671 codonHash.put("STOP", STOP);
674 public static Hashtable codonHash2 = new Hashtable();
678 codonHash2.put("AAA", "K");
679 codonHash2.put("AAG", "K");
680 codonHash2.put("AAC", "N");
681 codonHash2.put("AAT", "N");
683 codonHash2.put("CAA", "E");
684 codonHash2.put("CAG", "E");
685 codonHash2.put("CAC", "H");
686 codonHash2.put("CAT", "H");
688 codonHash2.put("GAA", "Q");
689 codonHash2.put("GAG", "Q");
690 codonHash2.put("GAC", "D");
691 codonHash2.put("GAT", "D");
693 codonHash2.put("TAC", "Y");
694 codonHash2.put("TAT", "Y");
696 codonHash2.put("ACA", "T");
697 codonHash2.put("AAG", "T");
698 codonHash2.put("ACC", "T");
699 codonHash2.put("ACT", "T");
701 codonHash2.put("CCA", "P");
702 codonHash2.put("CCG", "P");
703 codonHash2.put("CCC", "P");
704 codonHash2.put("CCT", "P");
706 codonHash2.put("GCA", "A");
707 codonHash2.put("GCG", "A");
708 codonHash2.put("GCC", "A");
709 codonHash2.put("GCT", "A");
711 codonHash2.put("TCA", "S");
712 codonHash2.put("TCG", "S");
713 codonHash2.put("TCC", "S");
714 codonHash2.put("TCT", "S");
715 codonHash2.put("AGC", "S");
716 codonHash2.put("AGT", "S");
718 codonHash2.put("AGA", "R");
719 codonHash2.put("AGG", "R");
720 codonHash2.put("CGA", "R");
721 codonHash2.put("CGG", "R");
722 codonHash2.put("CGC", "R");
723 codonHash2.put("CGT", "R");
725 codonHash2.put("GGA", "G");
726 codonHash2.put("GGG", "G");
727 codonHash2.put("GGC", "G");
728 codonHash2.put("GGT", "G");
730 codonHash2.put("TGA", "*");
731 codonHash2.put("TAA", "*");
732 codonHash2.put("TAG", "*");
734 codonHash2.put("TGG", "W");
736 codonHash2.put("TGC", "C");
737 codonHash2.put("TGT", "C");
739 codonHash2.put("ATA", "I");
740 codonHash2.put("ATC", "I");
741 codonHash2.put("ATT", "I");
743 codonHash2.put("ATG", "M");
745 codonHash2.put("CTA", "L");
746 codonHash2.put("CTG", "L");
747 codonHash2.put("CTC", "L");
748 codonHash2.put("CTT", "L");
749 codonHash2.put("TTA", "L");
750 codonHash2.put("TTG", "L");
752 codonHash2.put("GTA", "V");
753 codonHash2.put("GTG", "V");
754 codonHash2.put("GTC", "V");
755 codonHash2.put("GTT", "V");
757 codonHash2.put("TTC", "F");
758 codonHash2.put("TTT", "F");
763 Lys.addElement("AAA");
764 Lys.addElement("AAG");
765 Asn.addElement("AAC");
766 Asn.addElement("AAT");
768 Gln.addElement("CAA");
769 Gln.addElement("CAG");
770 His.addElement("CAC");
771 His.addElement("CAT");
773 Glu.addElement("GAA");
774 Glu.addElement("GAG");
775 Asp.addElement("GAC");
776 Asp.addElement("GAT");
778 Tyr.addElement("TAC");
779 Tyr.addElement("TAT");
781 Thr.addElement("ACA");
782 Thr.addElement("ACG");
783 Thr.addElement("ACC");
784 Thr.addElement("ACT");
786 Pro.addElement("CCA");
787 Pro.addElement("CCG");
788 Pro.addElement("CCC");
789 Pro.addElement("CCT");
791 Ala.addElement("GCA");
792 Ala.addElement("GCG");
793 Ala.addElement("GCC");
794 Ala.addElement("GCT");
796 Ser.addElement("TCA");
797 Ser.addElement("TCG");
798 Ser.addElement("TCC");
799 Ser.addElement("TCT");
800 Ser.addElement("AGC");
801 Ser.addElement("AGT");
803 Arg.addElement("AGA");
804 Arg.addElement("AGG");
805 Arg.addElement("CGA");
806 Arg.addElement("CGG");
807 Arg.addElement("CGC");
808 Arg.addElement("CGT");
810 Gly.addElement("GGA");
811 Gly.addElement("GGG");
812 Gly.addElement("GGC");
813 Gly.addElement("GGT");
815 STOP.addElement("TGA");
816 STOP.addElement("TAA");
817 STOP.addElement("TAG");
819 Trp.addElement("TGG");
821 Cys.addElement("TGC");
822 Cys.addElement("TGT");
824 Ile.addElement("ATA");
825 Ile.addElement("ATC");
826 Ile.addElement("ATT");
828 Met.addElement("ATG");
830 Leu.addElement("CTA");
831 Leu.addElement("CTG");
832 Leu.addElement("CTC");
833 Leu.addElement("CTT");
834 Leu.addElement("TTA");
835 Leu.addElement("TTG");
837 Val.addElement("GTA");
838 Val.addElement("GTG");
839 Val.addElement("GTC");
840 Val.addElement("GTT");
842 Phe.addElement("TTC");
843 Phe.addElement("TTT");
847 //Stores residue codes/names and colours and other things
848 public static Hashtable propHash = new Hashtable();
849 public static Hashtable hydrophobic = new Hashtable();
850 public static Hashtable polar = new Hashtable();
851 public static Hashtable small = new Hashtable();
852 public static Hashtable positive = new Hashtable();
853 public static Hashtable negative = new Hashtable();
854 public static Hashtable charged = new Hashtable();
855 public static Hashtable aromatic = new Hashtable();
856 public static Hashtable aliphatic = new Hashtable();
857 public static Hashtable tiny = new Hashtable();
858 public static Hashtable proline = new Hashtable();
862 hydrophobic.put("I", new Integer(1));
863 hydrophobic.put("L", new Integer(1));
864 hydrophobic.put("V", new Integer(1));
865 hydrophobic.put("C", new Integer(1));
866 hydrophobic.put("A", new Integer(1));
867 hydrophobic.put("G", new Integer(1));
868 hydrophobic.put("M", new Integer(1));
869 hydrophobic.put("F", new Integer(1));
870 hydrophobic.put("Y", new Integer(1));
871 hydrophobic.put("W", new Integer(1));
872 hydrophobic.put("H", new Integer(1));
873 hydrophobic.put("K", new Integer(1));
874 hydrophobic.put("X", new Integer(1));
875 hydrophobic.put("-", new Integer(1));
876 hydrophobic.put("*", new Integer(1));
877 hydrophobic.put("R", new Integer(0));
878 hydrophobic.put("E", new Integer(0));
879 hydrophobic.put("Q", new Integer(0));
880 hydrophobic.put("D", new Integer(0));
881 hydrophobic.put("N", new Integer(0));
882 hydrophobic.put("S", new Integer(0));
883 hydrophobic.put("T", new Integer(0));
884 hydrophobic.put("P", new Integer(0));
889 polar.put("Y", new Integer(1));
890 polar.put("W", new Integer(1));
891 polar.put("H", new Integer(1));
892 polar.put("K", new Integer(1));
893 polar.put("R", new Integer(1));
894 polar.put("E", new Integer(1));
895 polar.put("Q", new Integer(1));
896 polar.put("D", new Integer(1));
897 polar.put("N", new Integer(1));
898 polar.put("S", new Integer(1));
899 polar.put("T", new Integer(1));
900 polar.put("X", new Integer(1));
901 polar.put("-", new Integer(1));
902 polar.put("*", new Integer(1));
903 polar.put("I", new Integer(0));
904 polar.put("L", new Integer(0));
905 polar.put("V", new Integer(0));
906 polar.put("C", new Integer(0));
907 polar.put("A", new Integer(0));
908 polar.put("G", new Integer(0));
909 polar.put("M", new Integer(0));
910 polar.put("F", new Integer(0));
911 polar.put("P", new Integer(0));
916 small.put("I", new Integer(0));
917 small.put("L", new Integer(0));
918 small.put("V", new Integer(1));
919 small.put("C", new Integer(1));
920 small.put("A", new Integer(1));
921 small.put("G", new Integer(1));
922 small.put("M", new Integer(0));
923 small.put("F", new Integer(0));
924 small.put("Y", new Integer(0));
925 small.put("W", new Integer(0));
926 small.put("H", new Integer(0));
927 small.put("K", new Integer(0));
928 small.put("R", new Integer(0));
929 small.put("E", new Integer(0));
930 small.put("Q", new Integer(0));
931 small.put("D", new Integer(1));
932 small.put("N", new Integer(1));
933 small.put("S", new Integer(1));
934 small.put("T", new Integer(1));
935 small.put("P", new Integer(1));
936 small.put("-", new Integer(1));
937 small.put("*", new Integer(1));
942 positive.put("I", new Integer(0));
943 positive.put("L", new Integer(0));
944 positive.put("V", new Integer(0));
945 positive.put("C", new Integer(0));
946 positive.put("A", new Integer(0));
947 positive.put("G", new Integer(0));
948 positive.put("M", new Integer(0));
949 positive.put("F", new Integer(0));
950 positive.put("Y", new Integer(0));
951 positive.put("W", new Integer(0));
952 positive.put("H", new Integer(1));
953 positive.put("K", new Integer(1));
954 positive.put("R", new Integer(1));
955 positive.put("E", new Integer(0));
956 positive.put("Q", new Integer(0));
957 positive.put("D", new Integer(0));
958 positive.put("N", new Integer(0));
959 positive.put("S", new Integer(0));
960 positive.put("T", new Integer(0));
961 positive.put("P", new Integer(0));
962 positive.put("-", new Integer(1));
963 positive.put("*", new Integer(1));
968 negative.put("I", new Integer(0));
969 negative.put("L", new Integer(0));
970 negative.put("V", new Integer(0));
971 negative.put("C", new Integer(0));
972 negative.put("A", new Integer(0));
973 negative.put("G", new Integer(0));
974 negative.put("M", new Integer(0));
975 negative.put("F", new Integer(0));
976 negative.put("Y", new Integer(0));
977 negative.put("W", new Integer(0));
978 negative.put("H", new Integer(0));
979 negative.put("K", new Integer(0));
980 negative.put("R", new Integer(0));
981 negative.put("E", new Integer(1));
982 negative.put("Q", new Integer(0));
983 negative.put("D", new Integer(1));
984 negative.put("N", new Integer(0));
985 negative.put("S", new Integer(0));
986 negative.put("T", new Integer(0));
987 negative.put("P", new Integer(0));
988 negative.put("-", new Integer(1));
989 negative.put("*", new Integer(1));
994 charged.put("I", new Integer(0));
995 charged.put("L", new Integer(0));
996 charged.put("V", new Integer(0));
997 charged.put("C", new Integer(0));
998 charged.put("A", new Integer(0));
999 charged.put("G", new Integer(0));
1000 charged.put("M", new Integer(0));
1001 charged.put("F", new Integer(0));
1002 charged.put("Y", new Integer(0));
1003 charged.put("W", new Integer(0));
1004 charged.put("H", new Integer(1));
1005 charged.put("K", new Integer(1));
1006 charged.put("R", new Integer(1));
1007 charged.put("E", new Integer(1));
1008 charged.put("Q", new Integer(0));
1009 charged.put("D", new Integer(1));
1010 charged.put("N", new Integer(1));
1011 charged.put("S", new Integer(0));
1012 charged.put("T", new Integer(0));
1013 charged.put("P", new Integer(0));
1014 charged.put("-", new Integer(1));
1015 charged.put("*", new Integer(1));
1020 aromatic.put("I", new Integer(0));
1021 aromatic.put("L", new Integer(0));
1022 aromatic.put("V", new Integer(0));
1023 aromatic.put("C", new Integer(0));
1024 aromatic.put("A", new Integer(0));
1025 aromatic.put("G", new Integer(0));
1026 aromatic.put("M", new Integer(0));
1027 aromatic.put("F", new Integer(1));
1028 aromatic.put("Y", new Integer(1));
1029 aromatic.put("W", new Integer(1));
1030 aromatic.put("H", new Integer(1));
1031 aromatic.put("K", new Integer(0));
1032 aromatic.put("R", new Integer(0));
1033 aromatic.put("E", new Integer(0));
1034 aromatic.put("Q", new Integer(0));
1035 aromatic.put("D", new Integer(0));
1036 aromatic.put("N", new Integer(0));
1037 aromatic.put("S", new Integer(0));
1038 aromatic.put("T", new Integer(0));
1039 aromatic.put("P", new Integer(0));
1040 aromatic.put("-", new Integer(1));
1041 aromatic.put("*", new Integer(1));
1046 aliphatic.put("I", new Integer(1));
1047 aliphatic.put("L", new Integer(1));
1048 aliphatic.put("V", new Integer(1));
1049 aliphatic.put("C", new Integer(0));
1050 aliphatic.put("A", new Integer(0));
1051 aliphatic.put("G", new Integer(0));
1052 aliphatic.put("M", new Integer(0));
1053 aliphatic.put("F", new Integer(0));
1054 aliphatic.put("Y", new Integer(0));
1055 aliphatic.put("W", new Integer(0));
1056 aliphatic.put("H", new Integer(0));
1057 aliphatic.put("K", new Integer(0));
1058 aliphatic.put("R", new Integer(0));
1059 aliphatic.put("E", new Integer(0));
1060 aliphatic.put("Q", new Integer(0));
1061 aliphatic.put("D", new Integer(0));
1062 aliphatic.put("N", new Integer(0));
1063 aliphatic.put("S", new Integer(0));
1064 aliphatic.put("T", new Integer(0));
1065 aliphatic.put("P", new Integer(0));
1066 aliphatic.put("-", new Integer(1));
1067 aliphatic.put("*", new Integer(1));
1072 tiny.put("I", new Integer(0));
1073 tiny.put("L", new Integer(0));
1074 tiny.put("V", new Integer(0));
1075 tiny.put("C", new Integer(0));
1076 tiny.put("A", new Integer(1));
1077 tiny.put("G", new Integer(1));
1078 tiny.put("M", new Integer(0));
1079 tiny.put("F", new Integer(0));
1080 tiny.put("Y", new Integer(0));
1081 tiny.put("W", new Integer(0));
1082 tiny.put("H", new Integer(0));
1083 tiny.put("K", new Integer(0));
1084 tiny.put("R", new Integer(0));
1085 tiny.put("E", new Integer(0));
1086 tiny.put("Q", new Integer(0));
1087 tiny.put("D", new Integer(0));
1088 tiny.put("N", new Integer(0));
1089 tiny.put("S", new Integer(1));
1090 tiny.put("T", new Integer(0));
1091 tiny.put("P", new Integer(0));
1092 tiny.put("-", new Integer(1));
1093 tiny.put("*", new Integer(1));
1098 proline.put("I", new Integer(0));
1099 proline.put("L", new Integer(0));
1100 proline.put("V", new Integer(0));
1101 proline.put("C", new Integer(0));
1102 proline.put("A", new Integer(0));
1103 proline.put("G", new Integer(0));
1104 proline.put("M", new Integer(0));
1105 proline.put("F", new Integer(0));
1106 proline.put("Y", new Integer(0));
1107 proline.put("W", new Integer(0));
1108 proline.put("H", new Integer(0));
1109 proline.put("K", new Integer(0));
1110 proline.put("R", new Integer(0));
1111 proline.put("E", new Integer(0));
1112 proline.put("Q", new Integer(0));
1113 proline.put("D", new Integer(0));
1114 proline.put("N", new Integer(0));
1115 proline.put("S", new Integer(0));
1116 proline.put("T", new Integer(0));
1117 proline.put("P", new Integer(1));
1118 proline.put("-", new Integer(1));
1119 proline.put("*", new Integer(1));
1124 propHash.put("hydrophobic", hydrophobic);
1125 propHash.put("small", small);
1126 propHash.put("positive", positive);
1127 propHash.put("negative", negative);
1128 propHash.put("charged", charged);
1129 propHash.put("aromatic", aromatic);
1130 propHash.put("aliphatic", aliphatic);
1131 propHash.put("tiny", tiny);
1132 propHash.put("proline", proline);
1133 propHash.put("polar", polar);
1136 private ResidueProperties()
1140 public static double getHydmax()
1145 public static double getHydmin()
1150 public static double[] getHyd()
1155 public static Hashtable getAA3Hash()
1160 public static int[][] getDNA()
1162 return ResidueProperties.DNA;
1165 public static int[][] getBLOSUM62()
1167 return ResidueProperties.BLOSUM62;
1170 public static int getPAM250(String A1, String A2)
1172 int a = aaIndex[A1.charAt(0)];
1173 int b = aaIndex[A2.charAt(0)];
1175 int pog = ResidueProperties.PAM250[a][b];
1180 public static int getBLOSUM62(char c1, char c2)
1186 int a = aaIndex[c1];
1187 int b = aaIndex[c2];
1189 pog = ResidueProperties.BLOSUM62[a][b];
1193 //System.out.println("Unknown residue in " + A1 + " " + A2);
1199 public static Vector getCodons(String res)
1201 if (codonHash.containsKey(res))
1203 return (Vector) codonHash.get(res);
1209 public static String codonTranslate(String codon)
1211 Enumeration e = codonHash.keys();
1213 while (e.hasMoreElements())
1215 String key = (String) e.nextElement();
1216 Vector tmp = (Vector) codonHash.get(key);
1218 if (tmp.contains(codon.toUpperCase()))
1227 public static int[][] getDefaultPeptideMatrix() {
1228 return ResidueProperties.getBLOSUM62();
1230 public static int[][] getDefaultDnaMatrix() {
1231 return ResidueProperties.getDNA();
1235 * get a ScoreMatrix based on its string name
1237 * @return matrix in scoreMatrices with key pwtype or null
1239 public static ScoreMatrix getScoreMatrix(String pwtype) {
1240 Object val=scoreMatrices.get(pwtype);
1242 return (ScoreMatrix) val;