2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.schemes;
23 import java.awt.Color;
24 import java.util.ArrayList;
25 import java.util.Arrays;
26 import java.util.Enumeration;
27 import java.util.HashMap;
28 import java.util.Hashtable;
29 import java.util.List;
31 import java.util.Vector;
33 public class ResidueProperties
35 // Stores residue codes/names and colours and other things
36 public static final int[] aaIndex; // aaHash version 2.1.1 and below
38 public static final int[] nucleotideIndex;
40 public static final int[] purinepyrimidineIndex;
42 public static final Map<String, Integer> aa3Hash = new HashMap<String, Integer>();
44 public static final Map<String, String> aa2Triplet = new HashMap<String, String>();
46 public static final Map<String, String> nucleotideName = new HashMap<String, String>();
48 // lookup from modified amino acid (e.g. MSE) to canonical form (e.g. MET)
49 public static final Map<String, String> modifications = new HashMap<String, String>();
53 aaIndex = new int[255];
54 for (int i = 0; i < 255; i++)
106 aaIndex['u'] = 22; // TODO: selenocystine triplet and codons needed. also
107 // extend subt. matrices
111 * maximum (gap) index for matrices involving protein alphabet
113 public final static int maxProteinIndex = 23;
116 * maximum (gap) index for matrices involving nucleotide alphabet
118 public final static int maxNucleotideIndex = 10;
122 nucleotideIndex = new int[255];
123 for (int i = 0; i < 255; i++)
125 nucleotideIndex[i] = 10; // non-nucleotide symbols are all non-gap gaps.
128 nucleotideIndex['A'] = 0;
129 nucleotideIndex['a'] = 0;
130 nucleotideIndex['C'] = 1;
131 nucleotideIndex['c'] = 1;
132 nucleotideIndex['G'] = 2;
133 nucleotideIndex['g'] = 2;
134 nucleotideIndex['T'] = 3;
135 nucleotideIndex['t'] = 3;
136 nucleotideIndex['U'] = 4;
137 nucleotideIndex['u'] = 4;
138 nucleotideIndex['I'] = 5;
139 nucleotideIndex['i'] = 5;
140 nucleotideIndex['X'] = 6;
141 nucleotideIndex['x'] = 6;
142 nucleotideIndex['R'] = 7;
143 nucleotideIndex['r'] = 7;
144 nucleotideIndex['Y'] = 8;
145 nucleotideIndex['y'] = 8;
146 nucleotideIndex['N'] = 9;
147 nucleotideIndex['n'] = 9;
149 nucleotideName.put("A", "Adenine");
150 nucleotideName.put("a", "Adenine");
151 nucleotideName.put("G", "Guanine");
152 nucleotideName.put("g", "Guanine");
153 nucleotideName.put("C", "Cytosine");
154 nucleotideName.put("c", "Cytosine");
155 nucleotideName.put("T", "Thymine");
156 nucleotideName.put("t", "Thymine");
157 nucleotideName.put("U", "Uracil");
158 nucleotideName.put("u", "Uracil");
159 nucleotideName.put("I", "Inosine");
160 nucleotideName.put("i", "Inosine");
161 nucleotideName.put("X", "Xanthine");
162 nucleotideName.put("x", "Xanthine");
163 nucleotideName.put("R", "Unknown Purine");
164 nucleotideName.put("r", "Unknown Purine");
165 nucleotideName.put("Y", "Unknown Pyrimidine");
166 nucleotideName.put("y", "Unknown Pyrimidine");
167 nucleotideName.put("N", "Unknown");
168 nucleotideName.put("n", "Unknown");
169 nucleotideName.put("W", "Weak nucleotide (A or T)");
170 nucleotideName.put("w", "Weak nucleotide (A or T)");
171 nucleotideName.put("S", "Strong nucleotide (G or C)");
172 nucleotideName.put("s", "Strong nucleotide (G or C)");
173 nucleotideName.put("M", "Amino (A or C)");
174 nucleotideName.put("m", "Amino (A or C)");
175 nucleotideName.put("K", "Keto (G or T)");
176 nucleotideName.put("k", "Keto (G or T)");
177 nucleotideName.put("B", "Not A (G or C or T)");
178 nucleotideName.put("b", "Not A (G or C or T)");
179 nucleotideName.put("H", "Not G (A or C or T)");
180 nucleotideName.put("h", "Not G (A or C or T)");
181 nucleotideName.put("D", "Not C (A or G or T)");
182 nucleotideName.put("d", "Not C (A or G or T)");
183 nucleotideName.put("V", "Not T (A or G or C");
184 nucleotideName.put("v", "Not T (A or G or C");
190 purinepyrimidineIndex = new int[255];
191 for (int i = 0; i < 255; i++)
193 purinepyrimidineIndex[i] = 3; // non-nucleotide symbols are all non-gap
197 purinepyrimidineIndex['A'] = 0;
198 purinepyrimidineIndex['a'] = 0;
199 purinepyrimidineIndex['C'] = 1;
200 purinepyrimidineIndex['c'] = 1;
201 purinepyrimidineIndex['G'] = 0;
202 purinepyrimidineIndex['g'] = 0;
203 purinepyrimidineIndex['T'] = 1;
204 purinepyrimidineIndex['t'] = 1;
205 purinepyrimidineIndex['U'] = 1;
206 purinepyrimidineIndex['u'] = 1;
207 purinepyrimidineIndex['I'] = 2;
208 purinepyrimidineIndex['i'] = 2;
209 purinepyrimidineIndex['X'] = 2;
210 purinepyrimidineIndex['x'] = 2;
211 purinepyrimidineIndex['R'] = 0;
212 purinepyrimidineIndex['r'] = 0;
213 purinepyrimidineIndex['Y'] = 1;
214 purinepyrimidineIndex['y'] = 1;
215 purinepyrimidineIndex['N'] = 2;
216 purinepyrimidineIndex['n'] = 2;
219 private static final Integer ONE = Integer.valueOf(1);
221 private static final Integer ZERO = Integer.valueOf(0);
225 aa3Hash.put("ALA", ZERO);
226 aa3Hash.put("ARG", ONE);
227 aa3Hash.put("ASN", Integer.valueOf(2));
228 aa3Hash.put("ASP", Integer.valueOf(3)); // D
229 aa3Hash.put("CYS", Integer.valueOf(4));
230 aa3Hash.put("GLN", Integer.valueOf(5)); // Q
231 aa3Hash.put("GLU", Integer.valueOf(6)); // E
232 aa3Hash.put("GLY", Integer.valueOf(7));
233 aa3Hash.put("HIS", Integer.valueOf(8));
234 aa3Hash.put("ILE", Integer.valueOf(9));
235 aa3Hash.put("LEU", Integer.valueOf(10));
236 aa3Hash.put("LYS", Integer.valueOf(11));
237 aa3Hash.put("MET", Integer.valueOf(12));
238 aa3Hash.put("PHE", Integer.valueOf(13));
239 aa3Hash.put("PRO", Integer.valueOf(14));
240 aa3Hash.put("SER", Integer.valueOf(15));
241 aa3Hash.put("THR", Integer.valueOf(16));
242 aa3Hash.put("TRP", Integer.valueOf(17));
243 aa3Hash.put("TYR", Integer.valueOf(18));
244 aa3Hash.put("VAL", Integer.valueOf(19));
245 // IUB Nomenclature for ambiguous peptides
246 aa3Hash.put("ASX", Integer.valueOf(20)); // "B";
247 aa3Hash.put("GLX", Integer.valueOf(21)); // Z
248 aa3Hash.put("XAA", Integer.valueOf(22)); // X unknown
249 aa3Hash.put("-", Integer.valueOf(23));
250 aa3Hash.put("*", Integer.valueOf(23));
251 aa3Hash.put(".", Integer.valueOf(23));
252 aa3Hash.put(" ", Integer.valueOf(23));
253 aa3Hash.put("Gap", Integer.valueOf(23));
254 aa3Hash.put("UR3", Integer.valueOf(24));
259 aa2Triplet.put("A", "ALA");
260 aa2Triplet.put("a", "ALA");
261 aa2Triplet.put("R", "ARG");
262 aa2Triplet.put("r", "ARG");
263 aa2Triplet.put("N", "ASN");
264 aa2Triplet.put("n", "ASN");
265 aa2Triplet.put("D", "ASP");
266 aa2Triplet.put("d", "ASP");
267 aa2Triplet.put("C", "CYS");
268 aa2Triplet.put("c", "CYS");
269 aa2Triplet.put("Q", "GLN");
270 aa2Triplet.put("q", "GLN");
271 aa2Triplet.put("E", "GLU");
272 aa2Triplet.put("e", "GLU");
273 aa2Triplet.put("G", "GLY");
274 aa2Triplet.put("g", "GLY");
275 aa2Triplet.put("H", "HIS");
276 aa2Triplet.put("h", "HIS");
277 aa2Triplet.put("I", "ILE");
278 aa2Triplet.put("i", "ILE");
279 aa2Triplet.put("L", "LEU");
280 aa2Triplet.put("l", "LEU");
281 aa2Triplet.put("K", "LYS");
282 aa2Triplet.put("k", "LYS");
283 aa2Triplet.put("M", "MET");
284 aa2Triplet.put("m", "MET");
285 aa2Triplet.put("F", "PHE");
286 aa2Triplet.put("f", "PHE");
287 aa2Triplet.put("P", "PRO");
288 aa2Triplet.put("p", "PRO");
289 aa2Triplet.put("S", "SER");
290 aa2Triplet.put("s", "SER");
291 aa2Triplet.put("T", "THR");
292 aa2Triplet.put("t", "THR");
293 aa2Triplet.put("W", "TRP");
294 aa2Triplet.put("w", "TRP");
295 aa2Triplet.put("Y", "TYR");
296 aa2Triplet.put("y", "TYR");
297 aa2Triplet.put("V", "VAL");
298 aa2Triplet.put("v", "VAL");
301 public static final String[] aa = { "A", "R", "N", "D", "C", "Q", "E",
302 "G", "H", "I", "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V", "B",
303 "Z", "X", "_", "*", ".", " ", "U" };
305 public static final Color midBlue = new Color(100, 100, 255);
307 // not currently in use
308 // public static final Vector<Color> scaleColours = new Vector<Color>();
311 // scaleColours.addElement(new Color(114, 0, 147));
312 // scaleColours.addElement(new Color(156, 0, 98));
313 // scaleColours.addElement(new Color(190, 0, 0));
314 // scaleColours.addElement(Color.red);
315 // scaleColours.addElement(new Color(255, 125, 0));
316 // scaleColours.addElement(Color.orange);
317 // scaleColours.addElement(new Color(255, 194, 85));
318 // scaleColours.addElement(Color.yellow);
319 // scaleColours.addElement(new Color(255, 255, 181));
320 // scaleColours.addElement(Color.white);
323 public static final Color[] taylor = { new Color(204, 255, 0),
324 // A Greenish-yellowy-yellow
325 new Color(0, 0, 255), // R Blueish-bluey-blue
326 new Color(204, 0, 255), // N Blueish-reddy-blue
327 new Color(255, 0, 0), // D Reddish-reddy-red
328 new Color(255, 255, 0), // C Yellowish-yellowy-yellow
329 new Color(255, 0, 204), // Q Reddish-bluey-red
330 new Color(255, 0, 102), // E Blueish-reddy-red
331 new Color(255, 153, 0), // G Yellowy-reddy-yellow
332 new Color(0, 102, 255), // H Greenish-bluey-blue
333 new Color(102, 255, 0), // I Greenish-yellowy-green
334 new Color(51, 255, 0), // L Yellowish-greeny-green
335 new Color(102, 0, 255), // K Reddish-bluey-blue
336 new Color(0, 255, 0), // M Greenish-greeny-green
337 new Color(0, 255, 102), // F Blueish-greeny-green
338 new Color(255, 204, 0), // P Reddish-yellowy-yellow
339 new Color(255, 51, 0), // S Yellowish-reddy-red
340 new Color(255, 102, 0), // T Reddish-yellowy-red
341 new Color(0, 204, 255), // W Blueish-greeny-green
342 new Color(0, 255, 204), // Y Greenish-bluey-green
343 new Color(153, 255, 0), // V Yellowish-greeny-yellow
352 public static final Color[] nucleotide = { new Color(100, 247, 63), // A
353 new Color(255, 179, 64), // C
354 new Color(235, 65, 60), // G
355 new Color(60, 136, 238), // T
356 new Color(60, 136, 238), // U
357 Color.white, // I (inosine)
358 Color.white, // X (xanthine)
365 // Added for PurinePyrimidineColourScheme
366 public static final Color[] purinepyrimidine = { new Color(255, 131, 250), // A,
371 new Color(64, 224, 208), // C,U, T, Y pyrimidines turquoise
372 Color.white, // all other nucleotides
377 public static final Color[] zappo = { Color.pink, // A
385 midBlue, // Color.red, // H
406 // Dunno where I got these numbers from
407 public static final double[] hyd2 = { 0.62, // A
432 public static final double[] helix = { 1.42, 0.98, 0.67, 1.01, 0.70, 1.11,
433 1.51, 0.57, 1.00, 1.08, 1.21, 1.16, 1.45, 1.13, 0.57, 0.77, 0.83,
434 1.08, 0.69, 1.06, 0.84, 1.31, 1.00, 0.0 };
436 public static final double helixmin = 0.57;
438 public static final double helixmax = 1.51;
440 public static final double[] strand = { 0.83, 0.93, 0.89, 0.54, 1.19,
441 1.10, 0.37, 0.75, 0.87, 1.60, 1.30, 0.74, 1.05, 1.38, 0.55, 0.75,
442 1.19, 1.37, 1.47, 1.70, 0.72, 0.74, 1.0, 0.0 };
444 public static final double strandmin = 0.37;
446 public static final double strandmax = 1.7;
448 public static final double[] turn = { 0.66, 0.95, 1.56, 1.46, 1.19, 0.98,
449 0.74, 1.56, 0.95, 0.47, 0.59, 1.01, 0.60, 0.60, 1.52, 1.43, 0.96,
450 0.96, 1.14, 0.50, 1.51, 0.86, 1.00, 0, 0 };
452 public static final double turnmin = 0.47;
454 public static final double turnmax = 1.56;
456 public static final double[] buried = { 1.7, 0.1, 0.4, 0.4, 4.6, 0.3, 0.3,
457 1.8, 0.8, 3.1, 2.4, 0.05, 1.9, 2.2, 0.6, 0.8, 0.7, 1.6, 0.5, 2.9, 0.4,
460 public static final double buriedmin = 0.05;
462 public static final double buriedmax = 4.6;
464 // This is hydropathy index
465 // Kyte, J., and Doolittle, R.F., J. Mol. Biol.
466 // 1157, 105-132, 1982
467 public static final double[] hyd = { 1.8, -4.5, -3.5, -3.5, 2.5, -3.5,
468 -3.5, -0.4, -3.2, 4.5, 3.8, -3.9, 1.9, 2.8, -1.6, -0.8, -0.7, -0.9,
469 -1.3, 4.2, -3.5, -3.5, -0.49, 0.0 };
471 public static final double hydmax = 4.5;
473 public static final double hydmin = -3.9;
475 // public static final double hydmax = 1.38;
476 // public static final double hydmin = -2.53;
478 // not currently used
479 // public static final Map<String, Color> ssHash = new Hashtable<String,
483 // ssHash.put("H", Color.magenta);
484 // ssHash.put("E", Color.yellow);
485 // ssHash.put("-", Color.white);
486 // ssHash.put(".", Color.white);
487 // ssHash.put("S", Color.cyan);
488 // ssHash.put("T", Color.blue);
489 // ssHash.put("G", Color.pink);
490 // ssHash.put("I", Color.pink);
491 // ssHash.put("B", Color.yellow);
495 * new Color(60, 136, 238), // U Color.white, // I Color.white, // X
496 * Color.white, // R Color.white, // Y Color.white, // N Color.white, // Gap
499 public static List<String> STOP = Arrays.asList("TGA", "TAA", "TAG");
501 public static String START = "ATG";
504 * Nucleotide Ambiguity Codes
506 public static final Map<String, String[]> ambiguityCodes = new Hashtable<String, String[]>();
509 * Codon triplets with additional symbols for unambiguous codons that include
512 public static final Hashtable<String, String> codonHash2 = new Hashtable<String, String>();
515 * all ambiguity codes for a given base
517 public final static Hashtable<String, List<String>> _ambiguityCodes = new Hashtable<String, List<String>>();
522 * Ambiguity codes as per http://www.chem.qmul.ac.uk/iubmb/misc/naseq.html
524 ambiguityCodes.put("R", new String[] { "A", "G" });
525 ambiguityCodes.put("Y", new String[] { "T", "C" });
526 ambiguityCodes.put("W", new String[] { "A", "T" });
527 ambiguityCodes.put("S", new String[] { "G", "C" });
528 ambiguityCodes.put("M", new String[] { "A", "C" });
529 ambiguityCodes.put("K", new String[] { "G", "T" });
530 ambiguityCodes.put("H", new String[] { "A", "T", "C" });
531 ambiguityCodes.put("B", new String[] { "G", "T", "C" });
532 ambiguityCodes.put("V", new String[] { "G", "A", "C" });
533 ambiguityCodes.put("D", new String[] { "G", "A", "T" });
534 ambiguityCodes.put("N", new String[] { "G", "A", "T", "C" });
536 // Now build codon translation table
537 codonHash2.put("AAA", "K");
538 codonHash2.put("AAG", "K");
539 codonHash2.put("AAC", "N");
540 codonHash2.put("AAT", "N");
542 codonHash2.put("CAA", "Q");
543 codonHash2.put("CAG", "Q");
544 codonHash2.put("CAC", "H");
545 codonHash2.put("CAT", "H");
547 codonHash2.put("GAA", "E");
548 codonHash2.put("GAG", "E");
549 codonHash2.put("GAC", "D");
550 codonHash2.put("GAT", "D");
552 codonHash2.put("TAC", "Y");
553 codonHash2.put("TAT", "Y");
555 codonHash2.put("ACA", "T");
556 codonHash2.put("ACC", "T");
557 codonHash2.put("ACT", "T");
558 codonHash2.put("ACG", "T");
560 codonHash2.put("CCA", "P");
561 codonHash2.put("CCG", "P");
562 codonHash2.put("CCC", "P");
563 codonHash2.put("CCT", "P");
565 codonHash2.put("GCA", "A");
566 codonHash2.put("GCG", "A");
567 codonHash2.put("GCC", "A");
568 codonHash2.put("GCT", "A");
570 codonHash2.put("TCA", "S");
571 codonHash2.put("TCG", "S");
572 codonHash2.put("TCC", "S");
573 codonHash2.put("TCT", "S");
574 codonHash2.put("AGC", "S");
575 codonHash2.put("AGT", "S");
577 codonHash2.put("AGA", "R");
578 codonHash2.put("AGG", "R");
579 codonHash2.put("CGA", "R");
580 codonHash2.put("CGG", "R");
581 codonHash2.put("CGC", "R");
582 codonHash2.put("CGT", "R");
584 codonHash2.put("GGA", "G");
585 codonHash2.put("GGG", "G");
586 codonHash2.put("GGC", "G");
587 codonHash2.put("GGT", "G");
589 codonHash2.put("TGA", "*");
590 codonHash2.put("TAA", "*");
591 codonHash2.put("TAG", "*");
593 codonHash2.put("TGG", "W");
595 codonHash2.put("TGC", "C");
596 codonHash2.put("TGT", "C");
598 codonHash2.put("ATA", "I");
599 codonHash2.put("ATC", "I");
600 codonHash2.put("ATT", "I");
602 codonHash2.put("ATG", "M");
604 codonHash2.put("CTA", "L");
605 codonHash2.put("CTG", "L");
606 codonHash2.put("CTC", "L");
607 codonHash2.put("CTT", "L");
608 codonHash2.put("TTA", "L");
609 codonHash2.put("TTG", "L");
611 codonHash2.put("GTA", "V");
612 codonHash2.put("GTG", "V");
613 codonHash2.put("GTC", "V");
614 codonHash2.put("GTT", "V");
616 codonHash2.put("TTC", "F");
617 codonHash2.put("TTT", "F");
619 buildAmbiguityCodonSet();
623 * programmatic generation of codons including ambiguity codes
625 public static void buildAmbiguityCodonSet()
627 if (_ambiguityCodes.size() > 0)
630 .println("Ignoring multiple calls to buildAmbiguityCodonSet");
633 // Invert the ambiguity code set
634 for (Map.Entry<String, String[]> acode : ambiguityCodes.entrySet())
636 for (String r : acode.getValue())
638 List<String> codesfor = _ambiguityCodes.get(r);
639 if (codesfor == null)
641 _ambiguityCodes.put(r, codesfor = new ArrayList<String>());
643 if (!codesfor.contains(acode.getKey()))
645 codesfor.add(acode.getKey());
650 "Inconsistency in the IUBMB ambiguity code nomenclature table: collision for "
651 + acode.getKey() + " in residue " + r);
655 // and programmatically add in the ambiguity codes that yield the same amino
657 String[] unambcodons = codonHash2.keySet()
658 .toArray(new String[codonHash2.size()]);
659 for (String codon : unambcodons)
661 String residue = codonHash2.get(codon);
662 String acodon[][] = new String[codon.length()][];
663 for (int i = 0, iSize = codon.length(); i < iSize; i++)
665 String _ac = "" + codon.charAt(i);
666 List<String> acodes = _ambiguityCodes.get(_ac);
669 acodon[i] = acodes.toArray(new String[acodes.size()]);
673 acodon[i] = new String[] {};
676 // enumerate all combinations and test for veracity of translation
677 int tpos[] = new int[codon.length()],
678 cpos[] = new int[codon.length()];
679 for (int i = 0; i < tpos.length; i++)
683 tpos[acodon.length - 1] = 0;
685 while (tpos[0] < acodon[0].length)
687 // make all codons for this combination
688 char allres[][] = new char[tpos.length][];
690 for (ipos = 0; ipos < tpos.length; ipos++)
692 if (acodon[ipos].length == 0 || tpos[ipos] < 0)
694 _acodon += codon.charAt(ipos);
695 allres[ipos] = new char[] { codon.charAt(ipos) };
699 _acodon += acodon[ipos][tpos[ipos]];
700 String[] altbase = ambiguityCodes.get(acodon[ipos][tpos[ipos]]);
701 allres[ipos] = new char[altbase.length];
703 for (String ab : altbase)
705 allres[ipos][j++] = ab.charAt(0);
709 // test all codons for this combination
710 for (ipos = 0; ipos < cpos.length; ipos++)
714 boolean valid = true;
718 for (j = 0; j < cpos.length; j++)
720 _codon += allres[j][cpos[j]];
722 String tr = codonHash2.get(_codon);
723 if (valid = (tr != null && tr.equals(residue)))
725 // advance to next combination
726 ipos = acodon.length - 1;
727 while (++cpos[ipos] >= allres[ipos].length && ipos > 0)
733 } while (valid && cpos[0] < allres[0].length);
736 // Add this to the set of codons we will translate
737 // System.out.println("Adding ambiguity codon: " + _acodon + " for "
739 codonHash2.put(_acodon, residue);
743 // System.err.println("Rejecting ambiguity codon: " + _acodon
744 // + " for " + residue);
747 ipos = acodon.length - 1;
748 while (++tpos[ipos] >= acodon[ipos].length && ipos > 0)
757 // Stores residue codes/names and colours and other things
758 public static Map<String, Map<String, Integer>> propHash = new Hashtable<String, Map<String, Integer>>();
760 public static Map<String, Integer> hydrophobic = new Hashtable<String, Integer>();
762 public static Map<String, Integer> polar = new Hashtable<String, Integer>();
764 public static Map<String, Integer> small = new Hashtable<String, Integer>();
766 public static Map<String, Integer> positive = new Hashtable<String, Integer>();
768 public static Map<String, Integer> negative = new Hashtable<String, Integer>();
770 public static Map<String, Integer> charged = new Hashtable<String, Integer>();
772 public static Map<String, Integer> aromatic = new Hashtable<String, Integer>();
774 public static Map<String, Integer> aliphatic = new Hashtable<String, Integer>();
776 public static Map<String, Integer> tiny = new Hashtable<String, Integer>();
778 public static Map<String, Integer> proline = new Hashtable<String, Integer>();
782 hydrophobic.put("I", ONE);
783 hydrophobic.put("L", ONE);
784 hydrophobic.put("V", ONE);
785 hydrophobic.put("C", ONE);
786 hydrophobic.put("A", ONE);
787 hydrophobic.put("G", ONE);
788 hydrophobic.put("M", ONE);
789 hydrophobic.put("F", ONE);
790 hydrophobic.put("Y", ONE);
791 hydrophobic.put("W", ONE);
792 hydrophobic.put("H", ONE);
793 hydrophobic.put("K", ONE);
794 hydrophobic.put("X", ONE);
795 hydrophobic.put("-", ONE);
796 hydrophobic.put("*", ONE);
797 hydrophobic.put("R", ZERO);
798 hydrophobic.put("E", ZERO);
799 hydrophobic.put("Q", ZERO);
800 hydrophobic.put("D", ZERO);
801 hydrophobic.put("N", ZERO);
802 hydrophobic.put("S", ZERO);
803 hydrophobic.put("T", ONE);
804 hydrophobic.put("P", ZERO);
823 polar.put("I", ZERO);
824 polar.put("L", ZERO);
825 polar.put("V", ZERO);
826 polar.put("C", ZERO);
827 polar.put("A", ZERO);
828 polar.put("G", ZERO);
829 polar.put("M", ZERO);
830 polar.put("F", ZERO);
831 polar.put("P", ZERO);
836 small.put("I", ZERO);
837 small.put("L", ZERO);
842 small.put("M", ZERO);
843 small.put("F", ZERO);
844 small.put("Y", ZERO);
845 small.put("W", ZERO);
846 small.put("H", ZERO);
847 small.put("K", ZERO);
848 small.put("R", ZERO);
849 small.put("E", ZERO);
850 small.put("Q", ZERO);
862 positive.put("I", ZERO);
863 positive.put("L", ZERO);
864 positive.put("V", ZERO);
865 positive.put("C", ZERO);
866 positive.put("A", ZERO);
867 positive.put("G", ZERO);
868 positive.put("M", ZERO);
869 positive.put("F", ZERO);
870 positive.put("Y", ZERO);
871 positive.put("W", ZERO);
872 positive.put("H", ONE);
873 positive.put("K", ONE);
874 positive.put("R", ONE);
875 positive.put("E", ZERO);
876 positive.put("Q", ZERO);
877 positive.put("D", ZERO);
878 positive.put("N", ZERO);
879 positive.put("S", ZERO);
880 positive.put("T", ZERO);
881 positive.put("P", ZERO);
882 positive.put("-", ONE);
883 positive.put("*", ONE);
888 negative.put("I", ZERO);
889 negative.put("L", ZERO);
890 negative.put("V", ZERO);
891 negative.put("C", ZERO);
892 negative.put("A", ZERO);
893 negative.put("G", ZERO);
894 negative.put("M", ZERO);
895 negative.put("F", ZERO);
896 negative.put("Y", ZERO);
897 negative.put("W", ZERO);
898 negative.put("H", ZERO);
899 negative.put("K", ZERO);
900 negative.put("R", ZERO);
901 negative.put("E", ONE);
902 negative.put("Q", ZERO);
903 negative.put("D", ONE);
904 negative.put("N", ZERO);
905 negative.put("S", ZERO);
906 negative.put("T", ZERO);
907 negative.put("P", ZERO);
908 negative.put("-", ONE);
909 negative.put("*", ONE);
914 charged.put("I", ZERO);
915 charged.put("L", ZERO);
916 charged.put("V", ZERO);
917 charged.put("C", ZERO);
918 charged.put("A", ZERO);
919 charged.put("G", ZERO);
920 charged.put("M", ZERO);
921 charged.put("F", ZERO);
922 charged.put("Y", ZERO);
923 charged.put("W", ZERO);
924 charged.put("H", ONE);
925 charged.put("K", ONE);
926 charged.put("R", ONE);
927 charged.put("E", ONE);
928 charged.put("Q", ZERO);
929 charged.put("D", ONE);
930 charged.put("N", ZERO); // Asparagine is polar but not
932 // Alternative would be charged and
933 // negative (in basic form)?
934 charged.put("S", ZERO);
935 charged.put("T", ZERO);
936 charged.put("P", ZERO);
937 charged.put("-", ONE);
938 charged.put("*", ONE);
943 aromatic.put("I", ZERO);
944 aromatic.put("L", ZERO);
945 aromatic.put("V", ZERO);
946 aromatic.put("C", ZERO);
947 aromatic.put("A", ZERO);
948 aromatic.put("G", ZERO);
949 aromatic.put("M", ZERO);
950 aromatic.put("F", ONE);
951 aromatic.put("Y", ONE);
952 aromatic.put("W", ONE);
953 aromatic.put("H", ONE);
954 aromatic.put("K", ZERO);
955 aromatic.put("R", ZERO);
956 aromatic.put("E", ZERO);
957 aromatic.put("Q", ZERO);
958 aromatic.put("D", ZERO);
959 aromatic.put("N", ZERO);
960 aromatic.put("S", ZERO);
961 aromatic.put("T", ZERO);
962 aromatic.put("P", ZERO);
963 aromatic.put("-", ONE);
964 aromatic.put("*", ONE);
969 aliphatic.put("I", ONE);
970 aliphatic.put("L", ONE);
971 aliphatic.put("V", ONE);
972 aliphatic.put("C", ZERO);
973 aliphatic.put("A", ZERO);
974 aliphatic.put("G", ZERO);
975 aliphatic.put("M", ZERO);
976 aliphatic.put("F", ZERO);
977 aliphatic.put("Y", ZERO);
978 aliphatic.put("W", ZERO);
979 aliphatic.put("H", ZERO);
980 aliphatic.put("K", ZERO);
981 aliphatic.put("R", ZERO);
982 aliphatic.put("E", ZERO);
983 aliphatic.put("Q", ZERO);
984 aliphatic.put("D", ZERO);
985 aliphatic.put("N", ZERO);
986 aliphatic.put("S", ZERO);
987 aliphatic.put("T", ZERO);
988 aliphatic.put("P", ZERO);
989 aliphatic.put("-", ONE);
990 aliphatic.put("*", ONE);
1001 tiny.put("M", ZERO);
1002 tiny.put("F", ZERO);
1003 tiny.put("Y", ZERO);
1004 tiny.put("W", ZERO);
1005 tiny.put("H", ZERO);
1006 tiny.put("K", ZERO);
1007 tiny.put("R", ZERO);
1008 tiny.put("E", ZERO);
1009 tiny.put("Q", ZERO);
1010 tiny.put("D", ZERO);
1011 tiny.put("N", ZERO);
1013 tiny.put("T", ZERO);
1014 tiny.put("P", ZERO);
1021 proline.put("I", ZERO);
1022 proline.put("L", ZERO);
1023 proline.put("V", ZERO);
1024 proline.put("C", ZERO);
1025 proline.put("A", ZERO);
1026 proline.put("G", ZERO);
1027 proline.put("M", ZERO);
1028 proline.put("F", ZERO);
1029 proline.put("Y", ZERO);
1030 proline.put("W", ZERO);
1031 proline.put("H", ZERO);
1032 proline.put("K", ZERO);
1033 proline.put("R", ZERO);
1034 proline.put("E", ZERO);
1035 proline.put("Q", ZERO);
1036 proline.put("D", ZERO);
1037 proline.put("N", ZERO);
1038 proline.put("S", ZERO);
1039 proline.put("T", ZERO);
1040 proline.put("P", ONE);
1041 proline.put("-", ONE);
1042 proline.put("*", ONE);
1047 propHash.put("hydrophobic", hydrophobic);
1048 propHash.put("small", small);
1049 propHash.put("positive", positive);
1050 propHash.put("negative", negative);
1051 propHash.put("charged", charged);
1052 propHash.put("aromatic", aromatic);
1053 propHash.put("aliphatic", aliphatic);
1054 propHash.put("tiny", tiny);
1055 propHash.put("proline", proline);
1056 propHash.put("polar", polar);
1060 int[][] propMatrixF = new int[maxProteinIndex][maxProteinIndex],
1061 propMatrixPos = new int[maxProteinIndex][maxProteinIndex],
1062 propMatrixEpos = new int[maxProteinIndex][maxProteinIndex];
1063 for (int i = 0; i < maxProteinIndex; i++)
1065 int maxF = 0, maxP = 0, maxEP = 0;
1075 for (int j = i + 1; j < maxProteinIndex; j++)
1086 propMatrixF[i][j] = 0;
1087 propMatrixPos[i][j] = 0;
1088 propMatrixEpos[i][j] = 0;
1089 for (String ph : propHash.keySet())
1091 Map<String, Integer> pph = propHash.get(ph);
1092 if (pph.get(ic) != null && pph.get(jc) != null)
1094 int icp = pph.get(ic).intValue(), jcp = pph.get(jc).intValue();
1095 // Still working on these definitions.
1096 propMatrixPos[i][j] += icp == jcp && icp > 0 ? 2 : 0;
1097 propMatrixPos[j][i] += icp == jcp && icp > 0 ? 2 : 0;
1098 propMatrixF[i][j] += icp == jcp ? 2 : 0;
1099 propMatrixF[j][i] += icp == jcp ? 2 : 0;
1100 propMatrixEpos[i][j] += icp == jcp ? (1 + icp * 2) : 0;
1101 propMatrixEpos[j][i] += icp == jcp ? (1 + icp * 2) : 0;
1104 if (maxF < propMatrixF[i][j])
1106 maxF = propMatrixF[i][j];
1108 if (maxP < propMatrixPos[i][j])
1110 maxP = propMatrixPos[i][j];
1112 if (maxEP < propMatrixEpos[i][j])
1114 maxEP = propMatrixEpos[i][j];
1117 propMatrixF[i][i] = maxF;
1118 propMatrixPos[i][i] = maxP;
1119 propMatrixEpos[i][i] = maxEP;
1123 private ResidueProperties()
1127 public static double getHydmax()
1132 public static double getHydmin()
1137 public static double[] getHyd()
1142 public static Map<String, Integer> getAA3Hash()
1147 public static String codonTranslate(String lccodon)
1149 String cdn = codonHash2.get(lccodon.toUpperCase());
1150 if ("*".equals(cdn))
1157 public static Hashtable<String, String> toDssp3State;
1160 toDssp3State = new Hashtable<String, String>();
1161 toDssp3State.put("H", "H");
1162 toDssp3State.put("E", "E");
1163 toDssp3State.put("C", " ");
1164 toDssp3State.put(" ", " ");
1165 toDssp3State.put("T", " ");
1166 toDssp3State.put("B", "E");
1167 toDssp3State.put("G", "H");
1168 toDssp3State.put("I", "H");
1169 toDssp3State.put("X", " ");
1173 * translate from other dssp secondary structure alphabets to 3-state
1176 * @return ssstring as a three-state secondary structure assignment.
1178 public static String getDssp3state(String ssstring)
1180 if (ssstring == null)
1184 StringBuffer ss = new StringBuffer();
1185 for (int i = 0; i < ssstring.length(); i++)
1187 String ssc = ssstring.substring(i, i + 1);
1188 if (toDssp3State.containsKey(ssc))
1190 ss.append(toDssp3State.get(ssc));
1197 return ss.toString();
1202 modifications.put("MSE", "MET"); // Selenomethionine
1203 // the rest tbc; from
1204 // http://sourceforge.net/p/jmol/mailman/message/12833570/
1205 // modifications.put("CSE", "CYS"); // Selenocysteine
1206 // modifications.put("PTR", "TYR"); // Phosphotyrosine
1207 // modifications.put("SEP", "SER"); // Phosphoserine
1208 // modifications.put("HYP", "PRO"); // 4-hydroxyproline
1209 // modifications.put("5HP", "GLU"); // Pyroglutamic acid; 5-hydroxyproline
1210 // modifications.put("PCA", "GLU"); // Pyroglutamic acid
1211 // modifications.put("LYZ", "LYS"); // 5-hydroxylysine
1213 // Additional protein alphabets used in the SCOP database and PDB files
1215 // https://github.com/biopython/biopython/blob/master/Bio/Data/SCOPData.py
1216 modifications.put("00C", "CYS");
1217 modifications.put("01W", "XAA");
1218 modifications.put("02K", "ALA");
1219 modifications.put("03Y", "CYS");
1220 modifications.put("07O", "CYS");
1221 modifications.put("08P", "CYS");
1222 modifications.put("0A0", "ASP");
1223 modifications.put("0A1", "TYR");
1224 modifications.put("0A2", "LYS");
1225 modifications.put("0A8", "CYS");
1226 modifications.put("0AA", "VAL");
1227 modifications.put("0AB", "VAL");
1228 modifications.put("0AC", "GLY");
1229 modifications.put("0AD", "GLY");
1230 modifications.put("0AF", "TRP");
1231 modifications.put("0AG", "LEU");
1232 modifications.put("0AH", "SER");
1233 modifications.put("0AK", "ASP");
1234 modifications.put("0AM", "ALA");
1235 modifications.put("0AP", "CYS");
1236 modifications.put("0AU", "UR3");
1237 modifications.put("0AV", "ALA");
1238 modifications.put("0AZ", "PRO");
1239 modifications.put("0BN", "PHE");
1240 modifications.put("0C ", "CYS");
1241 modifications.put("0CS", "ALA");
1242 modifications.put("0DC", "CYS");
1243 modifications.put("0DG", "GLY");
1244 modifications.put("0DT", "THR");
1245 modifications.put("0FL", "ALA");
1246 modifications.put("0G ", "GLY");
1247 modifications.put("0NC", "ALA");
1248 modifications.put("0SP", "ALA");
1249 modifications.put("0U ", "UR3");
1250 modifications.put("0YG", "YG");
1251 modifications.put("10C", "CYS");
1252 modifications.put("125", "UR3");
1253 modifications.put("126", "UR3");
1254 modifications.put("127", "UR3");
1255 modifications.put("128", "ASN");
1256 modifications.put("12A", "ALA");
1257 modifications.put("143", "CYS");
1258 modifications.put("175", "ASG");
1259 modifications.put("193", "XAA");
1260 modifications.put("1AP", "ALA");
1261 modifications.put("1MA", "ALA");
1262 modifications.put("1MG", "GLY");
1263 modifications.put("1PA", "PHE");
1264 modifications.put("1PI", "ALA");
1265 modifications.put("1PR", "ASN");
1266 modifications.put("1SC", "CYS");
1267 modifications.put("1TQ", "TRP");
1268 modifications.put("1TY", "TYR");
1269 modifications.put("1X6", "SER");
1270 modifications.put("200", "PHE");
1271 modifications.put("23F", "PHE");
1272 modifications.put("23S", "XAA");
1273 modifications.put("26B", "THR");
1274 modifications.put("2AD", "XAA");
1275 modifications.put("2AG", "ALA");
1276 modifications.put("2AO", "XAA");
1277 modifications.put("2AR", "ALA");
1278 modifications.put("2AS", "XAA");
1279 modifications.put("2AT", "THR");
1280 modifications.put("2AU", "UR3");
1281 modifications.put("2BD", "ILE");
1282 modifications.put("2BT", "THR");
1283 modifications.put("2BU", "ALA");
1284 modifications.put("2CO", "CYS");
1285 modifications.put("2DA", "ALA");
1286 modifications.put("2DF", "ASN");
1287 modifications.put("2DM", "ASN");
1288 modifications.put("2DO", "XAA");
1289 modifications.put("2DT", "THR");
1290 modifications.put("2EG", "GLY");
1291 modifications.put("2FE", "ASN");
1292 modifications.put("2FI", "ASN");
1293 modifications.put("2FM", "MET");
1294 modifications.put("2GT", "THR");
1295 modifications.put("2HF", "HIS");
1296 modifications.put("2LU", "LEU");
1297 modifications.put("2MA", "ALA");
1298 modifications.put("2MG", "GLY");
1299 modifications.put("2ML", "LEU");
1300 modifications.put("2MR", "ARG");
1301 modifications.put("2MT", "PRO");
1302 modifications.put("2MU", "UR3");
1303 modifications.put("2NT", "THR");
1304 modifications.put("2OM", "UR3");
1305 modifications.put("2OT", "THR");
1306 modifications.put("2PI", "XAA");
1307 modifications.put("2PR", "GLY");
1308 modifications.put("2SA", "ASN");
1309 modifications.put("2SI", "XAA");
1310 modifications.put("2ST", "THR");
1311 modifications.put("2TL", "THR");
1312 modifications.put("2TY", "TYR");
1313 modifications.put("2VA", "VAL");
1314 modifications.put("2XA", "CYS");
1315 modifications.put("32S", "XAA");
1316 modifications.put("32T", "XAA");
1317 modifications.put("3AH", "HIS");
1318 modifications.put("3AR", "XAA");
1319 modifications.put("3CF", "PHE");
1320 modifications.put("3DA", "ALA");
1321 modifications.put("3DR", "ASN");
1322 modifications.put("3GA", "ALA");
1323 modifications.put("3MD", "ASP");
1324 modifications.put("3ME", "UR3");
1325 modifications.put("3NF", "TYR");
1326 modifications.put("3QN", "LYS");
1327 modifications.put("3TY", "XAA");
1328 modifications.put("3XH", "GLY");
1329 modifications.put("4AC", "ASN");
1330 modifications.put("4BF", "TYR");
1331 modifications.put("4CF", "PHE");
1332 modifications.put("4CY", "MET");
1333 modifications.put("4DP", "TRP");
1334 modifications.put("4F3", "GYG");
1335 modifications.put("4FB", "PRO");
1336 modifications.put("4FW", "TRP");
1337 modifications.put("4HT", "TRP");
1338 modifications.put("4IN", "TRP");
1339 modifications.put("4MF", "ASN");
1340 modifications.put("4MM", "XAA");
1341 modifications.put("4OC", "CYS");
1342 modifications.put("4PC", "CYS");
1343 modifications.put("4PD", "CYS");
1344 modifications.put("4PE", "CYS");
1345 modifications.put("4PH", "PHE");
1346 modifications.put("4SC", "CYS");
1347 modifications.put("4SU", "UR3");
1348 modifications.put("4TA", "ASN");
1349 modifications.put("4U7", "ALA");
1350 modifications.put("56A", "HIS");
1351 modifications.put("5AA", "ALA");
1352 modifications.put("5AB", "ALA");
1353 modifications.put("5AT", "THR");
1354 modifications.put("5BU", "UR3");
1355 modifications.put("5CG", "GLY");
1356 modifications.put("5CM", "CYS");
1357 modifications.put("5CS", "CYS");
1358 modifications.put("5FA", "ALA");
1359 modifications.put("5FC", "CYS");
1360 modifications.put("5FU", "UR3");
1361 modifications.put("5HP", "GLU");
1362 modifications.put("5HT", "THR");
1363 modifications.put("5HU", "UR3");
1364 modifications.put("5IC", "CYS");
1365 modifications.put("5IT", "THR");
1366 modifications.put("5IU", "UR3");
1367 modifications.put("5MC", "CYS");
1368 modifications.put("5MD", "ASN");
1369 modifications.put("5MU", "UR3");
1370 modifications.put("5NC", "CYS");
1371 modifications.put("5PC", "CYS");
1372 modifications.put("5PY", "THR");
1373 modifications.put("5SE", "UR3");
1374 modifications.put("5ZA", "TWG");
1375 modifications.put("64T", "THR");
1376 modifications.put("6CL", "LYS");
1377 modifications.put("6CT", "THR");
1378 modifications.put("6CW", "TRP");
1379 modifications.put("6HA", "ALA");
1380 modifications.put("6HC", "CYS");
1381 modifications.put("6HG", "GLY");
1382 modifications.put("6HN", "LYS");
1383 modifications.put("6HT", "THR");
1384 modifications.put("6IA", "ALA");
1385 modifications.put("6MA", "ALA");
1386 modifications.put("6MC", "ALA");
1387 modifications.put("6MI", "ASN");
1388 modifications.put("6MT", "ALA");
1389 modifications.put("6MZ", "ASN");
1390 modifications.put("6OG", "GLY");
1391 modifications.put("70U", "UR3");
1392 modifications.put("7DA", "ALA");
1393 modifications.put("7GU", "GLY");
1394 modifications.put("7JA", "ILE");
1395 modifications.put("7MG", "GLY");
1396 modifications.put("8AN", "ALA");
1397 modifications.put("8FG", "GLY");
1398 modifications.put("8MG", "GLY");
1399 modifications.put("8OG", "GLY");
1400 modifications.put("9NE", "GLU");
1401 modifications.put("9NF", "PHE");
1402 modifications.put("9NR", "ARG");
1403 modifications.put("9NV", "VAL");
1404 modifications.put("A ", "ALA");
1405 modifications.put("A1P", "ASN");
1406 modifications.put("A23", "ALA");
1407 modifications.put("A2L", "ALA");
1408 modifications.put("A2M", "ALA");
1409 modifications.put("A34", "ALA");
1410 modifications.put("A35", "ALA");
1411 modifications.put("A38", "ALA");
1412 modifications.put("A39", "ALA");
1413 modifications.put("A3A", "ALA");
1414 modifications.put("A3P", "ALA");
1415 modifications.put("A40", "ALA");
1416 modifications.put("A43", "ALA");
1417 modifications.put("A44", "ALA");
1418 modifications.put("A47", "ALA");
1419 modifications.put("A5L", "ALA");
1420 modifications.put("A5M", "CYS");
1421 modifications.put("A5N", "ASN");
1422 modifications.put("A5O", "ALA");
1423 modifications.put("A66", "XAA");
1424 modifications.put("AA3", "ALA");
1425 modifications.put("AA4", "ALA");
1426 modifications.put("AAR", "ARG");
1427 modifications.put("AB7", "XAA");
1428 modifications.put("ABA", "ALA");
1429 modifications.put("ABR", "ALA");
1430 modifications.put("ABS", "ALA");
1431 modifications.put("ABT", "ASN");
1432 modifications.put("ACB", "ASP");
1433 modifications.put("ACL", "ARG");
1434 modifications.put("AD2", "ALA");
1435 modifications.put("ADD", "XAA");
1436 modifications.put("ADX", "ASN");
1437 modifications.put("AEA", "XAA");
1438 modifications.put("AEI", "ASP");
1439 modifications.put("AET", "ALA");
1440 modifications.put("AFA", "ASN");
1441 modifications.put("AFF", "ASN");
1442 modifications.put("AFG", "GLY");
1443 modifications.put("AGM", "ARG");
1444 modifications.put("AGT", "CYS");
1445 modifications.put("AHB", "ASN");
1446 modifications.put("AHH", "XAA");
1447 modifications.put("AHO", "ALA");
1448 modifications.put("AHP", "ALA");
1449 modifications.put("AHS", "XAA");
1450 modifications.put("AHT", "XAA");
1451 modifications.put("AIB", "ALA");
1452 modifications.put("AKL", "ASP");
1453 modifications.put("AKZ", "ASP");
1454 modifications.put("ALA", "ALA");
1455 modifications.put("ALC", "ALA");
1456 modifications.put("ALM", "ALA");
1457 modifications.put("ALN", "ALA");
1458 modifications.put("ALO", "THR");
1459 modifications.put("ALQ", "XAA");
1460 modifications.put("ALS", "ALA");
1461 modifications.put("ALT", "ALA");
1462 modifications.put("ALV", "ALA");
1463 modifications.put("ALY", "LYS");
1464 modifications.put("AN8", "ALA");
1465 modifications.put("AP7", "ALA");
1466 modifications.put("APE", "XAA");
1467 modifications.put("APH", "ALA");
1468 modifications.put("API", "LYS");
1469 modifications.put("APK", "LYS");
1470 modifications.put("APM", "XAA");
1471 modifications.put("APP", "XAA");
1472 modifications.put("AR2", "ARG");
1473 modifications.put("AR4", "GLU");
1474 modifications.put("AR7", "ARG");
1475 modifications.put("ARG", "ARG");
1476 modifications.put("ARM", "ARG");
1477 modifications.put("ARO", "ARG");
1478 modifications.put("ARV", "XAA");
1479 modifications.put("AS ", "ALA");
1480 modifications.put("AS2", "ASP");
1481 modifications.put("AS9", "XAA");
1482 modifications.put("ASA", "ASP");
1483 modifications.put("ASB", "ASP");
1484 modifications.put("ASI", "ASP");
1485 modifications.put("ASK", "ASP");
1486 modifications.put("ASL", "ASP");
1487 modifications.put("ASM", "XAA");
1488 modifications.put("ASN", "ASN");
1489 modifications.put("ASP", "ASP");
1490 modifications.put("ASQ", "ASP");
1491 modifications.put("ASU", "ASN");
1492 modifications.put("ASX", "ASX");
1493 modifications.put("ATD", "THR");
1494 modifications.put("ATL", "THR");
1495 modifications.put("ATM", "THR");
1496 modifications.put("AVC", "ALA");
1497 modifications.put("AVN", "XAA");
1498 modifications.put("AYA", "ALA");
1499 modifications.put("AYG", "AYG");
1500 modifications.put("AZK", "LYS");
1501 modifications.put("AZS", "SER");
1502 modifications.put("AZY", "TYR");
1503 modifications.put("B1F", "PHE");
1504 modifications.put("B1P", "ASN");
1505 modifications.put("B2A", "ALA");
1506 modifications.put("B2F", "PHE");
1507 modifications.put("B2I", "ILE");
1508 modifications.put("B2V", "VAL");
1509 modifications.put("B3A", "ALA");
1510 modifications.put("B3D", "ASP");
1511 modifications.put("B3E", "GLU");
1512 modifications.put("B3K", "LYS");
1513 modifications.put("B3L", "XAA");
1514 modifications.put("B3M", "XAA");
1515 modifications.put("B3Q", "XAA");
1516 modifications.put("B3S", "SER");
1517 modifications.put("B3T", "XAA");
1518 modifications.put("B3U", "HIS");
1519 modifications.put("B3X", "ASN");
1520 modifications.put("B3Y", "TYR");
1521 modifications.put("BB6", "CYS");
1522 modifications.put("BB7", "CYS");
1523 modifications.put("BB8", "PHE");
1524 modifications.put("BB9", "CYS");
1525 modifications.put("BBC", "CYS");
1526 modifications.put("BCS", "CYS");
1527 modifications.put("BE2", "XAA");
1528 modifications.put("BFD", "ASP");
1529 modifications.put("BG1", "SER");
1530 modifications.put("BGM", "GLY");
1531 modifications.put("BH2", "ASP");
1532 modifications.put("BHD", "ASP");
1533 modifications.put("BIF", "PHE");
1534 modifications.put("BIL", "XAA");
1535 modifications.put("BIU", "ILE");
1536 modifications.put("BJH", "XAA");
1537 modifications.put("BLE", "LEU");
1538 modifications.put("BLY", "LYS");
1539 modifications.put("BMP", "ASN");
1540 modifications.put("BMT", "THR");
1541 modifications.put("BNN", "PHE");
1542 modifications.put("BNO", "XAA");
1543 modifications.put("BOE", "THR");
1544 modifications.put("BOR", "ARG");
1545 modifications.put("BPE", "CYS");
1546 modifications.put("BRU", "UR3");
1547 modifications.put("BSE", "SER");
1548 modifications.put("BT5", "ASN");
1549 modifications.put("BTA", "LEU");
1550 modifications.put("BTC", "CYS");
1551 modifications.put("BTR", "TRP");
1552 modifications.put("BUC", "CYS");
1553 modifications.put("BUG", "VAL");
1554 modifications.put("BVP", "UR3");
1555 modifications.put("BZG", "ASN");
1556 modifications.put("C ", "CYS");
1557 modifications.put("C12", "TYG");
1558 modifications.put("C1X", "LYS");
1559 modifications.put("C25", "CYS");
1560 modifications.put("C2L", "CYS");
1561 modifications.put("C2S", "CYS");
1562 modifications.put("C31", "CYS");
1563 modifications.put("C32", "CYS");
1564 modifications.put("C34", "CYS");
1565 modifications.put("C36", "CYS");
1566 modifications.put("C37", "CYS");
1567 modifications.put("C38", "CYS");
1568 modifications.put("C3Y", "CYS");
1569 modifications.put("C42", "CYS");
1570 modifications.put("C43", "CYS");
1571 modifications.put("C45", "CYS");
1572 modifications.put("C46", "CYS");
1573 modifications.put("C49", "CYS");
1574 modifications.put("C4R", "CYS");
1575 modifications.put("C4S", "CYS");
1576 modifications.put("C5C", "CYS");
1577 modifications.put("C66", "XAA");
1578 modifications.put("C6C", "CYS");
1579 modifications.put("C99", "TFG");
1580 modifications.put("CAF", "CYS");
1581 modifications.put("CAL", "XAA");
1582 modifications.put("CAR", "CYS");
1583 modifications.put("CAS", "CYS");
1584 modifications.put("CAV", "XAA");
1585 modifications.put("CAY", "CYS");
1586 modifications.put("CB2", "CYS");
1587 modifications.put("CBR", "CYS");
1588 modifications.put("CBV", "CYS");
1589 modifications.put("CCC", "CYS");
1590 modifications.put("CCL", "LYS");
1591 modifications.put("CCS", "CYS");
1592 modifications.put("CCY", "CYG");
1593 modifications.put("CDE", "XAA");
1594 modifications.put("CDV", "XAA");
1595 modifications.put("CDW", "CYS");
1596 modifications.put("CEA", "CYS");
1597 modifications.put("CFL", "CYS");
1598 modifications.put("CFY", "FCYG"); // check
1599 modifications.put("CG1", "GLY");
1600 modifications.put("CGA", "GLU");
1601 modifications.put("CGU", "GLU");
1602 modifications.put("CH ", "CYS");
1603 modifications.put("CH6", "MYG");
1604 modifications.put("CH7", "KYG");
1605 modifications.put("CHF", "XAA");
1606 modifications.put("CHG", "XAA");
1607 modifications.put("CHP", "GLY");
1608 modifications.put("CHS", "XAA");
1609 modifications.put("CIR", "ARG");
1610 modifications.put("CJO", "GYG");
1611 modifications.put("CLE", "LEU");
1612 modifications.put("CLG", "LYS");
1613 modifications.put("CLH", "LYS");
1614 modifications.put("CLV", "AFG");
1615 modifications.put("CM0", "ASN");
1616 modifications.put("CME", "CYS");
1617 modifications.put("CMH", "CYS");
1618 modifications.put("CML", "CYS");
1619 modifications.put("CMR", "CYS");
1620 modifications.put("CMT", "CYS");
1621 modifications.put("CNU", "UR3");
1622 modifications.put("CP1", "CYS");
1623 modifications.put("CPC", "XAA");
1624 modifications.put("CPI", "XAA");
1625 modifications.put("CQR", "GYG");
1626 modifications.put("CR0", "TLG");
1627 modifications.put("CR2", "GYG");
1628 modifications.put("CR5", "GLY");
1629 modifications.put("CR7", "KYG");
1630 modifications.put("CR8", "HYG");
1631 modifications.put("CRF", "TWG");
1632 modifications.put("CRG", "THG");
1633 modifications.put("CRK", "MYG");
1634 modifications.put("CRO", "GYG");
1635 modifications.put("CRQ", "QYG");
1636 modifications.put("CRU", "EYG");
1637 modifications.put("CRW", "ASG");
1638 modifications.put("CRX", "ASG");
1639 modifications.put("CS0", "CYS");
1640 modifications.put("CS1", "CYS");
1641 modifications.put("CS3", "CYS");
1642 modifications.put("CS4", "CYS");
1643 modifications.put("CS8", "ASN");
1644 modifications.put("CSA", "CYS");
1645 modifications.put("CSB", "CYS");
1646 modifications.put("CSD", "CYS");
1647 modifications.put("CSE", "CYS");
1648 modifications.put("CSF", "CYS");
1649 modifications.put("CSH", "SHG");
1650 modifications.put("CSI", "GLY");
1651 modifications.put("CSJ", "CYS");
1652 modifications.put("CSL", "CYS");
1653 modifications.put("CSO", "CYS");
1654 modifications.put("CSP", "CYS");
1655 modifications.put("CSR", "CYS");
1656 modifications.put("CSS", "CYS");
1657 modifications.put("CSU", "CYS");
1658 modifications.put("CSW", "CYS");
1659 modifications.put("CSX", "CYS");
1660 modifications.put("CSY", "SYG");
1661 modifications.put("CSZ", "CYS");
1662 modifications.put("CTE", "TRP");
1663 modifications.put("CTG", "THR");
1664 modifications.put("CTH", "THR");
1665 modifications.put("CUC", "XAA");
1666 modifications.put("CWR", "SER");
1667 modifications.put("CXM", "MET");
1668 modifications.put("CY0", "CYS");
1669 modifications.put("CY1", "CYS");
1670 modifications.put("CY3", "CYS");
1671 modifications.put("CY4", "CYS");
1672 modifications.put("CYA", "CYS");
1673 modifications.put("CYD", "CYS");
1674 modifications.put("CYF", "CYS");
1675 modifications.put("CYG", "CYS");
1676 modifications.put("CYJ", "XAA");
1677 modifications.put("CYM", "CYS");
1678 modifications.put("CYQ", "CYS");
1679 modifications.put("CYR", "CYS");
1680 modifications.put("CYS", "CYS");
1681 modifications.put("CZ2", "CYS");
1682 modifications.put("CZO", "GYG");
1683 modifications.put("CZZ", "CYS");
1684 modifications.put("D11", "THR");
1685 modifications.put("D1P", "ASN");
1686 modifications.put("D3 ", "ASN");
1687 modifications.put("D33", "ASN");
1688 modifications.put("D3P", "GLY");
1689 modifications.put("D3T", "THR");
1690 modifications.put("D4M", "THR");
1691 modifications.put("D4P", "XAA");
1692 modifications.put("DA ", "ALA");
1693 modifications.put("DA2", "XAA");
1694 modifications.put("DAB", "ALA");
1695 modifications.put("DAH", "PHE");
1696 modifications.put("DAL", "ALA");
1697 modifications.put("DAR", "ARG");
1698 modifications.put("DAS", "ASP");
1699 modifications.put("DBB", "THR");
1700 modifications.put("DBM", "ASN");
1701 modifications.put("DBS", "SER");
1702 modifications.put("DBU", "THR");
1703 modifications.put("DBY", "TYR");
1704 modifications.put("DBZ", "ALA");
1705 modifications.put("DC ", "CYS");
1706 modifications.put("DC2", "CYS");
1707 modifications.put("DCG", "GLY");
1708 modifications.put("DCI", "XAA");
1709 modifications.put("DCL", "XAA");
1710 modifications.put("DCT", "CYS");
1711 modifications.put("DCY", "CYS");
1712 modifications.put("DDE", "HIS");
1713 modifications.put("DDG", "GLY");
1714 modifications.put("DDN", "UR3");
1715 modifications.put("DDX", "ASN");
1716 modifications.put("DFC", "CYS");
1717 modifications.put("DFG", "GLY");
1718 modifications.put("DFI", "XAA");
1719 modifications.put("DFO", "XAA");
1720 modifications.put("DFT", "ASN");
1721 modifications.put("DG ", "GLY");
1722 modifications.put("DGH", "GLY");
1723 modifications.put("DGI", "GLY");
1724 modifications.put("DGL", "GLU");
1725 modifications.put("DGN", "GLN");
1726 modifications.put("DHA", "SER");
1727 modifications.put("DHI", "HIS");
1728 modifications.put("DHL", "XAA");
1729 modifications.put("DHN", "VAL");
1730 modifications.put("DHP", "XAA");
1731 modifications.put("DHU", "UR3");
1732 modifications.put("DHV", "VAL");
1733 modifications.put("DI ", "ILE");
1734 modifications.put("DIL", "ILE");
1735 modifications.put("DIR", "ARG");
1736 modifications.put("DIV", "VAL");
1737 modifications.put("DLE", "LEU");
1738 modifications.put("DLS", "LYS");
1739 modifications.put("DLY", "LYS");
1740 modifications.put("DM0", "LYS");
1741 modifications.put("DMH", "ASN");
1742 modifications.put("DMK", "ASP");
1743 modifications.put("DMT", "XAA");
1744 modifications.put("DN ", "ASN");
1745 modifications.put("DNE", "LEU");
1746 modifications.put("DNG", "LEU");
1747 modifications.put("DNL", "LYS");
1748 modifications.put("DNM", "LEU");
1749 modifications.put("DNP", "ALA");
1750 modifications.put("DNR", "CYS");
1751 modifications.put("DNS", "LYS");
1752 modifications.put("DOA", "XAA");
1753 modifications.put("DOC", "CYS");
1754 modifications.put("DOH", "ASP");
1755 modifications.put("DON", "LEU");
1756 modifications.put("DPB", "THR");
1757 modifications.put("DPH", "PHE");
1758 modifications.put("DPL", "PRO");
1759 modifications.put("DPP", "ALA");
1760 modifications.put("DPQ", "TYR");
1761 modifications.put("DPR", "PRO");
1762 modifications.put("DPY", "ASN");
1763 modifications.put("DRM", "UR3");
1764 modifications.put("DRP", "ASN");
1765 modifications.put("DRT", "THR");
1766 modifications.put("DRZ", "ASN");
1767 modifications.put("DSE", "SER");
1768 modifications.put("DSG", "ASN");
1769 modifications.put("DSN", "SER");
1770 modifications.put("DSP", "ASP");
1771 modifications.put("DT ", "THR");
1772 modifications.put("DTH", "THR");
1773 modifications.put("DTR", "TRP");
1774 modifications.put("DTY", "TYR");
1775 modifications.put("DU ", "UR3");
1776 modifications.put("DVA", "VAL");
1777 modifications.put("DXD", "ASN");
1778 modifications.put("DXN", "ASN");
1779 modifications.put("DYG", "DYG");
1780 modifications.put("DYS", "CYS");
1781 modifications.put("DZM", "ALA");
1782 modifications.put("E ", "ALA");
1783 modifications.put("E1X", "ALA");
1784 modifications.put("ECC", "GLN");
1785 modifications.put("EDA", "ALA");
1786 modifications.put("EFC", "CYS");
1787 modifications.put("EHP", "PHE");
1788 modifications.put("EIT", "THR");
1789 modifications.put("ENP", "ASN");
1790 modifications.put("ESB", "TYR");
1791 modifications.put("ESC", "MET");
1792 modifications.put("EXB", "XAA");
1793 modifications.put("EXY", "LEU");
1794 modifications.put("EY5", "ASN");
1795 modifications.put("EYS", "XAA");
1796 modifications.put("F2F", "PHE");
1797 modifications.put("FA2", "ALA");
1798 modifications.put("FA5", "ASN");
1799 modifications.put("FAG", "ASN");
1800 modifications.put("FAI", "ASN");
1801 modifications.put("FB5", "ALA");
1802 modifications.put("FB6", "ALA");
1803 modifications.put("FCL", "PHE");
1804 modifications.put("FFD", "ASN");
1805 modifications.put("FGA", "GLU");
1806 modifications.put("FGL", "GLY");
1807 modifications.put("FGP", "SER");
1808 modifications.put("FHL", "XAA");
1809 modifications.put("FHO", "LYS");
1810 modifications.put("FHU", "UR3");
1811 modifications.put("FLA", "ALA");
1812 modifications.put("FLE", "LEU");
1813 modifications.put("FLT", "TYR");
1814 modifications.put("FME", "MET");
1815 modifications.put("FMG", "GLY");
1816 modifications.put("FMU", "ASN");
1817 modifications.put("FOE", "CYS");
1818 modifications.put("FOX", "GLY");
1819 modifications.put("FP9", "PRO");
1820 modifications.put("FPA", "PHE");
1821 modifications.put("FRD", "XAA");
1822 modifications.put("FT6", "TRP");
1823 modifications.put("FTR", "TRP");
1824 modifications.put("FTY", "TYR");
1825 modifications.put("FVA", "VAL");
1826 modifications.put("FZN", "LYS");
1827 modifications.put("G ", "GLY");
1828 modifications.put("G25", "GLY");
1829 modifications.put("G2L", "GLY");
1830 modifications.put("G2S", "GLY");
1831 modifications.put("G31", "GLY");
1832 modifications.put("G32", "GLY");
1833 modifications.put("G33", "GLY");
1834 modifications.put("G36", "GLY");
1835 modifications.put("G38", "GLY");
1836 modifications.put("G42", "GLY");
1837 modifications.put("G46", "GLY");
1838 modifications.put("G47", "GLY");
1839 modifications.put("G48", "GLY");
1840 modifications.put("G49", "GLY");
1841 modifications.put("G4P", "ASN");
1842 modifications.put("G7M", "GLY");
1843 modifications.put("GAO", "GLY");
1844 modifications.put("GAU", "GLU");
1845 modifications.put("GCK", "CYS");
1846 modifications.put("GCM", "XAA");
1847 modifications.put("GDP", "GLY");
1848 modifications.put("GDR", "GLY");
1849 modifications.put("GFL", "GLY");
1850 modifications.put("GGL", "GLU");
1851 modifications.put("GH3", "GLY");
1852 modifications.put("GHG", "GLN");
1853 modifications.put("GHP", "GLY");
1854 modifications.put("GL3", "GLY");
1855 modifications.put("GLH", "GLN");
1856 modifications.put("GLJ", "GLU");
1857 modifications.put("GLK", "GLU");
1858 modifications.put("GLM", "XAA");
1859 modifications.put("GLN", "GLN");
1860 modifications.put("GLQ", "GLU");
1861 modifications.put("GLU", "GLU");
1862 modifications.put("GLX", "GLX");
1863 modifications.put("GLY", "GLY");
1864 modifications.put("GLZ", "GLY");
1865 modifications.put("GMA", "GLU");
1866 modifications.put("GMS", "GLY");
1867 modifications.put("GMU", "UR3");
1868 modifications.put("GN7", "GLY");
1869 modifications.put("GND", "XAA");
1870 modifications.put("GNE", "ASN");
1871 modifications.put("GOM", "GLY");
1872 modifications.put("GPL", "LYS");
1873 modifications.put("GS ", "GLY");
1874 modifications.put("GSC", "GLY");
1875 modifications.put("GSR", "GLY");
1876 modifications.put("GSS", "GLY");
1877 modifications.put("GSU", "GLU");
1878 modifications.put("GT9", "CYS");
1879 modifications.put("GTP", "GLY");
1880 modifications.put("GVL", "XAA");
1881 modifications.put("GYC", "CYG");
1882 modifications.put("GYS", "SYG");
1883 modifications.put("H2U", "UR3");
1884 modifications.put("H5M", "PRO");
1885 modifications.put("HAC", "ALA");
1886 modifications.put("HAR", "ARG");
1887 modifications.put("HBN", "HIS");
1888 modifications.put("HCS", "XAA");
1889 modifications.put("HDP", "UR3");
1890 modifications.put("HEU", "UR3");
1891 modifications.put("HFA", "XAA");
1892 modifications.put("HGL", "XAA");
1893 modifications.put("HHI", "HIS");
1894 modifications.put("HHK", "AK"); // check
1895 modifications.put("HIA", "HIS");
1896 modifications.put("HIC", "HIS");
1897 modifications.put("HIP", "HIS");
1898 modifications.put("HIQ", "HIS");
1899 modifications.put("HIS", "HIS");
1900 modifications.put("HL2", "LEU");
1901 modifications.put("HLU", "LEU");
1902 modifications.put("HMR", "ARG");
1903 modifications.put("HOL", "ASN");
1904 modifications.put("HPC", "PHE");
1905 modifications.put("HPE", "PHE");
1906 modifications.put("HPH", "PHE");
1907 modifications.put("HPQ", "PHE");
1908 modifications.put("HQA", "ALA");
1909 modifications.put("HRG", "ARG");
1910 modifications.put("HRP", "TRP");
1911 modifications.put("HS8", "HIS");
1912 modifications.put("HS9", "HIS");
1913 modifications.put("HSE", "SER");
1914 modifications.put("HSL", "SER");
1915 modifications.put("HSO", "HIS");
1916 modifications.put("HTI", "CYS");
1917 modifications.put("HTN", "ASN");
1918 modifications.put("HTR", "TRP");
1919 modifications.put("HV5", "ALA");
1920 modifications.put("HVA", "VAL");
1921 modifications.put("HY3", "PRO");
1922 modifications.put("HYP", "PRO");
1923 modifications.put("HZP", "PRO");
1924 modifications.put("I ", "ILE");
1925 modifications.put("I2M", "ILE");
1926 modifications.put("I58", "LYS");
1927 modifications.put("I5C", "CYS");
1928 modifications.put("IAM", "ALA");
1929 modifications.put("IAR", "ARG");
1930 modifications.put("IAS", "ASP");
1931 modifications.put("IC ", "CYS");
1932 modifications.put("IEL", "LYS");
1933 modifications.put("IEY", "HYG");
1934 modifications.put("IG ", "GLY");
1935 modifications.put("IGL", "GLY");
1936 modifications.put("IGU", "GLY");
1937 modifications.put("IIC", "SHG");
1938 modifications.put("IIL", "ILE");
1939 modifications.put("ILE", "ILE");
1940 modifications.put("ILG", "GLU");
1941 modifications.put("ILX", "ILE");
1942 modifications.put("IMC", "CYS");
1943 modifications.put("IML", "ILE");
1944 modifications.put("IOY", "PHE");
1945 modifications.put("IPG", "GLY");
1946 modifications.put("IPN", "ASN");
1947 modifications.put("IRN", "ASN");
1948 modifications.put("IT1", "LYS");
1949 modifications.put("IU ", "UR3");
1950 modifications.put("IYR", "TYR");
1951 modifications.put("IYT", "THR");
1952 modifications.put("IZO", "MET");
1953 modifications.put("JJJ", "CYS");
1954 modifications.put("JJK", "CYS");
1955 modifications.put("JJL", "CYS");
1956 modifications.put("JW5", "ASN");
1957 modifications.put("K1R", "CYS");
1958 modifications.put("KAG", "GLY");
1959 modifications.put("KCX", "LYS");
1960 modifications.put("KGC", "LYS");
1961 modifications.put("KNB", "ALA");
1962 modifications.put("KOR", "MET");
1963 modifications.put("KPI", "LYS");
1964 modifications.put("KST", "LYS");
1965 modifications.put("KYQ", "LYS");
1966 modifications.put("L2A", "XAA");
1967 modifications.put("LA2", "LYS");
1968 modifications.put("LAA", "ASP");
1969 modifications.put("LAL", "ALA");
1970 modifications.put("LBY", "LYS");
1971 modifications.put("LC ", "CYS");
1972 modifications.put("LCA", "ALA");
1973 modifications.put("LCC", "ASN");
1974 modifications.put("LCG", "GLY");
1975 modifications.put("LCH", "ASN");
1976 modifications.put("LCK", "LYS");
1977 modifications.put("LCX", "LYS");
1978 modifications.put("LDH", "LYS");
1979 modifications.put("LED", "LEU");
1980 modifications.put("LEF", "LEU");
1981 modifications.put("LEH", "LEU");
1982 modifications.put("LEI", "VAL");
1983 modifications.put("LEM", "LEU");
1984 modifications.put("LEN", "LEU");
1985 modifications.put("LET", "XAA");
1986 modifications.put("LEU", "LEU");
1987 modifications.put("LEX", "LEU");
1988 modifications.put("LG ", "GLY");
1989 modifications.put("LGP", "GLY");
1990 modifications.put("LHC", "XAA");
1991 modifications.put("LHU", "UR3");
1992 modifications.put("LKC", "ASN");
1993 modifications.put("LLP", "LYS");
1994 modifications.put("LLY", "LYS");
1995 modifications.put("LME", "GLU");
1996 modifications.put("LMF", "LYS");
1997 modifications.put("LMQ", "GLN");
1998 modifications.put("LMS", "ASN");
1999 modifications.put("LP6", "LYS");
2000 modifications.put("LPD", "PRO");
2001 modifications.put("LPG", "GLY");
2002 modifications.put("LPL", "XAA");
2003 modifications.put("LPS", "SER");
2004 modifications.put("LSO", "XAA");
2005 modifications.put("LTA", "XAA");
2006 modifications.put("LTR", "TRP");
2007 modifications.put("LVG", "GLY");
2008 modifications.put("LVN", "VAL");
2009 modifications.put("LYF", "LYS");
2010 modifications.put("LYK", "LYS");
2011 modifications.put("LYM", "LYS");
2012 modifications.put("LYN", "LYS");
2013 modifications.put("LYR", "LYS");
2014 modifications.put("LYS", "LYS");
2015 modifications.put("LYX", "LYS");
2016 modifications.put("LYZ", "LYS");
2017 modifications.put("M0H", "CYS");
2018 modifications.put("M1G", "GLY");
2019 modifications.put("M2G", "GLY");
2020 modifications.put("M2L", "LYS");
2021 modifications.put("M2S", "MET");
2022 modifications.put("M30", "GLY");
2023 modifications.put("M3L", "LYS");
2024 modifications.put("M5M", "CYS");
2025 modifications.put("MA ", "ALA");
2026 modifications.put("MA6", "ALA");
2027 modifications.put("MA7", "ALA");
2028 modifications.put("MAA", "ALA");
2029 modifications.put("MAD", "ALA");
2030 modifications.put("MAI", "ARG");
2031 modifications.put("MBQ", "TYR");
2032 modifications.put("MBZ", "ASN");
2033 modifications.put("MC1", "SER");
2034 modifications.put("MCG", "XAA");
2035 modifications.put("MCL", "LYS");
2036 modifications.put("MCS", "CYS");
2037 modifications.put("MCY", "CYS");
2038 modifications.put("MD3", "CYS");
2039 modifications.put("MD6", "GLY");
2040 modifications.put("MDH", "XAA");
2041 modifications.put("MDO", "ASG");
2042 modifications.put("MDR", "ASN");
2043 modifications.put("MEA", "PHE");
2044 modifications.put("MED", "MET");
2045 modifications.put("MEG", "GLU");
2046 modifications.put("MEN", "ASN");
2047 modifications.put("MEP", "UR3");
2048 modifications.put("MEQ", "GLN");
2049 modifications.put("MET", "MET");
2050 modifications.put("MEU", "GLY");
2051 modifications.put("MF3", "XAA");
2052 modifications.put("MFC", "GYG");
2053 modifications.put("MG1", "GLY");
2054 modifications.put("MGG", "ARG");
2055 modifications.put("MGN", "GLN");
2056 modifications.put("MGQ", "ALA");
2057 modifications.put("MGV", "GLY");
2058 modifications.put("MGY", "GLY");
2059 modifications.put("MHL", "LEU");
2060 modifications.put("MHO", "MET");
2061 modifications.put("MHS", "HIS");
2062 modifications.put("MIA", "ALA");
2063 modifications.put("MIS", "SER");
2064 modifications.put("MK8", "LEU");
2065 modifications.put("ML3", "LYS");
2066 modifications.put("MLE", "LEU");
2067 modifications.put("MLL", "LEU");
2068 modifications.put("MLY", "LYS");
2069 modifications.put("MLZ", "LYS");
2070 modifications.put("MME", "MET");
2071 modifications.put("MMO", "ARG");
2072 modifications.put("MMT", "THR");
2073 modifications.put("MND", "ASN");
2074 modifications.put("MNL", "LEU");
2075 modifications.put("MNU", "UR3");
2076 modifications.put("MNV", "VAL");
2077 modifications.put("MOD", "XAA");
2078 modifications.put("MP8", "PRO");
2079 modifications.put("MPH", "XAA");
2080 modifications.put("MPJ", "XAA");
2081 modifications.put("MPQ", "GLY");
2082 modifications.put("MRG", "GLY");
2083 modifications.put("MSA", "GLY");
2084 modifications.put("MSE", "MET");
2085 modifications.put("MSL", "MET");
2086 modifications.put("MSO", "MET");
2087 modifications.put("MSP", "XAA");
2088 modifications.put("MT2", "MET");
2089 modifications.put("MTR", "THR");
2090 modifications.put("MTU", "ALA");
2091 modifications.put("MTY", "TYR");
2092 modifications.put("MVA", "VAL");
2093 modifications.put("N ", "ASN");
2094 modifications.put("N10", "SER");
2095 modifications.put("N2C", "XAA");
2096 modifications.put("N5I", "ASN");
2097 modifications.put("N5M", "CYS");
2098 modifications.put("N6G", "GLY");
2099 modifications.put("N7P", "PRO");
2100 modifications.put("NA8", "ALA");
2101 modifications.put("NAL", "ALA");
2102 modifications.put("NAM", "ALA");
2103 modifications.put("NB8", "ASN");
2104 modifications.put("NBQ", "TYR");
2105 modifications.put("NC1", "SER");
2106 modifications.put("NCB", "ALA");
2107 modifications.put("NCX", "ASN");
2108 modifications.put("NCY", "XAA");
2109 modifications.put("NDF", "PHE");
2110 modifications.put("NDN", "UR3");
2111 modifications.put("NEM", "HIS");
2112 modifications.put("NEP", "HIS");
2113 modifications.put("NF2", "ASN");
2114 modifications.put("NFA", "PHE");
2115 modifications.put("NHL", "GLU");
2116 modifications.put("NIT", "XAA");
2117 modifications.put("NIY", "TYR");
2118 modifications.put("NLE", "LEU");
2119 modifications.put("NLN", "LEU");
2120 modifications.put("NLO", "LEU");
2121 modifications.put("NLP", "LEU");
2122 modifications.put("NLQ", "GLN");
2123 modifications.put("NMC", "GLY");
2124 modifications.put("NMM", "ARG");
2125 modifications.put("NMS", "THR");
2126 modifications.put("NMT", "THR");
2127 modifications.put("NNH", "ARG");
2128 modifications.put("NP3", "ASN");
2129 modifications.put("NPH", "CYS");
2130 modifications.put("NPI", "ALA");
2131 modifications.put("NRP", "LYG");
2132 modifications.put("NRQ", "MYG");
2133 modifications.put("NSK", "XAA");
2134 modifications.put("NTY", "TYR");
2135 modifications.put("NVA", "VAL");
2136 modifications.put("NYC", "TWG");
2137 modifications.put("NYG", "NYG");
2138 modifications.put("NYM", "ASN");
2139 modifications.put("NYS", "CYS");
2140 modifications.put("NZH", "HIS");
2141 modifications.put("O12", "XAA");
2142 modifications.put("O2C", "ASN");
2143 modifications.put("O2G", "GLY");
2144 modifications.put("OAD", "ASN");
2145 modifications.put("OAS", "SER");
2146 modifications.put("OBF", "XAA");
2147 modifications.put("OBS", "XAA");
2148 modifications.put("OCS", "CYS");
2149 modifications.put("OCY", "CYS");
2150 modifications.put("ODP", "ASN");
2151 modifications.put("OHI", "HIS");
2152 modifications.put("OHS", "ASP");
2153 modifications.put("OIC", "XAA");
2154 modifications.put("OIP", "ILE");
2155 modifications.put("OLE", "XAA");
2156 modifications.put("OLT", "THR");
2157 modifications.put("OLZ", "SER");
2158 modifications.put("OMC", "CYS");
2159 modifications.put("OMG", "GLY");
2160 modifications.put("OMT", "MET");
2161 modifications.put("OMU", "UR3");
2162 modifications.put("ONE", "UR3");
2163 modifications.put("ONH", "ALA");
2164 modifications.put("ONL", "XAA");
2165 modifications.put("OPR", "ARG");
2166 modifications.put("ORN", "ALA");
2167 modifications.put("ORQ", "ARG");
2168 modifications.put("OSE", "SER");
2169 modifications.put("OTB", "XAA");
2170 modifications.put("OTH", "THR");
2171 modifications.put("OTY", "TYR");
2172 modifications.put("OXX", "ASP");
2173 modifications.put("P ", "GLY");
2174 modifications.put("P1L", "CYS");
2175 modifications.put("P1P", "ASN");
2176 modifications.put("P2T", "THR");
2177 modifications.put("P2U", "UR3");
2178 modifications.put("P2Y", "PRO");
2179 modifications.put("P5P", "ALA");
2180 modifications.put("PAQ", "TYR");
2181 modifications.put("PAS", "ASP");
2182 modifications.put("PAT", "TRP");
2183 modifications.put("PAU", "ALA");
2184 modifications.put("PBB", "CYS");
2185 modifications.put("PBF", "PHE");
2186 modifications.put("PBT", "ASN");
2187 modifications.put("PCA", "GLU");
2188 modifications.put("PCC", "PRO");
2189 modifications.put("PCE", "XAA");
2190 modifications.put("PCS", "PHE");
2191 modifications.put("PDL", "XAA");
2192 modifications.put("PDU", "UR3");
2193 modifications.put("PEC", "CYS");
2194 modifications.put("PF5", "PHE");
2195 modifications.put("PFF", "PHE");
2196 modifications.put("PFX", "XAA");
2197 modifications.put("PG1", "SER");
2198 modifications.put("PG7", "GLY");
2199 modifications.put("PG9", "GLY");
2200 modifications.put("PGL", "XAA");
2201 modifications.put("PGN", "GLY");
2202 modifications.put("PGP", "GLY");
2203 modifications.put("PGY", "GLY");
2204 modifications.put("PHA", "PHE");
2205 modifications.put("PHD", "ASP");
2206 modifications.put("PHE", "PHE");
2207 modifications.put("PHI", "PHE");
2208 modifications.put("PHL", "PHE");
2209 modifications.put("PHM", "PHE");
2210 modifications.put("PIA", "AYG");
2211 modifications.put("PIV", "XAA");
2212 modifications.put("PLE", "LEU");
2213 modifications.put("PM3", "PHE");
2214 modifications.put("PMT", "CYS");
2215 modifications.put("POM", "PRO");
2216 modifications.put("PPN", "PHE");
2217 modifications.put("PPU", "ALA");
2218 modifications.put("PPW", "GLY");
2219 modifications.put("PQ1", "ASN");
2220 modifications.put("PR3", "CYS");
2221 modifications.put("PR5", "ALA");
2222 modifications.put("PR9", "PRO");
2223 modifications.put("PRN", "ALA");
2224 modifications.put("PRO", "PRO");
2225 modifications.put("PRS", "PRO");
2226 modifications.put("PSA", "PHE");
2227 modifications.put("PSH", "HIS");
2228 modifications.put("PST", "THR");
2229 modifications.put("PSU", "UR3");
2230 modifications.put("PSW", "CYS");
2231 modifications.put("PTA", "XAA");
2232 modifications.put("PTH", "TYR");
2233 modifications.put("PTM", "TYR");
2234 modifications.put("PTR", "TYR");
2235 modifications.put("PU ", "ALA");
2236 modifications.put("PUY", "ASN");
2237 modifications.put("PVH", "HIS");
2238 modifications.put("PVL", "XAA");
2239 modifications.put("PYA", "ALA");
2240 modifications.put("PYO", "UR3");
2241 modifications.put("PYX", "CYS");
2242 modifications.put("PYY", "ASN");
2243 modifications.put("QLG", "QLG");
2244 modifications.put("QMM", "GLN");
2245 modifications.put("QPA", "CYS");
2246 modifications.put("QPH", "PHE");
2247 modifications.put("QUO", "GLY");
2248 modifications.put("R ", "ALA");
2249 modifications.put("R1A", "CYS");
2250 modifications.put("R4K", "TRP");
2251 modifications.put("RC7", "HYG");
2252 modifications.put("RE0", "TRP");
2253 modifications.put("RE3", "TRP");
2254 modifications.put("RIA", "ALA");
2255 modifications.put("RMP", "ALA");
2256 modifications.put("RON", "XAA");
2257 modifications.put("RT ", "THR");
2258 modifications.put("RTP", "ASN");
2259 modifications.put("S1H", "SER");
2260 modifications.put("S2C", "CYS");
2261 modifications.put("S2D", "ALA");
2262 modifications.put("S2M", "THR");
2263 modifications.put("S2P", "ALA");
2264 modifications.put("S4A", "ALA");
2265 modifications.put("S4C", "CYS");
2266 modifications.put("S4G", "GLY");
2267 modifications.put("S4U", "UR3");
2268 modifications.put("S6G", "GLY");
2269 modifications.put("SAC", "SER");
2270 modifications.put("SAH", "CYS");
2271 modifications.put("SAR", "GLY");
2272 modifications.put("SBL", "SER");
2273 modifications.put("SC ", "CYS");
2274 modifications.put("SCH", "CYS");
2275 modifications.put("SCS", "CYS");
2276 modifications.put("SCY", "CYS");
2277 modifications.put("SD2", "XAA");
2278 modifications.put("SDG", "GLY");
2279 modifications.put("SDP", "SER");
2280 modifications.put("SEB", "SER");
2281 modifications.put("SEC", "ALA");
2282 modifications.put("SEG", "ALA");
2283 modifications.put("SEL", "SER");
2284 modifications.put("SEM", "SER");
2285 modifications.put("SEN", "SER");
2286 modifications.put("SEP", "SER");
2287 modifications.put("SER", "SER");
2288 modifications.put("SET", "SER");
2289 modifications.put("SGB", "SER");
2290 modifications.put("SHC", "CYS");
2291 modifications.put("SHP", "GLY");
2292 modifications.put("SHR", "LYS");
2293 modifications.put("SIB", "CYS");
2294 modifications.put("SIC", "DC"); // check
2295 modifications.put("SLA", "PRO");
2296 modifications.put("SLR", "PRO");
2297 modifications.put("SLZ", "LYS");
2298 modifications.put("SMC", "CYS");
2299 modifications.put("SME", "MET");
2300 modifications.put("SMF", "PHE");
2301 modifications.put("SMP", "ALA");
2302 modifications.put("SMT", "THR");
2303 modifications.put("SNC", "CYS");
2304 modifications.put("SNN", "ASN");
2305 modifications.put("SOC", "CYS");
2306 modifications.put("SOS", "ASN");
2307 modifications.put("SOY", "SER");
2308 modifications.put("SPT", "THR");
2309 modifications.put("SRA", "ALA");
2310 modifications.put("SSU", "UR3");
2311 modifications.put("STY", "TYR");
2312 modifications.put("SUB", "XAA");
2313 modifications.put("SUI", "DG");
2314 modifications.put("SUN", "SER");
2315 modifications.put("SUR", "UR3");
2316 modifications.put("SVA", "SER");
2317 modifications.put("SVV", "SER");
2318 modifications.put("SVW", "SER");
2319 modifications.put("SVX", "SER");
2320 modifications.put("SVY", "SER");
2321 modifications.put("SVZ", "XAA");
2322 modifications.put("SWG", "SWG");
2323 modifications.put("SYS", "CYS");
2324 modifications.put("T ", "THR");
2325 modifications.put("T11", "PHE");
2326 modifications.put("T23", "THR");
2327 modifications.put("T2S", "THR");
2328 modifications.put("T2T", "ASN");
2329 modifications.put("T31", "UR3");
2330 modifications.put("T32", "THR");
2331 modifications.put("T36", "THR");
2332 modifications.put("T37", "THR");
2333 modifications.put("T38", "THR");
2334 modifications.put("T39", "THR");
2335 modifications.put("T3P", "THR");
2336 modifications.put("T41", "THR");
2337 modifications.put("T48", "THR");
2338 modifications.put("T49", "THR");
2339 modifications.put("T4S", "THR");
2340 modifications.put("T5O", "UR3");
2341 modifications.put("T5S", "THR");
2342 modifications.put("T66", "XAA");
2343 modifications.put("T6A", "ALA");
2344 modifications.put("TA3", "THR");
2345 modifications.put("TA4", "XAA");
2346 modifications.put("TAF", "THR");
2347 modifications.put("TAL", "ASN");
2348 modifications.put("TAV", "ASP");
2349 modifications.put("TBG", "VAL");
2350 modifications.put("TBM", "THR");
2351 modifications.put("TC1", "CYS");
2352 modifications.put("TCP", "THR");
2353 modifications.put("TCQ", "TYR");
2354 modifications.put("TCR", "TRP");
2355 modifications.put("TCY", "ALA");
2356 modifications.put("TDD", "LEU");
2357 modifications.put("TDY", "THR");
2358 modifications.put("TFE", "THR");
2359 modifications.put("TFO", "ALA");
2360 modifications.put("TFQ", "PHE");
2361 modifications.put("TFT", "THR");
2362 modifications.put("TGP", "GLY");
2363 modifications.put("TH6", "THR");
2364 modifications.put("THC", "THR");
2365 modifications.put("THO", "XAA");
2366 modifications.put("THR", "THR");
2367 modifications.put("THX", "ASN");
2368 modifications.put("THZ", "ARG");
2369 modifications.put("TIH", "ALA");
2370 modifications.put("TLB", "ASN");
2371 modifications.put("TLC", "THR");
2372 modifications.put("TLN", "UR3");
2373 modifications.put("TMB", "THR");
2374 modifications.put("TMD", "THR");
2375 modifications.put("TNB", "CYS");
2376 modifications.put("TNR", "SER");
2377 modifications.put("TOX", "TRP");
2378 modifications.put("TP1", "THR");
2379 modifications.put("TPC", "CYS");
2380 modifications.put("TPG", "GLY");
2381 modifications.put("TPH", "XAA");
2382 modifications.put("TPL", "TRP");
2383 modifications.put("TPO", "THR");
2384 modifications.put("TPQ", "TYR");
2385 modifications.put("TQI", "TRP");
2386 modifications.put("TQQ", "TRP");
2387 modifications.put("TRF", "TRP");
2388 modifications.put("TRG", "LYS");
2389 modifications.put("TRN", "TRP");
2390 modifications.put("TRO", "TRP");
2391 modifications.put("TRP", "TRP");
2392 modifications.put("TRQ", "TRP");
2393 modifications.put("TRW", "TRP");
2394 modifications.put("TRX", "TRP");
2395 modifications.put("TS ", "ASN");
2396 modifications.put("TST", "XAA");
2397 modifications.put("TT ", "ASN");
2398 modifications.put("TTD", "THR");
2399 modifications.put("TTI", "UR3");
2400 modifications.put("TTM", "THR");
2401 modifications.put("TTQ", "TRP");
2402 modifications.put("TTS", "TYR");
2403 modifications.put("TY1", "TYR");
2404 modifications.put("TY2", "TYR");
2405 modifications.put("TY3", "TYR");
2406 modifications.put("TY5", "TYR");
2407 modifications.put("TYB", "TYR");
2408 modifications.put("TYI", "TYR");
2409 modifications.put("TYJ", "TYR");
2410 modifications.put("TYN", "TYR");
2411 modifications.put("TYO", "TYR");
2412 modifications.put("TYQ", "TYR");
2413 modifications.put("TYR", "TYR");
2414 modifications.put("TYS", "TYR");
2415 modifications.put("TYT", "TYR");
2416 modifications.put("TYU", "ASN");
2417 modifications.put("TYW", "TYR");
2418 modifications.put("TYX", "XAA");
2419 modifications.put("TYY", "TYR");
2420 modifications.put("TZB", "XAA");
2421 modifications.put("TZO", "XAA");
2422 modifications.put("U ", "UR3");
2423 modifications.put("U25", "UR3");
2424 modifications.put("U2L", "UR3");
2425 modifications.put("U2N", "UR3");
2426 modifications.put("U2P", "UR3");
2427 modifications.put("U31", "UR3");
2428 modifications.put("U33", "UR3");
2429 modifications.put("U34", "UR3");
2430 modifications.put("U36", "UR3");
2431 modifications.put("U37", "UR3");
2432 modifications.put("U8U", "UR3");
2433 modifications.put("UAR", "UR3");
2434 modifications.put("UCL", "UR3");
2435 modifications.put("UD5", "UR3");
2436 modifications.put("UDP", "ASN");
2437 modifications.put("UFP", "ASN");
2438 modifications.put("UFR", "UR3");
2439 modifications.put("UFT", "UR3");
2440 modifications.put("UMA", "ALA");
2441 modifications.put("UMP", "UR3");
2442 modifications.put("UMS", "UR3");
2443 modifications.put("UN1", "XAA");
2444 modifications.put("UN2", "XAA");
2445 modifications.put("UNK", "XAA");
2446 modifications.put("UR3", "UR3");
2447 modifications.put("URD", "UR3");
2448 modifications.put("US1", "UR3");
2449 modifications.put("US2", "UR3");
2450 modifications.put("US3", "THR");
2451 modifications.put("US5", "UR3");
2452 modifications.put("USM", "UR3");
2453 modifications.put("VAD", "VAL");
2454 modifications.put("VAF", "VAL");
2455 modifications.put("VAL", "VAL");
2456 modifications.put("VB1", "LYS");
2457 modifications.put("VDL", "XAA");
2458 modifications.put("VLL", "XAA");
2459 modifications.put("VLM", "XAA");
2460 modifications.put("VMS", "XAA");
2461 modifications.put("VOL", "XAA");
2462 modifications.put("WCR", "GYG");
2463 modifications.put("X ", "GLY");
2464 modifications.put("X2W", "GLU");
2465 modifications.put("X4A", "ASN");
2466 modifications.put("X9Q", "AFG");
2467 modifications.put("XAD", "ALA");
2468 modifications.put("XAE", "ASN");
2469 modifications.put("XAL", "ALA");
2470 modifications.put("XAR", "ASN");
2471 modifications.put("XCL", "CYS");
2472 modifications.put("XCN", "CYS");
2473 modifications.put("XCP", "XAA");
2474 modifications.put("XCR", "CYS");
2475 modifications.put("XCS", "ASN");
2476 modifications.put("XCT", "CYS");
2477 modifications.put("XCY", "CYS");
2478 modifications.put("XGA", "ASN");
2479 modifications.put("XGL", "GLY");
2480 modifications.put("XGR", "GLY");
2481 modifications.put("XGU", "GLY");
2482 modifications.put("XPR", "PRO");
2483 modifications.put("XSN", "ASN");
2484 modifications.put("XTH", "THR");
2485 modifications.put("XTL", "THR");
2486 modifications.put("XTR", "THR");
2487 modifications.put("XTS", "GLY");
2488 modifications.put("XTY", "ASN");
2489 modifications.put("XUA", "ALA");
2490 modifications.put("XUG", "GLY");
2491 modifications.put("XX1", "LYS");
2492 modifications.put("XXY", "THG");
2493 modifications.put("XYG", "DYG");
2494 modifications.put("Y ", "ALA");
2495 modifications.put("YCM", "CYS");
2496 modifications.put("YG ", "GLY");
2497 modifications.put("YOF", "TYR");
2498 modifications.put("YRR", "ASN");
2499 modifications.put("YYG", "GLY");
2500 modifications.put("Z ", "CYS");
2501 modifications.put("Z01", "ALA");
2502 modifications.put("ZAD", "ALA");
2503 modifications.put("ZAL", "ALA");
2504 modifications.put("ZBC", "CYS");
2505 modifications.put("ZBU", "UR3");
2506 modifications.put("ZCL", "PHE");
2507 modifications.put("ZCY", "CYS");
2508 modifications.put("ZDU", "UR3");
2509 modifications.put("ZFB", "XAA");
2510 modifications.put("ZGU", "GLY");
2511 modifications.put("ZHP", "ASN");
2512 modifications.put("ZTH", "THR");
2513 modifications.put("ZU0", "THR");
2514 modifications.put("ZZJ", "ALA");
2518 public static String getCanonicalAminoAcid(String aA)
2520 String canonical = modifications.get(aA);
2521 return canonical == null ? aA : canonical;
2524 // main method generates perl representation of residue property hash
2526 public static void main(String[] args)
2528 Hashtable<String, Vector<String>> aaProps = new Hashtable<String, Vector<String>>();
2529 System.out.println("my %aa = {");
2530 // invert property hashes
2531 for (String pname : propHash.keySet())
2533 Map<String, Integer> phash = propHash.get(pname);
2534 for (String rname : phash.keySet())
2536 Vector<String> aprops = aaProps.get(rname);
2539 aprops = new Vector<String>();
2540 aaProps.put(rname, aprops);
2542 Integer hasprop = phash.get(rname);
2543 if (hasprop.intValue() == 1)
2545 aprops.addElement(pname);
2549 Enumeration<String> res = aaProps.keys();
2550 while (res.hasMoreElements())
2552 String rname = res.nextElement();
2554 System.out.print("'" + rname + "' => [");
2555 Enumeration<String> props = aaProps.get(rname).elements();
2556 while (props.hasMoreElements())
2558 System.out.print("'" + props.nextElement() + "'");
2559 if (props.hasMoreElements())
2561 System.out.println(", ");
2564 System.out.println("]" + (res.hasMoreElements() ? "," : ""));
2566 System.out.println("};");
2572 * Returns a list of residue characters for the specified inputs
2574 * @param forNucleotide
2575 * @param includeAmbiguous
2578 public static List<String> getResidues(boolean forNucleotide,
2579 boolean includeAmbiguous)
2581 List<String> result = new ArrayList<String>();
2584 for (String nuc : nucleotideName.keySet())
2586 int val = nucleotideIndex[nuc.charAt(0)];
2587 if ((!includeAmbiguous && val > 4) || (val >= maxNucleotideIndex))
2591 nuc = nuc.toUpperCase();
2592 if (!result.contains(nuc))
2603 for (String res : aa3Hash.keySet())
2605 int index = aa3Hash.get(res).intValue();
2606 if ((!includeAmbiguous && index >= 20) || index >= maxProteinIndex)
2610 res = res.toUpperCase();
2611 if (!result.contains(res))
2622 * Returns the single letter code for a three letter code, or '0' if not known
2624 * @param threeLetterCode
2625 * not case sensitive
2628 public static char getSingleCharacterCode(String threeLetterCode)
2630 if (threeLetterCode == null)
2634 Integer index = ResidueProperties.aa3Hash
2635 .get(threeLetterCode.toUpperCase());
2636 return index == null ? '0' : aa[index].charAt(0);