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;
30 import java.util.Locale;
32 import java.util.Vector;
34 import jalview.analysis.GeneticCodes;
36 public class ResidueProperties
38 // Stores residue codes/names and colours and other things
39 public static final int[] aaIndex; // aaHash version 2.1.1 and below
41 public static final int[] nucleotideIndex;
43 public static final int[] purinepyrimidineIndex;
45 public static final Map<String, Integer> aa3Hash = new HashMap<>();
47 public static final Map<String, String> aa2Triplet = new HashMap<>();
49 public static final Map<String, String> nucleotideName = new HashMap<>();
51 public static final Map<String, String> nucleotideAmbiguityName = new HashMap<>();
53 // lookup from modified amino acid (e.g. MSE) to canonical form (e.g. MET)
54 public static final Map<String, String> modifications = new HashMap<>();
58 aaIndex = new int[255];
59 for (int i = 0; i < 255; i++)
111 aaIndex['u'] = 22; // TODO: selenocystine triplet and codons needed. also
112 // extend subt. matrices
116 * maximum (gap) index for matrices involving protein alphabet
118 public final static int maxProteinIndex = 23;
121 * maximum (gap) index for matrices involving nucleotide alphabet
123 // public final static int maxNucleotideIndex = 10;
124 public final static int maxNucleotideIndex;
128 String[][] namesArray = { { "a", "Adenine" }, { "c", "Cytosine" },
134 { "r", "Unknown Purine" },
135 { "y", "Unknown Pyrimidine" },
136 { "w", "Weak nucleotide (A or T)" },
137 { "s", "Strong nucleotide (G or C)" },
138 { "m", "Amino (A or C)" },
139 { "k", "Keto (G or T)" },
140 { "b", "Not A (G or C or T)" },
141 { "h", "Not G (A or C or T)" },
142 { "d", "Not C (A or G or T)" },
143 { "v", "Not T (A or G or C)" },
144 { "n", "Unknown" } };
146 maxNucleotideIndex = namesArray.length;
148 nucleotideIndex = new int[255];
149 for (int i = 0; i < 255; i++)
151 nucleotideIndex[i] = maxNucleotideIndex; // non-nucleotide symbols are all
155 for (int i = 0; i < namesArray.length; i++)
157 char c = namesArray[i][0].charAt(0);
158 nucleotideIndex[c] = i;
159 // Character.toUpperCase is Locale insensitive
160 nucleotideIndex[Character.toUpperCase(c)] = i;
161 nucleotideName.put(namesArray[i][0], namesArray[i][1]);
162 nucleotideName.put(namesArray[i][0].toUpperCase(Locale.ROOT),
170 purinepyrimidineIndex = new int[255];
171 for (int i = 0; i < 255; i++)
173 purinepyrimidineIndex[i] = 3; // non-nucleotide symbols are all non-gap
177 purinepyrimidineIndex['A'] = 0;
178 purinepyrimidineIndex['a'] = 0;
179 purinepyrimidineIndex['C'] = 1;
180 purinepyrimidineIndex['c'] = 1;
181 purinepyrimidineIndex['G'] = 0;
182 purinepyrimidineIndex['g'] = 0;
183 purinepyrimidineIndex['T'] = 1;
184 purinepyrimidineIndex['t'] = 1;
185 purinepyrimidineIndex['U'] = 1;
186 purinepyrimidineIndex['u'] = 1;
187 purinepyrimidineIndex['I'] = 2;
188 purinepyrimidineIndex['i'] = 2;
189 purinepyrimidineIndex['X'] = 2;
190 purinepyrimidineIndex['x'] = 2;
191 purinepyrimidineIndex['R'] = 0;
192 purinepyrimidineIndex['r'] = 0;
193 purinepyrimidineIndex['Y'] = 1;
194 purinepyrimidineIndex['y'] = 1;
195 purinepyrimidineIndex['N'] = 2;
196 purinepyrimidineIndex['n'] = 2;
199 private static final Integer ONE = Integer.valueOf(1);
201 private static final Integer ZERO = Integer.valueOf(0);
205 aa3Hash.put("ALA", ZERO);
206 aa3Hash.put("ARG", ONE);
207 aa3Hash.put("ASN", Integer.valueOf(2));
208 aa3Hash.put("ASP", Integer.valueOf(3)); // D
209 aa3Hash.put("CYS", Integer.valueOf(4));
210 aa3Hash.put("GLN", Integer.valueOf(5)); // Q
211 aa3Hash.put("GLU", Integer.valueOf(6)); // E
212 aa3Hash.put("GLY", Integer.valueOf(7));
213 aa3Hash.put("HIS", Integer.valueOf(8));
214 aa3Hash.put("ILE", Integer.valueOf(9));
215 aa3Hash.put("LEU", Integer.valueOf(10));
216 aa3Hash.put("LYS", Integer.valueOf(11));
217 aa3Hash.put("MET", Integer.valueOf(12));
218 aa3Hash.put("PHE", Integer.valueOf(13));
219 aa3Hash.put("PRO", Integer.valueOf(14));
220 aa3Hash.put("SER", Integer.valueOf(15));
221 aa3Hash.put("THR", Integer.valueOf(16));
222 aa3Hash.put("TRP", Integer.valueOf(17));
223 aa3Hash.put("TYR", Integer.valueOf(18));
224 aa3Hash.put("VAL", Integer.valueOf(19));
225 // IUB Nomenclature for ambiguous peptides
226 aa3Hash.put("ASX", Integer.valueOf(20)); // "B";
227 aa3Hash.put("GLX", Integer.valueOf(21)); // Z
228 aa3Hash.put("XAA", Integer.valueOf(22)); // X unknown
229 aa3Hash.put("-", Integer.valueOf(23));
230 aa3Hash.put("*", Integer.valueOf(23));
231 aa3Hash.put(".", Integer.valueOf(23));
232 aa3Hash.put(" ", Integer.valueOf(23));
233 aa3Hash.put("Gap", Integer.valueOf(23));
234 aa3Hash.put("UR3", Integer.valueOf(24));
239 aa2Triplet.put("A", "ALA");
240 aa2Triplet.put("a", "ALA");
241 aa2Triplet.put("R", "ARG");
242 aa2Triplet.put("r", "ARG");
243 aa2Triplet.put("N", "ASN");
244 aa2Triplet.put("n", "ASN");
245 aa2Triplet.put("D", "ASP");
246 aa2Triplet.put("d", "ASP");
247 aa2Triplet.put("C", "CYS");
248 aa2Triplet.put("c", "CYS");
249 aa2Triplet.put("Q", "GLN");
250 aa2Triplet.put("q", "GLN");
251 aa2Triplet.put("E", "GLU");
252 aa2Triplet.put("e", "GLU");
253 aa2Triplet.put("G", "GLY");
254 aa2Triplet.put("g", "GLY");
255 aa2Triplet.put("H", "HIS");
256 aa2Triplet.put("h", "HIS");
257 aa2Triplet.put("I", "ILE");
258 aa2Triplet.put("i", "ILE");
259 aa2Triplet.put("L", "LEU");
260 aa2Triplet.put("l", "LEU");
261 aa2Triplet.put("K", "LYS");
262 aa2Triplet.put("k", "LYS");
263 aa2Triplet.put("M", "MET");
264 aa2Triplet.put("m", "MET");
265 aa2Triplet.put("F", "PHE");
266 aa2Triplet.put("f", "PHE");
267 aa2Triplet.put("P", "PRO");
268 aa2Triplet.put("p", "PRO");
269 aa2Triplet.put("S", "SER");
270 aa2Triplet.put("s", "SER");
271 aa2Triplet.put("T", "THR");
272 aa2Triplet.put("t", "THR");
273 aa2Triplet.put("W", "TRP");
274 aa2Triplet.put("w", "TRP");
275 aa2Triplet.put("Y", "TYR");
276 aa2Triplet.put("y", "TYR");
277 aa2Triplet.put("V", "VAL");
278 aa2Triplet.put("v", "VAL");
281 public static final String[] aa = { "A", "R", "N", "D", "C", "Q", "E",
282 "G", "H", "I", "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V", "B",
283 "Z", "X", "_", "*", ".", " ", "U" };
285 public static final Color midBlue = new Color(100, 100, 255);
287 // not currently in use
288 // public static final Vector<Color> scaleColours = new Vector<Color>();
291 // scaleColours.addElement(new Color(114, 0, 147));
292 // scaleColours.addElement(new Color(156, 0, 98));
293 // scaleColours.addElement(new Color(190, 0, 0));
294 // scaleColours.addElement(Color.red);
295 // scaleColours.addElement(new Color(255, 125, 0));
296 // scaleColours.addElement(Color.orange);
297 // scaleColours.addElement(new Color(255, 194, 85));
298 // scaleColours.addElement(Color.yellow);
299 // scaleColours.addElement(new Color(255, 255, 181));
300 // scaleColours.addElement(Color.white);
303 public static final Color[] taylor = { new Color(204, 255, 0),
304 // A Greenish-yellowy-yellow
305 new Color(0, 0, 255), // R Blueish-bluey-blue
306 new Color(204, 0, 255), // N Blueish-reddy-blue
307 new Color(255, 0, 0), // D Reddish-reddy-red
308 new Color(255, 255, 0), // C Yellowish-yellowy-yellow
309 new Color(255, 0, 204), // Q Reddish-bluey-red
310 new Color(255, 0, 102), // E Blueish-reddy-red
311 new Color(255, 153, 0), // G Yellowy-reddy-yellow
312 new Color(0, 102, 255), // H Greenish-bluey-blue
313 new Color(102, 255, 0), // I Greenish-yellowy-green
314 new Color(51, 255, 0), // L Yellowish-greeny-green
315 new Color(102, 0, 255), // K Reddish-bluey-blue
316 new Color(0, 255, 0), // M Greenish-greeny-green
317 new Color(0, 255, 102), // F Blueish-greeny-green
318 new Color(255, 204, 0), // P Reddish-yellowy-yellow
319 new Color(255, 51, 0), // S Yellowish-reddy-red
320 new Color(255, 102, 0), // T Reddish-yellowy-red
321 new Color(0, 204, 255), // W Blueish-greeny-green
322 new Color(0, 255, 204), // Y Greenish-bluey-green
323 new Color(153, 255, 0), // V Yellowish-greeny-yellow
332 public static final Color[] nucleotide = { new Color(100, 247, 63), // A
333 new Color(255, 179, 64), // C
334 new Color(235, 65, 60), // G
335 new Color(60, 136, 238), // T
336 new Color(60, 136, 238), // U
337 Color.white, // I (inosine)
338 Color.white, // X (xanthine)
353 // this colour scheme devised by sduce
354 public static final Color[] nucleotideAmbiguity = {
355 Color.decode("#f0fff0"), // a
356 Color.decode("#f0fff0"), // c
357 Color.decode("#f0fff0"), // g
358 Color.decode("#f0fff0"), // t
359 Color.decode("#f0fff0"), // u
360 Color.decode("#ffffff"), // i
361 Color.decode("#4f6f6f"), // x
362 Color.decode("#CD5C5C"), // r
363 Color.decode("#008000"), // y
364 Color.decode("#4682B4"), // w
365 Color.decode("#FF8C00"), // s
366 Color.decode("#9ACD32"), // m
367 Color.decode("#9932CC"), // k
368 Color.decode("#8b4513"), // b
369 Color.decode("#808080"), // h
370 Color.decode("#483D8B"), // d
371 Color.decode("#b8860b"), // v
372 Color.decode("#2f4f4f"), // n
376 // Added for PurinePyrimidineColourScheme
377 public static final Color[] purinepyrimidine = { new Color(255, 131, 250), // A,
382 new Color(64, 224, 208), // C,U, T, Y pyrimidines turquoise
383 Color.white, // all other nucleotides
388 public static final Color[] zappo = { Color.pink, // A
396 midBlue, // Color.red, // H
418 * flower, blossom, sunset, ocean colour schemes from geocos.
419 * See https://gecos.biotite-python.org/
420 * https://raw.githubusercontent.com/biotite-dev/biotite/master/src/biotite/sequence/graphics/color_schemes/flower.json
421 * and https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-020-3526-6
422 * (https://doi.org/10.1186/s12859-020-3526-6)
424 public static final Color[] flower = { new Color(177, 138, 81), // A
425 new Color(131, 191, 241), // R
426 new Color(11, 206, 198), // N
427 new Color(1, 165, 120), // D
428 new Color(255, 87, 1), // C
429 new Color(114, 149, 174), // Q
430 new Color(45, 160, 161), // E
431 new Color(177, 194, 60), // G
432 new Color(1, 148, 249), // H
433 new Color(242, 118, 99), // I
434 new Color(223, 110, 117), // L
435 new Color(127, 195, 215), // K
436 new Color(254, 157, 175), // M
437 new Color(250, 85, 157), // F
438 new Color(79, 163, 42), // P
439 new Color(180, 189, 155), // S
440 new Color(210, 181, 118), // T
441 new Color(255, 45, 237), // W
442 new Color(201, 110, 207), // Y
443 new Color(253, 153, 123), // V
452 public static final Color[] blossom = { new Color(139, 196, 180), // A
453 new Color(252, 149, 2), // R
454 new Color(181, 194, 6), // N
455 new Color(95, 165, 5), // D
456 new Color(8, 147, 254), // C
457 new Color(191, 133, 39), // Q
458 new Color(219, 181, 1), // E
459 new Color(0, 211, 130), // G
460 new Color(255, 87, 1), // H
461 new Color(154, 186, 243), // I
462 new Color(205, 165, 220), // L
463 new Color(254, 165, 39), // K
464 new Color(245, 161, 184), // M
465 new Color(247, 79, 168), // F
466 new Color(16, 214, 49), // P
467 new Color(126, 157, 89), // S
468 new Color(0, 162, 156), // T
469 new Color(254, 8, 251), // W
470 new Color(255, 78, 122), // Y
471 new Color(135, 192, 228), // V
480 public static final Color[] sunset = { new Color(254, 160, 253), // A
481 new Color(133, 116, 106), // R
482 new Color(171, 200, 245), // N
483 new Color(46, 123, 190), // D
484 new Color(252, 12, 254), // C
485 new Color(140, 110, 129), // Q
486 new Color(103, 120, 146), // E
487 new Color(39, 153, 255), // G
488 new Color(219, 197, 142), // H
489 new Color(250, 33, 161), // I
490 new Color(224, 30, 130), // L
491 new Color(222, 190, 204), // K
492 new Color(209, 62, 123), // M
493 new Color(255, 56, 93), // F
494 new Color(87, 102, 249), // P
495 new Color(231, 180, 253), // S
496 new Color(166, 88, 183), // T
497 new Color(255, 55, 1), // W
498 new Color(203, 83, 57), // Y
499 new Color(254, 81, 184), // V
508 public static final Color[] ocean = { new Color(198, 202, 155), // A
509 new Color(12, 160, 168), // R
510 new Color(10, 223, 195), // N
511 new Color(76, 223, 161), // D
512 new Color(198, 129, 54), // C
513 new Color(139, 211, 209), // Q
514 new Color(96, 218, 201), // E
515 new Color(51, 165, 81), // G
516 new Color(0, 207, 254), // H
517 new Color(242, 186, 170), // I
518 new Color(187, 138, 131), // L
519 new Color(64, 160, 144), // K
520 new Color(164, 139, 136), // M
521 new Color(171, 136, 174), // F
522 new Color(175, 211, 101), // P
523 new Color(109, 155, 116), // S
524 new Color(141, 149, 102), // T
525 new Color(117, 138, 238), // W
526 new Color(186, 195, 252), // Y
527 new Color(233, 190, 164), // V
536 // Dunno where I got these numbers from
537 public static final double[] hyd2 = { 0.62, // A
562 public static final double[] helix = { 1.42, 0.98, 0.67, 1.01, 0.70, 1.11,
563 1.51, 0.57, 1.00, 1.08, 1.21, 1.16, 1.45, 1.13, 0.57, 0.77, 0.83,
564 1.08, 0.69, 1.06, 0.84, 1.31, 1.00, 0.0 };
566 public static final double helixmin = 0.57;
568 public static final double helixmax = 1.51;
570 public static final double[] strand = { 0.83, 0.93, 0.89, 0.54, 1.19,
571 1.10, 0.37, 0.75, 0.87, 1.60, 1.30, 0.74, 1.05, 1.38, 0.55, 0.75,
572 1.19, 1.37, 1.47, 1.70, 0.72, 0.74, 1.0, 0.0 };
574 public static final double strandmin = 0.37;
576 public static final double strandmax = 1.7;
578 public static final double[] turn = { 0.66, 0.95, 1.56, 1.46, 1.19, 0.98,
579 0.74, 1.56, 0.95, 0.47, 0.59, 1.01, 0.60, 0.60, 1.52, 1.43, 0.96,
580 0.96, 1.14, 0.50, 1.51, 0.86, 1.00, 0, 0 };
582 public static final double turnmin = 0.47;
584 public static final double turnmax = 1.56;
586 public static final double[] buried = { 1.7, 0.1, 0.4, 0.4, 4.6, 0.3, 0.3,
587 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,
590 public static final double buriedmin = 0.05;
592 public static final double buriedmax = 4.6;
594 // This is hydropathy index
595 // Kyte, J., and Doolittle, R.F., J. Mol. Biol.
596 // 1157, 105-132, 1982
597 public static final double[] hyd = { 1.8, -4.5, -3.5, -3.5, 2.5, -3.5,
598 -3.5, -0.4, -3.2, 4.5, 3.8, -3.9, 1.9, 2.8, -1.6, -0.8, -0.7, -0.9,
599 -1.3, 4.2, -3.5, -3.5, -0.49, 0.0 };
601 public static final double hydmax = 4.5;
603 public static final double hydmin = -3.9;
605 // public static final double hydmax = 1.38;
606 // public static final double hydmin = -2.53;
608 // not currently used
609 // public static final Map<String, Color> ssHash = new Hashtable<String,
613 // ssHash.put("H", Color.magenta);
614 // ssHash.put("E", Color.yellow);
615 // ssHash.put("-", Color.white);
616 // ssHash.put(".", Color.white);
617 // ssHash.put("S", Color.cyan);
618 // ssHash.put("T", Color.blue);
619 // ssHash.put("G", Color.pink);
620 // ssHash.put("I", Color.pink);
621 // ssHash.put("B", Color.yellow);
625 * new Color(60, 136, 238), // U Color.white, // I Color.white, // X
626 * Color.white, // R Color.white, // Y Color.white, // N Color.white, // Gap
629 public static String STOP = "STOP";
631 public static List<String> STOP_CODONS = Arrays.asList("TGA", "TAA",
634 public static String START = "ATG";
636 // Stores residue codes/names and colours and other things
637 public static Map<String, Map<String, Integer>> propHash = new Hashtable<>();
639 public static Map<String, Integer> hydrophobic = new Hashtable<>();
641 public static Map<String, Integer> polar = new Hashtable<>();
643 public static Map<String, Integer> small = new Hashtable<>();
645 public static Map<String, Integer> positive = new Hashtable<>();
647 public static Map<String, Integer> negative = new Hashtable<>();
649 public static Map<String, Integer> charged = new Hashtable<>();
651 public static Map<String, Integer> aromatic = new Hashtable<>();
653 public static Map<String, Integer> aliphatic = new Hashtable<>();
655 public static Map<String, Integer> tiny = new Hashtable<>();
657 public static Map<String, Integer> proline = new Hashtable<>();
661 hydrophobic.put("I", ONE);
662 hydrophobic.put("L", ONE);
663 hydrophobic.put("V", ONE);
664 hydrophobic.put("C", ONE);
665 hydrophobic.put("A", ONE);
666 hydrophobic.put("G", ONE);
667 hydrophobic.put("M", ONE);
668 hydrophobic.put("F", ONE);
669 hydrophobic.put("Y", ONE);
670 hydrophobic.put("W", ONE);
671 hydrophobic.put("H", ONE);
672 hydrophobic.put("K", ONE);
673 hydrophobic.put("X", ONE);
674 hydrophobic.put("-", ONE);
675 hydrophobic.put("*", ONE);
676 hydrophobic.put("R", ZERO);
677 hydrophobic.put("E", ZERO);
678 hydrophobic.put("Q", ZERO);
679 hydrophobic.put("D", ZERO);
680 hydrophobic.put("N", ZERO);
681 hydrophobic.put("S", ZERO);
682 hydrophobic.put("T", ONE);
683 hydrophobic.put("P", ZERO);
702 polar.put("I", ZERO);
703 polar.put("L", ZERO);
704 polar.put("V", ZERO);
705 polar.put("C", ZERO);
706 polar.put("A", ZERO);
707 polar.put("G", ZERO);
708 polar.put("M", ZERO);
709 polar.put("F", ZERO);
710 polar.put("P", ZERO);
715 small.put("I", ZERO);
716 small.put("L", ZERO);
721 small.put("M", ZERO);
722 small.put("F", ZERO);
723 small.put("Y", ZERO);
724 small.put("W", ZERO);
725 small.put("H", ZERO);
726 small.put("K", ZERO);
727 small.put("R", ZERO);
728 small.put("E", ZERO);
729 small.put("Q", ZERO);
741 positive.put("I", ZERO);
742 positive.put("L", ZERO);
743 positive.put("V", ZERO);
744 positive.put("C", ZERO);
745 positive.put("A", ZERO);
746 positive.put("G", ZERO);
747 positive.put("M", ZERO);
748 positive.put("F", ZERO);
749 positive.put("Y", ZERO);
750 positive.put("W", ZERO);
751 positive.put("H", ONE);
752 positive.put("K", ONE);
753 positive.put("R", ONE);
754 positive.put("E", ZERO);
755 positive.put("Q", ZERO);
756 positive.put("D", ZERO);
757 positive.put("N", ZERO);
758 positive.put("S", ZERO);
759 positive.put("T", ZERO);
760 positive.put("P", ZERO);
761 positive.put("-", ONE);
762 positive.put("*", ONE);
767 negative.put("I", ZERO);
768 negative.put("L", ZERO);
769 negative.put("V", ZERO);
770 negative.put("C", ZERO);
771 negative.put("A", ZERO);
772 negative.put("G", ZERO);
773 negative.put("M", ZERO);
774 negative.put("F", ZERO);
775 negative.put("Y", ZERO);
776 negative.put("W", ZERO);
777 negative.put("H", ZERO);
778 negative.put("K", ZERO);
779 negative.put("R", ZERO);
780 negative.put("E", ONE);
781 negative.put("Q", ZERO);
782 negative.put("D", ONE);
783 negative.put("N", ZERO);
784 negative.put("S", ZERO);
785 negative.put("T", ZERO);
786 negative.put("P", ZERO);
787 negative.put("-", ONE);
788 negative.put("*", ONE);
793 charged.put("I", ZERO);
794 charged.put("L", ZERO);
795 charged.put("V", ZERO);
796 charged.put("C", ZERO);
797 charged.put("A", ZERO);
798 charged.put("G", ZERO);
799 charged.put("M", ZERO);
800 charged.put("F", ZERO);
801 charged.put("Y", ZERO);
802 charged.put("W", ZERO);
803 charged.put("H", ONE);
804 charged.put("K", ONE);
805 charged.put("R", ONE);
806 charged.put("E", ONE);
807 charged.put("Q", ZERO);
808 charged.put("D", ONE);
809 charged.put("N", ZERO); // Asparagine is polar but not
811 // Alternative would be charged and
812 // negative (in basic form)?
813 charged.put("S", ZERO);
814 charged.put("T", ZERO);
815 charged.put("P", ZERO);
816 charged.put("-", ONE);
817 charged.put("*", ONE);
822 aromatic.put("I", ZERO);
823 aromatic.put("L", ZERO);
824 aromatic.put("V", ZERO);
825 aromatic.put("C", ZERO);
826 aromatic.put("A", ZERO);
827 aromatic.put("G", ZERO);
828 aromatic.put("M", ZERO);
829 aromatic.put("F", ONE);
830 aromatic.put("Y", ONE);
831 aromatic.put("W", ONE);
832 aromatic.put("H", ONE);
833 aromatic.put("K", ZERO);
834 aromatic.put("R", ZERO);
835 aromatic.put("E", ZERO);
836 aromatic.put("Q", ZERO);
837 aromatic.put("D", ZERO);
838 aromatic.put("N", ZERO);
839 aromatic.put("S", ZERO);
840 aromatic.put("T", ZERO);
841 aromatic.put("P", ZERO);
842 aromatic.put("-", ONE);
843 aromatic.put("*", ONE);
848 aliphatic.put("I", ONE);
849 aliphatic.put("L", ONE);
850 aliphatic.put("V", ONE);
851 aliphatic.put("C", ZERO);
852 aliphatic.put("A", ZERO);
853 aliphatic.put("G", ZERO);
854 aliphatic.put("M", ZERO);
855 aliphatic.put("F", ZERO);
856 aliphatic.put("Y", ZERO);
857 aliphatic.put("W", ZERO);
858 aliphatic.put("H", ZERO);
859 aliphatic.put("K", ZERO);
860 aliphatic.put("R", ZERO);
861 aliphatic.put("E", ZERO);
862 aliphatic.put("Q", ZERO);
863 aliphatic.put("D", ZERO);
864 aliphatic.put("N", ZERO);
865 aliphatic.put("S", ZERO);
866 aliphatic.put("T", ZERO);
867 aliphatic.put("P", ZERO);
868 aliphatic.put("-", ONE);
869 aliphatic.put("*", ONE);
900 proline.put("I", ZERO);
901 proline.put("L", ZERO);
902 proline.put("V", ZERO);
903 proline.put("C", ZERO);
904 proline.put("A", ZERO);
905 proline.put("G", ZERO);
906 proline.put("M", ZERO);
907 proline.put("F", ZERO);
908 proline.put("Y", ZERO);
909 proline.put("W", ZERO);
910 proline.put("H", ZERO);
911 proline.put("K", ZERO);
912 proline.put("R", ZERO);
913 proline.put("E", ZERO);
914 proline.put("Q", ZERO);
915 proline.put("D", ZERO);
916 proline.put("N", ZERO);
917 proline.put("S", ZERO);
918 proline.put("T", ZERO);
919 proline.put("P", ONE);
920 proline.put("-", ONE);
921 proline.put("*", ONE);
926 propHash.put("hydrophobic", hydrophobic);
927 propHash.put("small", small);
928 propHash.put("positive", positive);
929 propHash.put("negative", negative);
930 propHash.put("charged", charged);
931 propHash.put("aromatic", aromatic);
932 propHash.put("aliphatic", aliphatic);
933 propHash.put("tiny", tiny);
934 propHash.put("proline", proline);
935 propHash.put("polar", polar);
939 int[][] propMatrixF = new int[maxProteinIndex][maxProteinIndex],
940 propMatrixPos = new int[maxProteinIndex][maxProteinIndex],
941 propMatrixEpos = new int[maxProteinIndex][maxProteinIndex];
942 for (int i = 0; i < maxProteinIndex; i++)
944 int maxF = 0, maxP = 0, maxEP = 0;
954 for (int j = i + 1; j < maxProteinIndex; j++)
965 propMatrixF[i][j] = 0;
966 propMatrixPos[i][j] = 0;
967 propMatrixEpos[i][j] = 0;
968 for (String ph : propHash.keySet())
970 Map<String, Integer> pph = propHash.get(ph);
971 if (pph.get(ic) != null && pph.get(jc) != null)
973 int icp = pph.get(ic).intValue(), jcp = pph.get(jc).intValue();
974 // Still working on these definitions.
975 propMatrixPos[i][j] += icp == jcp && icp > 0 ? 2 : 0;
976 propMatrixPos[j][i] += icp == jcp && icp > 0 ? 2 : 0;
977 propMatrixF[i][j] += icp == jcp ? 2 : 0;
978 propMatrixF[j][i] += icp == jcp ? 2 : 0;
979 propMatrixEpos[i][j] += icp == jcp ? (1 + icp * 2) : 0;
980 propMatrixEpos[j][i] += icp == jcp ? (1 + icp * 2) : 0;
983 if (maxF < propMatrixF[i][j])
985 maxF = propMatrixF[i][j];
987 if (maxP < propMatrixPos[i][j])
989 maxP = propMatrixPos[i][j];
991 if (maxEP < propMatrixEpos[i][j])
993 maxEP = propMatrixEpos[i][j];
996 propMatrixF[i][i] = maxF;
997 propMatrixPos[i][i] = maxP;
998 propMatrixEpos[i][i] = maxEP;
1002 private ResidueProperties()
1006 public static double getHydmax()
1011 public static double getHydmin()
1016 public static double[] getHyd()
1021 public static Map<String, Integer> getAA3Hash()
1026 public static String codonTranslate(String lccodon)
1028 String peptide = GeneticCodes.getInstance().getStandardCodeTable()
1029 .translate(lccodon);
1030 if ("*".equals(peptide))
1038 * lookup of (A-Z) alternative secondary structure symbols'
1039 * equivalents in DSSP3 notation
1041 private static char[] toDssp3State;
1044 toDssp3State = new char[9]; // for 'A'-'I'; extend if needed
1045 Arrays.fill(toDssp3State, ' ');
1046 toDssp3State['B' - 'A'] = 'E';
1047 toDssp3State['E' - 'A'] = 'E';
1048 toDssp3State['G' - 'A'] = 'H';
1049 toDssp3State['H' - 'A'] = 'H';
1050 toDssp3State['I' - 'A'] = 'H';
1054 * translate from other dssp secondary structure alphabets to 3-state
1059 public static String getDssp3state(String ssString)
1061 if (ssString == null)
1065 int lookupSize = toDssp3State.length;
1066 int len = ssString.length();
1067 char[] trans = new char[len];
1068 for (int i = 0; i < len; i++)
1070 char c = ssString.charAt(i);
1071 int index = c - 'A';
1072 if (index < 0 || index >= lookupSize)
1078 trans[i] = toDssp3State[index];
1081 return new String(trans);
1086 modifications.put("MSE", "MET"); // Selenomethionine
1087 // the rest tbc; from
1088 // http://sourceforge.net/p/jmol/mailman/message/12833570/
1089 // modifications.put("CSE", "CYS"); // Selenocysteine
1090 // modifications.put("PTR", "TYR"); // Phosphotyrosine
1091 // modifications.put("SEP", "SER"); // Phosphoserine
1092 // modifications.put("HYP", "PRO"); // 4-hydroxyproline
1093 // modifications.put("5HP", "GLU"); // Pyroglutamic acid; 5-hydroxyproline
1094 // modifications.put("PCA", "GLU"); // Pyroglutamic acid
1095 // modifications.put("LYZ", "LYS"); // 5-hydroxylysine
1097 // Additional protein alphabets used in the SCOP database and PDB files
1099 // https://github.com/biopython/biopython/blob/master/Bio/Data/SCOPData.py
1100 modifications.put("00C", "CYS");
1101 modifications.put("01W", "XAA");
1102 modifications.put("02K", "ALA");
1103 modifications.put("03Y", "CYS");
1104 modifications.put("07O", "CYS");
1105 modifications.put("08P", "CYS");
1106 modifications.put("0A0", "ASP");
1107 modifications.put("0A1", "TYR");
1108 modifications.put("0A2", "LYS");
1109 modifications.put("0A8", "CYS");
1110 modifications.put("0AA", "VAL");
1111 modifications.put("0AB", "VAL");
1112 modifications.put("0AC", "GLY");
1113 modifications.put("0AD", "GLY");
1114 modifications.put("0AF", "TRP");
1115 modifications.put("0AG", "LEU");
1116 modifications.put("0AH", "SER");
1117 modifications.put("0AK", "ASP");
1118 modifications.put("0AM", "ALA");
1119 modifications.put("0AP", "CYS");
1120 modifications.put("0AU", "UR3");
1121 modifications.put("0AV", "ALA");
1122 modifications.put("0AZ", "PRO");
1123 modifications.put("0BN", "PHE");
1124 modifications.put("0C ", "CYS");
1125 modifications.put("0CS", "ALA");
1126 modifications.put("0DC", "CYS");
1127 modifications.put("0DG", "GLY");
1128 modifications.put("0DT", "THR");
1129 modifications.put("0FL", "ALA");
1130 modifications.put("0G ", "GLY");
1131 modifications.put("0NC", "ALA");
1132 modifications.put("0SP", "ALA");
1133 modifications.put("0U ", "UR3");
1134 modifications.put("0YG", "YG");
1135 modifications.put("10C", "CYS");
1136 modifications.put("125", "UR3");
1137 modifications.put("126", "UR3");
1138 modifications.put("127", "UR3");
1139 modifications.put("128", "ASN");
1140 modifications.put("12A", "ALA");
1141 modifications.put("143", "CYS");
1142 modifications.put("175", "ASG");
1143 modifications.put("193", "XAA");
1144 modifications.put("1AP", "ALA");
1145 modifications.put("1MA", "ALA");
1146 modifications.put("1MG", "GLY");
1147 modifications.put("1PA", "PHE");
1148 modifications.put("1PI", "ALA");
1149 modifications.put("1PR", "ASN");
1150 modifications.put("1SC", "CYS");
1151 modifications.put("1TQ", "TRP");
1152 modifications.put("1TY", "TYR");
1153 modifications.put("1X6", "SER");
1154 modifications.put("200", "PHE");
1155 modifications.put("23F", "PHE");
1156 modifications.put("23S", "XAA");
1157 modifications.put("26B", "THR");
1158 modifications.put("2AD", "XAA");
1159 modifications.put("2AG", "ALA");
1160 modifications.put("2AO", "XAA");
1161 modifications.put("2AR", "ALA");
1162 modifications.put("2AS", "XAA");
1163 modifications.put("2AT", "THR");
1164 modifications.put("2AU", "UR3");
1165 modifications.put("2BD", "ILE");
1166 modifications.put("2BT", "THR");
1167 modifications.put("2BU", "ALA");
1168 modifications.put("2CO", "CYS");
1169 modifications.put("2DA", "ALA");
1170 modifications.put("2DF", "ASN");
1171 modifications.put("2DM", "ASN");
1172 modifications.put("2DO", "XAA");
1173 modifications.put("2DT", "THR");
1174 modifications.put("2EG", "GLY");
1175 modifications.put("2FE", "ASN");
1176 modifications.put("2FI", "ASN");
1177 modifications.put("2FM", "MET");
1178 modifications.put("2GT", "THR");
1179 modifications.put("2HF", "HIS");
1180 modifications.put("2LU", "LEU");
1181 modifications.put("2MA", "ALA");
1182 modifications.put("2MG", "GLY");
1183 modifications.put("2ML", "LEU");
1184 modifications.put("2MR", "ARG");
1185 modifications.put("2MT", "PRO");
1186 modifications.put("2MU", "UR3");
1187 modifications.put("2NT", "THR");
1188 modifications.put("2OM", "UR3");
1189 modifications.put("2OT", "THR");
1190 modifications.put("2PI", "XAA");
1191 modifications.put("2PR", "GLY");
1192 modifications.put("2SA", "ASN");
1193 modifications.put("2SI", "XAA");
1194 modifications.put("2ST", "THR");
1195 modifications.put("2TL", "THR");
1196 modifications.put("2TY", "TYR");
1197 modifications.put("2VA", "VAL");
1198 modifications.put("2XA", "CYS");
1199 modifications.put("32S", "XAA");
1200 modifications.put("32T", "XAA");
1201 modifications.put("3AH", "HIS");
1202 modifications.put("3AR", "XAA");
1203 modifications.put("3CF", "PHE");
1204 modifications.put("3DA", "ALA");
1205 modifications.put("3DR", "ASN");
1206 modifications.put("3GA", "ALA");
1207 modifications.put("3MD", "ASP");
1208 modifications.put("3ME", "UR3");
1209 modifications.put("3NF", "TYR");
1210 modifications.put("3QN", "LYS");
1211 modifications.put("3TY", "XAA");
1212 modifications.put("3XH", "GLY");
1213 modifications.put("4AC", "ASN");
1214 modifications.put("4BF", "TYR");
1215 modifications.put("4CF", "PHE");
1216 modifications.put("4CY", "MET");
1217 modifications.put("4DP", "TRP");
1218 modifications.put("4F3", "GYG");
1219 modifications.put("4FB", "PRO");
1220 modifications.put("4FW", "TRP");
1221 modifications.put("4HT", "TRP");
1222 modifications.put("4IN", "TRP");
1223 modifications.put("4MF", "ASN");
1224 modifications.put("4MM", "XAA");
1225 modifications.put("4OC", "CYS");
1226 modifications.put("4PC", "CYS");
1227 modifications.put("4PD", "CYS");
1228 modifications.put("4PE", "CYS");
1229 modifications.put("4PH", "PHE");
1230 modifications.put("4SC", "CYS");
1231 modifications.put("4SU", "UR3");
1232 modifications.put("4TA", "ASN");
1233 modifications.put("4U7", "ALA");
1234 modifications.put("56A", "HIS");
1235 modifications.put("5AA", "ALA");
1236 modifications.put("5AB", "ALA");
1237 modifications.put("5AT", "THR");
1238 modifications.put("5BU", "UR3");
1239 modifications.put("5CG", "GLY");
1240 modifications.put("5CM", "CYS");
1241 modifications.put("5CS", "CYS");
1242 modifications.put("5FA", "ALA");
1243 modifications.put("5FC", "CYS");
1244 modifications.put("5FU", "UR3");
1245 modifications.put("5HP", "GLU");
1246 modifications.put("5HT", "THR");
1247 modifications.put("5HU", "UR3");
1248 modifications.put("5IC", "CYS");
1249 modifications.put("5IT", "THR");
1250 modifications.put("5IU", "UR3");
1251 modifications.put("5MC", "CYS");
1252 modifications.put("5MD", "ASN");
1253 modifications.put("5MU", "UR3");
1254 modifications.put("5NC", "CYS");
1255 modifications.put("5PC", "CYS");
1256 modifications.put("5PY", "THR");
1257 modifications.put("5SE", "UR3");
1258 modifications.put("5ZA", "TWG");
1259 modifications.put("64T", "THR");
1260 modifications.put("6CL", "LYS");
1261 modifications.put("6CT", "THR");
1262 modifications.put("6CW", "TRP");
1263 modifications.put("6HA", "ALA");
1264 modifications.put("6HC", "CYS");
1265 modifications.put("6HG", "GLY");
1266 modifications.put("6HN", "LYS");
1267 modifications.put("6HT", "THR");
1268 modifications.put("6IA", "ALA");
1269 modifications.put("6MA", "ALA");
1270 modifications.put("6MC", "ALA");
1271 modifications.put("6MI", "ASN");
1272 modifications.put("6MT", "ALA");
1273 modifications.put("6MZ", "ASN");
1274 modifications.put("6OG", "GLY");
1275 modifications.put("70U", "UR3");
1276 modifications.put("7DA", "ALA");
1277 modifications.put("7GU", "GLY");
1278 modifications.put("7JA", "ILE");
1279 modifications.put("7MG", "GLY");
1280 modifications.put("8AN", "ALA");
1281 modifications.put("8FG", "GLY");
1282 modifications.put("8MG", "GLY");
1283 modifications.put("8OG", "GLY");
1284 modifications.put("9NE", "GLU");
1285 modifications.put("9NF", "PHE");
1286 modifications.put("9NR", "ARG");
1287 modifications.put("9NV", "VAL");
1288 modifications.put("A ", "ALA");
1289 modifications.put("A1P", "ASN");
1290 modifications.put("A23", "ALA");
1291 modifications.put("A2L", "ALA");
1292 modifications.put("A2M", "ALA");
1293 modifications.put("A34", "ALA");
1294 modifications.put("A35", "ALA");
1295 modifications.put("A38", "ALA");
1296 modifications.put("A39", "ALA");
1297 modifications.put("A3A", "ALA");
1298 modifications.put("A3P", "ALA");
1299 modifications.put("A40", "ALA");
1300 modifications.put("A43", "ALA");
1301 modifications.put("A44", "ALA");
1302 modifications.put("A47", "ALA");
1303 modifications.put("A5L", "ALA");
1304 modifications.put("A5M", "CYS");
1305 modifications.put("A5N", "ASN");
1306 modifications.put("A5O", "ALA");
1307 modifications.put("A66", "XAA");
1308 modifications.put("AA3", "ALA");
1309 modifications.put("AA4", "ALA");
1310 modifications.put("AAR", "ARG");
1311 modifications.put("AB7", "XAA");
1312 modifications.put("ABA", "ALA");
1313 modifications.put("ABR", "ALA");
1314 modifications.put("ABS", "ALA");
1315 modifications.put("ABT", "ASN");
1316 modifications.put("ACB", "ASP");
1317 modifications.put("ACL", "ARG");
1318 modifications.put("AD2", "ALA");
1319 modifications.put("ADD", "XAA");
1320 modifications.put("ADX", "ASN");
1321 modifications.put("AEA", "XAA");
1322 modifications.put("AEI", "ASP");
1323 modifications.put("AET", "ALA");
1324 modifications.put("AFA", "ASN");
1325 modifications.put("AFF", "ASN");
1326 modifications.put("AFG", "GLY");
1327 modifications.put("AGM", "ARG");
1328 modifications.put("AGT", "CYS");
1329 modifications.put("AHB", "ASN");
1330 modifications.put("AHH", "XAA");
1331 modifications.put("AHO", "ALA");
1332 modifications.put("AHP", "ALA");
1333 modifications.put("AHS", "XAA");
1334 modifications.put("AHT", "XAA");
1335 modifications.put("AIB", "ALA");
1336 modifications.put("AKL", "ASP");
1337 modifications.put("AKZ", "ASP");
1338 modifications.put("ALA", "ALA");
1339 modifications.put("ALC", "ALA");
1340 modifications.put("ALM", "ALA");
1341 modifications.put("ALN", "ALA");
1342 modifications.put("ALO", "THR");
1343 modifications.put("ALQ", "XAA");
1344 modifications.put("ALS", "ALA");
1345 modifications.put("ALT", "ALA");
1346 modifications.put("ALV", "ALA");
1347 modifications.put("ALY", "LYS");
1348 modifications.put("AN8", "ALA");
1349 modifications.put("AP7", "ALA");
1350 modifications.put("APE", "XAA");
1351 modifications.put("APH", "ALA");
1352 modifications.put("API", "LYS");
1353 modifications.put("APK", "LYS");
1354 modifications.put("APM", "XAA");
1355 modifications.put("APP", "XAA");
1356 modifications.put("AR2", "ARG");
1357 modifications.put("AR4", "GLU");
1358 modifications.put("AR7", "ARG");
1359 modifications.put("ARG", "ARG");
1360 modifications.put("ARM", "ARG");
1361 modifications.put("ARO", "ARG");
1362 modifications.put("ARV", "XAA");
1363 modifications.put("AS ", "ALA");
1364 modifications.put("AS2", "ASP");
1365 modifications.put("AS9", "XAA");
1366 modifications.put("ASA", "ASP");
1367 modifications.put("ASB", "ASP");
1368 modifications.put("ASI", "ASP");
1369 modifications.put("ASK", "ASP");
1370 modifications.put("ASL", "ASP");
1371 modifications.put("ASM", "XAA");
1372 modifications.put("ASN", "ASN");
1373 modifications.put("ASP", "ASP");
1374 modifications.put("ASQ", "ASP");
1375 modifications.put("ASU", "ASN");
1376 modifications.put("ASX", "ASX");
1377 modifications.put("ATD", "THR");
1378 modifications.put("ATL", "THR");
1379 modifications.put("ATM", "THR");
1380 modifications.put("AVC", "ALA");
1381 modifications.put("AVN", "XAA");
1382 modifications.put("AYA", "ALA");
1383 modifications.put("AYG", "AYG");
1384 modifications.put("AZK", "LYS");
1385 modifications.put("AZS", "SER");
1386 modifications.put("AZY", "TYR");
1387 modifications.put("B1F", "PHE");
1388 modifications.put("B1P", "ASN");
1389 modifications.put("B2A", "ALA");
1390 modifications.put("B2F", "PHE");
1391 modifications.put("B2I", "ILE");
1392 modifications.put("B2V", "VAL");
1393 modifications.put("B3A", "ALA");
1394 modifications.put("B3D", "ASP");
1395 modifications.put("B3E", "GLU");
1396 modifications.put("B3K", "LYS");
1397 modifications.put("B3L", "XAA");
1398 modifications.put("B3M", "XAA");
1399 modifications.put("B3Q", "XAA");
1400 modifications.put("B3S", "SER");
1401 modifications.put("B3T", "XAA");
1402 modifications.put("B3U", "HIS");
1403 modifications.put("B3X", "ASN");
1404 modifications.put("B3Y", "TYR");
1405 modifications.put("BB6", "CYS");
1406 modifications.put("BB7", "CYS");
1407 modifications.put("BB8", "PHE");
1408 modifications.put("BB9", "CYS");
1409 modifications.put("BBC", "CYS");
1410 modifications.put("BCS", "CYS");
1411 modifications.put("BE2", "XAA");
1412 modifications.put("BFD", "ASP");
1413 modifications.put("BG1", "SER");
1414 modifications.put("BGM", "GLY");
1415 modifications.put("BH2", "ASP");
1416 modifications.put("BHD", "ASP");
1417 modifications.put("BIF", "PHE");
1418 modifications.put("BIL", "XAA");
1419 modifications.put("BIU", "ILE");
1420 modifications.put("BJH", "XAA");
1421 modifications.put("BLE", "LEU");
1422 modifications.put("BLY", "LYS");
1423 modifications.put("BMP", "ASN");
1424 modifications.put("BMT", "THR");
1425 modifications.put("BNN", "PHE");
1426 modifications.put("BNO", "XAA");
1427 modifications.put("BOE", "THR");
1428 modifications.put("BOR", "ARG");
1429 modifications.put("BPE", "CYS");
1430 modifications.put("BRU", "UR3");
1431 modifications.put("BSE", "SER");
1432 modifications.put("BT5", "ASN");
1433 modifications.put("BTA", "LEU");
1434 modifications.put("BTC", "CYS");
1435 modifications.put("BTR", "TRP");
1436 modifications.put("BUC", "CYS");
1437 modifications.put("BUG", "VAL");
1438 modifications.put("BVP", "UR3");
1439 modifications.put("BZG", "ASN");
1440 modifications.put("C ", "CYS");
1441 modifications.put("C12", "TYG");
1442 modifications.put("C1X", "LYS");
1443 modifications.put("C25", "CYS");
1444 modifications.put("C2L", "CYS");
1445 modifications.put("C2S", "CYS");
1446 modifications.put("C31", "CYS");
1447 modifications.put("C32", "CYS");
1448 modifications.put("C34", "CYS");
1449 modifications.put("C36", "CYS");
1450 modifications.put("C37", "CYS");
1451 modifications.put("C38", "CYS");
1452 modifications.put("C3Y", "CYS");
1453 modifications.put("C42", "CYS");
1454 modifications.put("C43", "CYS");
1455 modifications.put("C45", "CYS");
1456 modifications.put("C46", "CYS");
1457 modifications.put("C49", "CYS");
1458 modifications.put("C4R", "CYS");
1459 modifications.put("C4S", "CYS");
1460 modifications.put("C5C", "CYS");
1461 modifications.put("C66", "XAA");
1462 modifications.put("C6C", "CYS");
1463 modifications.put("C99", "TFG");
1464 modifications.put("CAF", "CYS");
1465 modifications.put("CAL", "XAA");
1466 modifications.put("CAR", "CYS");
1467 modifications.put("CAS", "CYS");
1468 modifications.put("CAV", "XAA");
1469 modifications.put("CAY", "CYS");
1470 modifications.put("CB2", "CYS");
1471 modifications.put("CBR", "CYS");
1472 modifications.put("CBV", "CYS");
1473 modifications.put("CCC", "CYS");
1474 modifications.put("CCL", "LYS");
1475 modifications.put("CCS", "CYS");
1476 modifications.put("CCY", "CYG");
1477 modifications.put("CDE", "XAA");
1478 modifications.put("CDV", "XAA");
1479 modifications.put("CDW", "CYS");
1480 modifications.put("CEA", "CYS");
1481 modifications.put("CFL", "CYS");
1482 modifications.put("CFY", "FCYG"); // check
1483 modifications.put("CG1", "GLY");
1484 modifications.put("CGA", "GLU");
1485 modifications.put("CGU", "GLU");
1486 modifications.put("CH ", "CYS");
1487 modifications.put("CH6", "MYG");
1488 modifications.put("CH7", "KYG");
1489 modifications.put("CHF", "XAA");
1490 modifications.put("CHG", "XAA");
1491 modifications.put("CHP", "GLY");
1492 modifications.put("CHS", "XAA");
1493 modifications.put("CIR", "ARG");
1494 modifications.put("CJO", "GYG");
1495 modifications.put("CLE", "LEU");
1496 modifications.put("CLG", "LYS");
1497 modifications.put("CLH", "LYS");
1498 modifications.put("CLV", "AFG");
1499 modifications.put("CM0", "ASN");
1500 modifications.put("CME", "CYS");
1501 modifications.put("CMH", "CYS");
1502 modifications.put("CML", "CYS");
1503 modifications.put("CMR", "CYS");
1504 modifications.put("CMT", "CYS");
1505 modifications.put("CNU", "UR3");
1506 modifications.put("CP1", "CYS");
1507 modifications.put("CPC", "XAA");
1508 modifications.put("CPI", "XAA");
1509 modifications.put("CQR", "GYG");
1510 modifications.put("CR0", "TLG");
1511 modifications.put("CR2", "GYG");
1512 modifications.put("CR5", "GLY");
1513 modifications.put("CR7", "KYG");
1514 modifications.put("CR8", "HYG");
1515 modifications.put("CRF", "TWG");
1516 modifications.put("CRG", "THG");
1517 modifications.put("CRK", "MYG");
1518 modifications.put("CRO", "GYG");
1519 modifications.put("CRQ", "QYG");
1520 modifications.put("CRU", "EYG");
1521 modifications.put("CRW", "ASG");
1522 modifications.put("CRX", "ASG");
1523 modifications.put("CS0", "CYS");
1524 modifications.put("CS1", "CYS");
1525 modifications.put("CS3", "CYS");
1526 modifications.put("CS4", "CYS");
1527 modifications.put("CS8", "ASN");
1528 modifications.put("CSA", "CYS");
1529 modifications.put("CSB", "CYS");
1530 modifications.put("CSD", "CYS");
1531 modifications.put("CSE", "CYS");
1532 modifications.put("CSF", "CYS");
1533 modifications.put("CSH", "SHG");
1534 modifications.put("CSI", "GLY");
1535 modifications.put("CSJ", "CYS");
1536 modifications.put("CSL", "CYS");
1537 modifications.put("CSO", "CYS");
1538 modifications.put("CSP", "CYS");
1539 modifications.put("CSR", "CYS");
1540 modifications.put("CSS", "CYS");
1541 modifications.put("CSU", "CYS");
1542 modifications.put("CSW", "CYS");
1543 modifications.put("CSX", "CYS");
1544 modifications.put("CSY", "SYG");
1545 modifications.put("CSZ", "CYS");
1546 modifications.put("CTE", "TRP");
1547 modifications.put("CTG", "THR");
1548 modifications.put("CTH", "THR");
1549 modifications.put("CUC", "XAA");
1550 modifications.put("CWR", "SER");
1551 modifications.put("CXM", "MET");
1552 modifications.put("CY0", "CYS");
1553 modifications.put("CY1", "CYS");
1554 modifications.put("CY3", "CYS");
1555 modifications.put("CY4", "CYS");
1556 modifications.put("CYA", "CYS");
1557 modifications.put("CYD", "CYS");
1558 modifications.put("CYF", "CYS");
1559 modifications.put("CYG", "CYS");
1560 modifications.put("CYJ", "XAA");
1561 modifications.put("CYM", "CYS");
1562 modifications.put("CYQ", "CYS");
1563 modifications.put("CYR", "CYS");
1564 modifications.put("CYS", "CYS");
1565 modifications.put("CZ2", "CYS");
1566 modifications.put("CZO", "GYG");
1567 modifications.put("CZZ", "CYS");
1568 modifications.put("D11", "THR");
1569 modifications.put("D1P", "ASN");
1570 modifications.put("D3 ", "ASN");
1571 modifications.put("D33", "ASN");
1572 modifications.put("D3P", "GLY");
1573 modifications.put("D3T", "THR");
1574 modifications.put("D4M", "THR");
1575 modifications.put("D4P", "XAA");
1576 modifications.put("DA ", "ALA");
1577 modifications.put("DA2", "XAA");
1578 modifications.put("DAB", "ALA");
1579 modifications.put("DAH", "PHE");
1580 modifications.put("DAL", "ALA");
1581 modifications.put("DAR", "ARG");
1582 modifications.put("DAS", "ASP");
1583 modifications.put("DBB", "THR");
1584 modifications.put("DBM", "ASN");
1585 modifications.put("DBS", "SER");
1586 modifications.put("DBU", "THR");
1587 modifications.put("DBY", "TYR");
1588 modifications.put("DBZ", "ALA");
1589 modifications.put("DC ", "CYS");
1590 modifications.put("DC2", "CYS");
1591 modifications.put("DCG", "GLY");
1592 modifications.put("DCI", "XAA");
1593 modifications.put("DCL", "XAA");
1594 modifications.put("DCT", "CYS");
1595 modifications.put("DCY", "CYS");
1596 modifications.put("DDE", "HIS");
1597 modifications.put("DDG", "GLY");
1598 modifications.put("DDN", "UR3");
1599 modifications.put("DDX", "ASN");
1600 modifications.put("DFC", "CYS");
1601 modifications.put("DFG", "GLY");
1602 modifications.put("DFI", "XAA");
1603 modifications.put("DFO", "XAA");
1604 modifications.put("DFT", "ASN");
1605 modifications.put("DG ", "GLY");
1606 modifications.put("DGH", "GLY");
1607 modifications.put("DGI", "GLY");
1608 modifications.put("DGL", "GLU");
1609 modifications.put("DGN", "GLN");
1610 modifications.put("DHA", "SER");
1611 modifications.put("DHI", "HIS");
1612 modifications.put("DHL", "XAA");
1613 modifications.put("DHN", "VAL");
1614 modifications.put("DHP", "XAA");
1615 modifications.put("DHU", "UR3");
1616 modifications.put("DHV", "VAL");
1617 modifications.put("DI ", "ILE");
1618 modifications.put("DIL", "ILE");
1619 modifications.put("DIR", "ARG");
1620 modifications.put("DIV", "VAL");
1621 modifications.put("DLE", "LEU");
1622 modifications.put("DLS", "LYS");
1623 modifications.put("DLY", "LYS");
1624 modifications.put("DM0", "LYS");
1625 modifications.put("DMH", "ASN");
1626 modifications.put("DMK", "ASP");
1627 modifications.put("DMT", "XAA");
1628 modifications.put("DN ", "ASN");
1629 modifications.put("DNE", "LEU");
1630 modifications.put("DNG", "LEU");
1631 modifications.put("DNL", "LYS");
1632 modifications.put("DNM", "LEU");
1633 modifications.put("DNP", "ALA");
1634 modifications.put("DNR", "CYS");
1635 modifications.put("DNS", "LYS");
1636 modifications.put("DOA", "XAA");
1637 modifications.put("DOC", "CYS");
1638 modifications.put("DOH", "ASP");
1639 modifications.put("DON", "LEU");
1640 modifications.put("DPB", "THR");
1641 modifications.put("DPH", "PHE");
1642 modifications.put("DPL", "PRO");
1643 modifications.put("DPP", "ALA");
1644 modifications.put("DPQ", "TYR");
1645 modifications.put("DPR", "PRO");
1646 modifications.put("DPY", "ASN");
1647 modifications.put("DRM", "UR3");
1648 modifications.put("DRP", "ASN");
1649 modifications.put("DRT", "THR");
1650 modifications.put("DRZ", "ASN");
1651 modifications.put("DSE", "SER");
1652 modifications.put("DSG", "ASN");
1653 modifications.put("DSN", "SER");
1654 modifications.put("DSP", "ASP");
1655 modifications.put("DT ", "THR");
1656 modifications.put("DTH", "THR");
1657 modifications.put("DTR", "TRP");
1658 modifications.put("DTY", "TYR");
1659 modifications.put("DU ", "UR3");
1660 modifications.put("DVA", "VAL");
1661 modifications.put("DXD", "ASN");
1662 modifications.put("DXN", "ASN");
1663 modifications.put("DYG", "DYG");
1664 modifications.put("DYS", "CYS");
1665 modifications.put("DZM", "ALA");
1666 modifications.put("E ", "ALA");
1667 modifications.put("E1X", "ALA");
1668 modifications.put("ECC", "GLN");
1669 modifications.put("EDA", "ALA");
1670 modifications.put("EFC", "CYS");
1671 modifications.put("EHP", "PHE");
1672 modifications.put("EIT", "THR");
1673 modifications.put("ENP", "ASN");
1674 modifications.put("ESB", "TYR");
1675 modifications.put("ESC", "MET");
1676 modifications.put("EXB", "XAA");
1677 modifications.put("EXY", "LEU");
1678 modifications.put("EY5", "ASN");
1679 modifications.put("EYS", "XAA");
1680 modifications.put("F2F", "PHE");
1681 modifications.put("FA2", "ALA");
1682 modifications.put("FA5", "ASN");
1683 modifications.put("FAG", "ASN");
1684 modifications.put("FAI", "ASN");
1685 modifications.put("FB5", "ALA");
1686 modifications.put("FB6", "ALA");
1687 modifications.put("FCL", "PHE");
1688 modifications.put("FFD", "ASN");
1689 modifications.put("FGA", "GLU");
1690 modifications.put("FGL", "GLY");
1691 modifications.put("FGP", "SER");
1692 modifications.put("FHL", "XAA");
1693 modifications.put("FHO", "LYS");
1694 modifications.put("FHU", "UR3");
1695 modifications.put("FLA", "ALA");
1696 modifications.put("FLE", "LEU");
1697 modifications.put("FLT", "TYR");
1698 modifications.put("FME", "MET");
1699 modifications.put("FMG", "GLY");
1700 modifications.put("FMU", "ASN");
1701 modifications.put("FOE", "CYS");
1702 modifications.put("FOX", "GLY");
1703 modifications.put("FP9", "PRO");
1704 modifications.put("FPA", "PHE");
1705 modifications.put("FRD", "XAA");
1706 modifications.put("FT6", "TRP");
1707 modifications.put("FTR", "TRP");
1708 modifications.put("FTY", "TYR");
1709 modifications.put("FVA", "VAL");
1710 modifications.put("FZN", "LYS");
1711 modifications.put("G ", "GLY");
1712 modifications.put("G25", "GLY");
1713 modifications.put("G2L", "GLY");
1714 modifications.put("G2S", "GLY");
1715 modifications.put("G31", "GLY");
1716 modifications.put("G32", "GLY");
1717 modifications.put("G33", "GLY");
1718 modifications.put("G36", "GLY");
1719 modifications.put("G38", "GLY");
1720 modifications.put("G42", "GLY");
1721 modifications.put("G46", "GLY");
1722 modifications.put("G47", "GLY");
1723 modifications.put("G48", "GLY");
1724 modifications.put("G49", "GLY");
1725 modifications.put("G4P", "ASN");
1726 modifications.put("G7M", "GLY");
1727 modifications.put("GAO", "GLY");
1728 modifications.put("GAU", "GLU");
1729 modifications.put("GCK", "CYS");
1730 modifications.put("GCM", "XAA");
1731 modifications.put("GDP", "GLY");
1732 modifications.put("GDR", "GLY");
1733 modifications.put("GFL", "GLY");
1734 modifications.put("GGL", "GLU");
1735 modifications.put("GH3", "GLY");
1736 modifications.put("GHG", "GLN");
1737 modifications.put("GHP", "GLY");
1738 modifications.put("GL3", "GLY");
1739 modifications.put("GLH", "GLN");
1740 modifications.put("GLJ", "GLU");
1741 modifications.put("GLK", "GLU");
1742 modifications.put("GLM", "XAA");
1743 modifications.put("GLN", "GLN");
1744 modifications.put("GLQ", "GLU");
1745 modifications.put("GLU", "GLU");
1746 modifications.put("GLX", "GLX");
1747 modifications.put("GLY", "GLY");
1748 modifications.put("GLZ", "GLY");
1749 modifications.put("GMA", "GLU");
1750 modifications.put("GMS", "GLY");
1751 modifications.put("GMU", "UR3");
1752 modifications.put("GN7", "GLY");
1753 modifications.put("GND", "XAA");
1754 modifications.put("GNE", "ASN");
1755 modifications.put("GOM", "GLY");
1756 modifications.put("GPL", "LYS");
1757 modifications.put("GS ", "GLY");
1758 modifications.put("GSC", "GLY");
1759 modifications.put("GSR", "GLY");
1760 modifications.put("GSS", "GLY");
1761 modifications.put("GSU", "GLU");
1762 modifications.put("GT9", "CYS");
1763 modifications.put("GTP", "GLY");
1764 modifications.put("GVL", "XAA");
1765 modifications.put("GYC", "CYG");
1766 modifications.put("GYS", "SYG");
1767 modifications.put("H2U", "UR3");
1768 modifications.put("H5M", "PRO");
1769 modifications.put("HAC", "ALA");
1770 modifications.put("HAR", "ARG");
1771 modifications.put("HBN", "HIS");
1772 modifications.put("HCS", "XAA");
1773 modifications.put("HDP", "UR3");
1774 modifications.put("HEU", "UR3");
1775 modifications.put("HFA", "XAA");
1776 modifications.put("HGL", "XAA");
1777 modifications.put("HHI", "HIS");
1778 modifications.put("HHK", "AK"); // check
1779 modifications.put("HIA", "HIS");
1780 modifications.put("HIC", "HIS");
1781 modifications.put("HIP", "HIS");
1782 modifications.put("HIQ", "HIS");
1783 modifications.put("HIS", "HIS");
1784 modifications.put("HL2", "LEU");
1785 modifications.put("HLU", "LEU");
1786 modifications.put("HMR", "ARG");
1787 modifications.put("HOL", "ASN");
1788 modifications.put("HPC", "PHE");
1789 modifications.put("HPE", "PHE");
1790 modifications.put("HPH", "PHE");
1791 modifications.put("HPQ", "PHE");
1792 modifications.put("HQA", "ALA");
1793 modifications.put("HRG", "ARG");
1794 modifications.put("HRP", "TRP");
1795 modifications.put("HS8", "HIS");
1796 modifications.put("HS9", "HIS");
1797 modifications.put("HSE", "SER");
1798 modifications.put("HSL", "SER");
1799 modifications.put("HSO", "HIS");
1800 modifications.put("HTI", "CYS");
1801 modifications.put("HTN", "ASN");
1802 modifications.put("HTR", "TRP");
1803 modifications.put("HV5", "ALA");
1804 modifications.put("HVA", "VAL");
1805 modifications.put("HY3", "PRO");
1806 modifications.put("HYP", "PRO");
1807 modifications.put("HZP", "PRO");
1808 modifications.put("I ", "ILE");
1809 modifications.put("I2M", "ILE");
1810 modifications.put("I58", "LYS");
1811 modifications.put("I5C", "CYS");
1812 modifications.put("IAM", "ALA");
1813 modifications.put("IAR", "ARG");
1814 modifications.put("IAS", "ASP");
1815 modifications.put("IC ", "CYS");
1816 modifications.put("IEL", "LYS");
1817 modifications.put("IEY", "HYG");
1818 modifications.put("IG ", "GLY");
1819 modifications.put("IGL", "GLY");
1820 modifications.put("IGU", "GLY");
1821 modifications.put("IIC", "SHG");
1822 modifications.put("IIL", "ILE");
1823 modifications.put("ILE", "ILE");
1824 modifications.put("ILG", "GLU");
1825 modifications.put("ILX", "ILE");
1826 modifications.put("IMC", "CYS");
1827 modifications.put("IML", "ILE");
1828 modifications.put("IOY", "PHE");
1829 modifications.put("IPG", "GLY");
1830 modifications.put("IPN", "ASN");
1831 modifications.put("IRN", "ASN");
1832 modifications.put("IT1", "LYS");
1833 modifications.put("IU ", "UR3");
1834 modifications.put("IYR", "TYR");
1835 modifications.put("IYT", "THR");
1836 modifications.put("IZO", "MET");
1837 modifications.put("JJJ", "CYS");
1838 modifications.put("JJK", "CYS");
1839 modifications.put("JJL", "CYS");
1840 modifications.put("JW5", "ASN");
1841 modifications.put("K1R", "CYS");
1842 modifications.put("KAG", "GLY");
1843 modifications.put("KCX", "LYS");
1844 modifications.put("KGC", "LYS");
1845 modifications.put("KNB", "ALA");
1846 modifications.put("KOR", "MET");
1847 modifications.put("KPI", "LYS");
1848 modifications.put("KST", "LYS");
1849 modifications.put("KYQ", "LYS");
1850 modifications.put("L2A", "XAA");
1851 modifications.put("LA2", "LYS");
1852 modifications.put("LAA", "ASP");
1853 modifications.put("LAL", "ALA");
1854 modifications.put("LBY", "LYS");
1855 modifications.put("LC ", "CYS");
1856 modifications.put("LCA", "ALA");
1857 modifications.put("LCC", "ASN");
1858 modifications.put("LCG", "GLY");
1859 modifications.put("LCH", "ASN");
1860 modifications.put("LCK", "LYS");
1861 modifications.put("LCX", "LYS");
1862 modifications.put("LDH", "LYS");
1863 modifications.put("LED", "LEU");
1864 modifications.put("LEF", "LEU");
1865 modifications.put("LEH", "LEU");
1866 modifications.put("LEI", "VAL");
1867 modifications.put("LEM", "LEU");
1868 modifications.put("LEN", "LEU");
1869 modifications.put("LET", "XAA");
1870 modifications.put("LEU", "LEU");
1871 modifications.put("LEX", "LEU");
1872 modifications.put("LG ", "GLY");
1873 modifications.put("LGP", "GLY");
1874 modifications.put("LHC", "XAA");
1875 modifications.put("LHU", "UR3");
1876 modifications.put("LKC", "ASN");
1877 modifications.put("LLP", "LYS");
1878 modifications.put("LLY", "LYS");
1879 modifications.put("LME", "GLU");
1880 modifications.put("LMF", "LYS");
1881 modifications.put("LMQ", "GLN");
1882 modifications.put("LMS", "ASN");
1883 modifications.put("LP6", "LYS");
1884 modifications.put("LPD", "PRO");
1885 modifications.put("LPG", "GLY");
1886 modifications.put("LPL", "XAA");
1887 modifications.put("LPS", "SER");
1888 modifications.put("LSO", "XAA");
1889 modifications.put("LTA", "XAA");
1890 modifications.put("LTR", "TRP");
1891 modifications.put("LVG", "GLY");
1892 modifications.put("LVN", "VAL");
1893 modifications.put("LYF", "LYS");
1894 modifications.put("LYK", "LYS");
1895 modifications.put("LYM", "LYS");
1896 modifications.put("LYN", "LYS");
1897 modifications.put("LYR", "LYS");
1898 modifications.put("LYS", "LYS");
1899 modifications.put("LYX", "LYS");
1900 modifications.put("LYZ", "LYS");
1901 modifications.put("M0H", "CYS");
1902 modifications.put("M1G", "GLY");
1903 modifications.put("M2G", "GLY");
1904 modifications.put("M2L", "LYS");
1905 modifications.put("M2S", "MET");
1906 modifications.put("M30", "GLY");
1907 modifications.put("M3L", "LYS");
1908 modifications.put("M5M", "CYS");
1909 modifications.put("MA ", "ALA");
1910 modifications.put("MA6", "ALA");
1911 modifications.put("MA7", "ALA");
1912 modifications.put("MAA", "ALA");
1913 modifications.put("MAD", "ALA");
1914 modifications.put("MAI", "ARG");
1915 modifications.put("MBQ", "TYR");
1916 modifications.put("MBZ", "ASN");
1917 modifications.put("MC1", "SER");
1918 modifications.put("MCG", "XAA");
1919 modifications.put("MCL", "LYS");
1920 modifications.put("MCS", "CYS");
1921 modifications.put("MCY", "CYS");
1922 modifications.put("MD3", "CYS");
1923 modifications.put("MD6", "GLY");
1924 modifications.put("MDH", "XAA");
1925 modifications.put("MDO", "ASG");
1926 modifications.put("MDR", "ASN");
1927 modifications.put("MEA", "PHE");
1928 modifications.put("MED", "MET");
1929 modifications.put("MEG", "GLU");
1930 modifications.put("MEN", "ASN");
1931 modifications.put("MEP", "UR3");
1932 modifications.put("MEQ", "GLN");
1933 modifications.put("MET", "MET");
1934 modifications.put("MEU", "GLY");
1935 modifications.put("MF3", "XAA");
1936 modifications.put("MFC", "GYG");
1937 modifications.put("MG1", "GLY");
1938 modifications.put("MGG", "ARG");
1939 modifications.put("MGN", "GLN");
1940 modifications.put("MGQ", "ALA");
1941 modifications.put("MGV", "GLY");
1942 modifications.put("MGY", "GLY");
1943 modifications.put("MHL", "LEU");
1944 modifications.put("MHO", "MET");
1945 modifications.put("MHS", "HIS");
1946 modifications.put("MIA", "ALA");
1947 modifications.put("MIS", "SER");
1948 modifications.put("MK8", "LEU");
1949 modifications.put("ML3", "LYS");
1950 modifications.put("MLE", "LEU");
1951 modifications.put("MLL", "LEU");
1952 modifications.put("MLY", "LYS");
1953 modifications.put("MLZ", "LYS");
1954 modifications.put("MME", "MET");
1955 modifications.put("MMO", "ARG");
1956 modifications.put("MMT", "THR");
1957 modifications.put("MND", "ASN");
1958 modifications.put("MNL", "LEU");
1959 modifications.put("MNU", "UR3");
1960 modifications.put("MNV", "VAL");
1961 modifications.put("MOD", "XAA");
1962 modifications.put("MP8", "PRO");
1963 modifications.put("MPH", "XAA");
1964 modifications.put("MPJ", "XAA");
1965 modifications.put("MPQ", "GLY");
1966 modifications.put("MRG", "GLY");
1967 modifications.put("MSA", "GLY");
1968 modifications.put("MSE", "MET");
1969 modifications.put("MSL", "MET");
1970 modifications.put("MSO", "MET");
1971 modifications.put("MSP", "XAA");
1972 modifications.put("MT2", "MET");
1973 modifications.put("MTR", "THR");
1974 modifications.put("MTU", "ALA");
1975 modifications.put("MTY", "TYR");
1976 modifications.put("MVA", "VAL");
1977 modifications.put("N ", "ASN");
1978 modifications.put("N10", "SER");
1979 modifications.put("N2C", "XAA");
1980 modifications.put("N5I", "ASN");
1981 modifications.put("N5M", "CYS");
1982 modifications.put("N6G", "GLY");
1983 modifications.put("N7P", "PRO");
1984 modifications.put("NA8", "ALA");
1985 modifications.put("NAL", "ALA");
1986 modifications.put("NAM", "ALA");
1987 modifications.put("NB8", "ASN");
1988 modifications.put("NBQ", "TYR");
1989 modifications.put("NC1", "SER");
1990 modifications.put("NCB", "ALA");
1991 modifications.put("NCX", "ASN");
1992 modifications.put("NCY", "XAA");
1993 modifications.put("NDF", "PHE");
1994 modifications.put("NDN", "UR3");
1995 modifications.put("NEM", "HIS");
1996 modifications.put("NEP", "HIS");
1997 modifications.put("NF2", "ASN");
1998 modifications.put("NFA", "PHE");
1999 modifications.put("NHL", "GLU");
2000 modifications.put("NIT", "XAA");
2001 modifications.put("NIY", "TYR");
2002 modifications.put("NLE", "LEU");
2003 modifications.put("NLN", "LEU");
2004 modifications.put("NLO", "LEU");
2005 modifications.put("NLP", "LEU");
2006 modifications.put("NLQ", "GLN");
2007 modifications.put("NMC", "GLY");
2008 modifications.put("NMM", "ARG");
2009 modifications.put("NMS", "THR");
2010 modifications.put("NMT", "THR");
2011 modifications.put("NNH", "ARG");
2012 modifications.put("NP3", "ASN");
2013 modifications.put("NPH", "CYS");
2014 modifications.put("NPI", "ALA");
2015 modifications.put("NRP", "LYG");
2016 modifications.put("NRQ", "MYG");
2017 modifications.put("NSK", "XAA");
2018 modifications.put("NTY", "TYR");
2019 modifications.put("NVA", "VAL");
2020 modifications.put("NYC", "TWG");
2021 modifications.put("NYG", "NYG");
2022 modifications.put("NYM", "ASN");
2023 modifications.put("NYS", "CYS");
2024 modifications.put("NZH", "HIS");
2025 modifications.put("O12", "XAA");
2026 modifications.put("O2C", "ASN");
2027 modifications.put("O2G", "GLY");
2028 modifications.put("OAD", "ASN");
2029 modifications.put("OAS", "SER");
2030 modifications.put("OBF", "XAA");
2031 modifications.put("OBS", "XAA");
2032 modifications.put("OCS", "CYS");
2033 modifications.put("OCY", "CYS");
2034 modifications.put("ODP", "ASN");
2035 modifications.put("OHI", "HIS");
2036 modifications.put("OHS", "ASP");
2037 modifications.put("OIC", "XAA");
2038 modifications.put("OIP", "ILE");
2039 modifications.put("OLE", "XAA");
2040 modifications.put("OLT", "THR");
2041 modifications.put("OLZ", "SER");
2042 modifications.put("OMC", "CYS");
2043 modifications.put("OMG", "GLY");
2044 modifications.put("OMT", "MET");
2045 modifications.put("OMU", "UR3");
2046 modifications.put("ONE", "UR3");
2047 modifications.put("ONH", "ALA");
2048 modifications.put("ONL", "XAA");
2049 modifications.put("OPR", "ARG");
2050 modifications.put("ORN", "ALA");
2051 modifications.put("ORQ", "ARG");
2052 modifications.put("OSE", "SER");
2053 modifications.put("OTB", "XAA");
2054 modifications.put("OTH", "THR");
2055 modifications.put("OTY", "TYR");
2056 modifications.put("OXX", "ASP");
2057 modifications.put("P ", "GLY");
2058 modifications.put("P1L", "CYS");
2059 modifications.put("P1P", "ASN");
2060 modifications.put("P2T", "THR");
2061 modifications.put("P2U", "UR3");
2062 modifications.put("P2Y", "PRO");
2063 modifications.put("P5P", "ALA");
2064 modifications.put("PAQ", "TYR");
2065 modifications.put("PAS", "ASP");
2066 modifications.put("PAT", "TRP");
2067 modifications.put("PAU", "ALA");
2068 modifications.put("PBB", "CYS");
2069 modifications.put("PBF", "PHE");
2070 modifications.put("PBT", "ASN");
2071 modifications.put("PCA", "GLU");
2072 modifications.put("PCC", "PRO");
2073 modifications.put("PCE", "XAA");
2074 modifications.put("PCS", "PHE");
2075 modifications.put("PDL", "XAA");
2076 modifications.put("PDU", "UR3");
2077 modifications.put("PEC", "CYS");
2078 modifications.put("PF5", "PHE");
2079 modifications.put("PFF", "PHE");
2080 modifications.put("PFX", "XAA");
2081 modifications.put("PG1", "SER");
2082 modifications.put("PG7", "GLY");
2083 modifications.put("PG9", "GLY");
2084 modifications.put("PGL", "XAA");
2085 modifications.put("PGN", "GLY");
2086 modifications.put("PGP", "GLY");
2087 modifications.put("PGY", "GLY");
2088 modifications.put("PHA", "PHE");
2089 modifications.put("PHD", "ASP");
2090 modifications.put("PHE", "PHE");
2091 modifications.put("PHI", "PHE");
2092 modifications.put("PHL", "PHE");
2093 modifications.put("PHM", "PHE");
2094 modifications.put("PIA", "AYG");
2095 modifications.put("PIV", "XAA");
2096 modifications.put("PLE", "LEU");
2097 modifications.put("PM3", "PHE");
2098 modifications.put("PMT", "CYS");
2099 modifications.put("POM", "PRO");
2100 modifications.put("PPN", "PHE");
2101 modifications.put("PPU", "ALA");
2102 modifications.put("PPW", "GLY");
2103 modifications.put("PQ1", "ASN");
2104 modifications.put("PR3", "CYS");
2105 modifications.put("PR5", "ALA");
2106 modifications.put("PR9", "PRO");
2107 modifications.put("PRN", "ALA");
2108 modifications.put("PRO", "PRO");
2109 modifications.put("PRS", "PRO");
2110 modifications.put("PSA", "PHE");
2111 modifications.put("PSH", "HIS");
2112 modifications.put("PST", "THR");
2113 modifications.put("PSU", "UR3");
2114 modifications.put("PSW", "CYS");
2115 modifications.put("PTA", "XAA");
2116 modifications.put("PTH", "TYR");
2117 modifications.put("PTM", "TYR");
2118 modifications.put("PTR", "TYR");
2119 modifications.put("PU ", "ALA");
2120 modifications.put("PUY", "ASN");
2121 modifications.put("PVH", "HIS");
2122 modifications.put("PVL", "XAA");
2123 modifications.put("PYA", "ALA");
2124 modifications.put("PYO", "UR3");
2125 modifications.put("PYX", "CYS");
2126 modifications.put("PYY", "ASN");
2127 modifications.put("QLG", "QLG");
2128 modifications.put("QMM", "GLN");
2129 modifications.put("QPA", "CYS");
2130 modifications.put("QPH", "PHE");
2131 modifications.put("QUO", "GLY");
2132 modifications.put("R ", "ALA");
2133 modifications.put("R1A", "CYS");
2134 modifications.put("R4K", "TRP");
2135 modifications.put("RC7", "HYG");
2136 modifications.put("RE0", "TRP");
2137 modifications.put("RE3", "TRP");
2138 modifications.put("RIA", "ALA");
2139 modifications.put("RMP", "ALA");
2140 modifications.put("RON", "XAA");
2141 modifications.put("RT ", "THR");
2142 modifications.put("RTP", "ASN");
2143 modifications.put("S1H", "SER");
2144 modifications.put("S2C", "CYS");
2145 modifications.put("S2D", "ALA");
2146 modifications.put("S2M", "THR");
2147 modifications.put("S2P", "ALA");
2148 modifications.put("S4A", "ALA");
2149 modifications.put("S4C", "CYS");
2150 modifications.put("S4G", "GLY");
2151 modifications.put("S4U", "UR3");
2152 modifications.put("S6G", "GLY");
2153 modifications.put("SAC", "SER");
2154 modifications.put("SAH", "CYS");
2155 modifications.put("SAR", "GLY");
2156 modifications.put("SBL", "SER");
2157 modifications.put("SC ", "CYS");
2158 modifications.put("SCH", "CYS");
2159 modifications.put("SCS", "CYS");
2160 modifications.put("SCY", "CYS");
2161 modifications.put("SD2", "XAA");
2162 modifications.put("SDG", "GLY");
2163 modifications.put("SDP", "SER");
2164 modifications.put("SEB", "SER");
2165 modifications.put("SEC", "ALA");
2166 modifications.put("SEG", "ALA");
2167 modifications.put("SEL", "SER");
2168 modifications.put("SEM", "SER");
2169 modifications.put("SEN", "SER");
2170 modifications.put("SEP", "SER");
2171 modifications.put("SER", "SER");
2172 modifications.put("SET", "SER");
2173 modifications.put("SGB", "SER");
2174 modifications.put("SHC", "CYS");
2175 modifications.put("SHP", "GLY");
2176 modifications.put("SHR", "LYS");
2177 modifications.put("SIB", "CYS");
2178 modifications.put("SIC", "DC"); // check
2179 modifications.put("SLA", "PRO");
2180 modifications.put("SLR", "PRO");
2181 modifications.put("SLZ", "LYS");
2182 modifications.put("SMC", "CYS");
2183 modifications.put("SME", "MET");
2184 modifications.put("SMF", "PHE");
2185 modifications.put("SMP", "ALA");
2186 modifications.put("SMT", "THR");
2187 modifications.put("SNC", "CYS");
2188 modifications.put("SNN", "ASN");
2189 modifications.put("SOC", "CYS");
2190 modifications.put("SOS", "ASN");
2191 modifications.put("SOY", "SER");
2192 modifications.put("SPT", "THR");
2193 modifications.put("SRA", "ALA");
2194 modifications.put("SSU", "UR3");
2195 modifications.put("STY", "TYR");
2196 modifications.put("SUB", "XAA");
2197 modifications.put("SUI", "DG");
2198 modifications.put("SUN", "SER");
2199 modifications.put("SUR", "UR3");
2200 modifications.put("SVA", "SER");
2201 modifications.put("SVV", "SER");
2202 modifications.put("SVW", "SER");
2203 modifications.put("SVX", "SER");
2204 modifications.put("SVY", "SER");
2205 modifications.put("SVZ", "XAA");
2206 modifications.put("SWG", "SWG");
2207 modifications.put("SYS", "CYS");
2208 modifications.put("T ", "THR");
2209 modifications.put("T11", "PHE");
2210 modifications.put("T23", "THR");
2211 modifications.put("T2S", "THR");
2212 modifications.put("T2T", "ASN");
2213 modifications.put("T31", "UR3");
2214 modifications.put("T32", "THR");
2215 modifications.put("T36", "THR");
2216 modifications.put("T37", "THR");
2217 modifications.put("T38", "THR");
2218 modifications.put("T39", "THR");
2219 modifications.put("T3P", "THR");
2220 modifications.put("T41", "THR");
2221 modifications.put("T48", "THR");
2222 modifications.put("T49", "THR");
2223 modifications.put("T4S", "THR");
2224 modifications.put("T5O", "UR3");
2225 modifications.put("T5S", "THR");
2226 modifications.put("T66", "XAA");
2227 modifications.put("T6A", "ALA");
2228 modifications.put("TA3", "THR");
2229 modifications.put("TA4", "XAA");
2230 modifications.put("TAF", "THR");
2231 modifications.put("TAL", "ASN");
2232 modifications.put("TAV", "ASP");
2233 modifications.put("TBG", "VAL");
2234 modifications.put("TBM", "THR");
2235 modifications.put("TC1", "CYS");
2236 modifications.put("TCP", "THR");
2237 modifications.put("TCQ", "TYR");
2238 modifications.put("TCR", "TRP");
2239 modifications.put("TCY", "ALA");
2240 modifications.put("TDD", "LEU");
2241 modifications.put("TDY", "THR");
2242 modifications.put("TFE", "THR");
2243 modifications.put("TFO", "ALA");
2244 modifications.put("TFQ", "PHE");
2245 modifications.put("TFT", "THR");
2246 modifications.put("TGP", "GLY");
2247 modifications.put("TH6", "THR");
2248 modifications.put("THC", "THR");
2249 modifications.put("THO", "XAA");
2250 modifications.put("THR", "THR");
2251 modifications.put("THX", "ASN");
2252 modifications.put("THZ", "ARG");
2253 modifications.put("TIH", "ALA");
2254 modifications.put("TLB", "ASN");
2255 modifications.put("TLC", "THR");
2256 modifications.put("TLN", "UR3");
2257 modifications.put("TMB", "THR");
2258 modifications.put("TMD", "THR");
2259 modifications.put("TNB", "CYS");
2260 modifications.put("TNR", "SER");
2261 modifications.put("TOX", "TRP");
2262 modifications.put("TP1", "THR");
2263 modifications.put("TPC", "CYS");
2264 modifications.put("TPG", "GLY");
2265 modifications.put("TPH", "XAA");
2266 modifications.put("TPL", "TRP");
2267 modifications.put("TPO", "THR");
2268 modifications.put("TPQ", "TYR");
2269 modifications.put("TQI", "TRP");
2270 modifications.put("TQQ", "TRP");
2271 modifications.put("TRF", "TRP");
2272 modifications.put("TRG", "LYS");
2273 modifications.put("TRN", "TRP");
2274 modifications.put("TRO", "TRP");
2275 modifications.put("TRP", "TRP");
2276 modifications.put("TRQ", "TRP");
2277 modifications.put("TRW", "TRP");
2278 modifications.put("TRX", "TRP");
2279 modifications.put("TS ", "ASN");
2280 modifications.put("TST", "XAA");
2281 modifications.put("TT ", "ASN");
2282 modifications.put("TTD", "THR");
2283 modifications.put("TTI", "UR3");
2284 modifications.put("TTM", "THR");
2285 modifications.put("TTQ", "TRP");
2286 modifications.put("TTS", "TYR");
2287 modifications.put("TY1", "TYR");
2288 modifications.put("TY2", "TYR");
2289 modifications.put("TY3", "TYR");
2290 modifications.put("TY5", "TYR");
2291 modifications.put("TYB", "TYR");
2292 modifications.put("TYI", "TYR");
2293 modifications.put("TYJ", "TYR");
2294 modifications.put("TYN", "TYR");
2295 modifications.put("TYO", "TYR");
2296 modifications.put("TYQ", "TYR");
2297 modifications.put("TYR", "TYR");
2298 modifications.put("TYS", "TYR");
2299 modifications.put("TYT", "TYR");
2300 modifications.put("TYU", "ASN");
2301 modifications.put("TYW", "TYR");
2302 modifications.put("TYX", "XAA");
2303 modifications.put("TYY", "TYR");
2304 modifications.put("TZB", "XAA");
2305 modifications.put("TZO", "XAA");
2306 modifications.put("U ", "UR3");
2307 modifications.put("U25", "UR3");
2308 modifications.put("U2L", "UR3");
2309 modifications.put("U2N", "UR3");
2310 modifications.put("U2P", "UR3");
2311 modifications.put("U31", "UR3");
2312 modifications.put("U33", "UR3");
2313 modifications.put("U34", "UR3");
2314 modifications.put("U36", "UR3");
2315 modifications.put("U37", "UR3");
2316 modifications.put("U8U", "UR3");
2317 modifications.put("UAR", "UR3");
2318 modifications.put("UCL", "UR3");
2319 modifications.put("UD5", "UR3");
2320 modifications.put("UDP", "ASN");
2321 modifications.put("UFP", "ASN");
2322 modifications.put("UFR", "UR3");
2323 modifications.put("UFT", "UR3");
2324 modifications.put("UMA", "ALA");
2325 modifications.put("UMP", "UR3");
2326 modifications.put("UMS", "UR3");
2327 modifications.put("UN1", "XAA");
2328 modifications.put("UN2", "XAA");
2329 modifications.put("UNK", "XAA");
2330 modifications.put("UR3", "UR3");
2331 modifications.put("URD", "UR3");
2332 modifications.put("US1", "UR3");
2333 modifications.put("US2", "UR3");
2334 modifications.put("US3", "THR");
2335 modifications.put("US5", "UR3");
2336 modifications.put("USM", "UR3");
2337 modifications.put("VAD", "VAL");
2338 modifications.put("VAF", "VAL");
2339 modifications.put("VAL", "VAL");
2340 modifications.put("VB1", "LYS");
2341 modifications.put("VDL", "XAA");
2342 modifications.put("VLL", "XAA");
2343 modifications.put("VLM", "XAA");
2344 modifications.put("VMS", "XAA");
2345 modifications.put("VOL", "XAA");
2346 modifications.put("WCR", "GYG");
2347 modifications.put("X ", "GLY");
2348 modifications.put("X2W", "GLU");
2349 modifications.put("X4A", "ASN");
2350 modifications.put("X9Q", "AFG");
2351 modifications.put("XAD", "ALA");
2352 modifications.put("XAE", "ASN");
2353 modifications.put("XAL", "ALA");
2354 modifications.put("XAR", "ASN");
2355 modifications.put("XCL", "CYS");
2356 modifications.put("XCN", "CYS");
2357 modifications.put("XCP", "XAA");
2358 modifications.put("XCR", "CYS");
2359 modifications.put("XCS", "ASN");
2360 modifications.put("XCT", "CYS");
2361 modifications.put("XCY", "CYS");
2362 modifications.put("XGA", "ASN");
2363 modifications.put("XGL", "GLY");
2364 modifications.put("XGR", "GLY");
2365 modifications.put("XGU", "GLY");
2366 modifications.put("XPR", "PRO");
2367 modifications.put("XSN", "ASN");
2368 modifications.put("XTH", "THR");
2369 modifications.put("XTL", "THR");
2370 modifications.put("XTR", "THR");
2371 modifications.put("XTS", "GLY");
2372 modifications.put("XTY", "ASN");
2373 modifications.put("XUA", "ALA");
2374 modifications.put("XUG", "GLY");
2375 modifications.put("XX1", "LYS");
2376 modifications.put("XXY", "THG");
2377 modifications.put("XYG", "DYG");
2378 modifications.put("Y ", "ALA");
2379 modifications.put("YCM", "CYS");
2380 modifications.put("YG ", "GLY");
2381 modifications.put("YOF", "TYR");
2382 modifications.put("YRR", "ASN");
2383 modifications.put("YYG", "GLY");
2384 modifications.put("Z ", "CYS");
2385 modifications.put("Z01", "ALA");
2386 modifications.put("ZAD", "ALA");
2387 modifications.put("ZAL", "ALA");
2388 modifications.put("ZBC", "CYS");
2389 modifications.put("ZBU", "UR3");
2390 modifications.put("ZCL", "PHE");
2391 modifications.put("ZCY", "CYS");
2392 modifications.put("ZDU", "UR3");
2393 modifications.put("ZFB", "XAA");
2394 modifications.put("ZGU", "GLY");
2395 modifications.put("ZHP", "ASN");
2396 modifications.put("ZTH", "THR");
2397 modifications.put("ZU0", "THR");
2398 modifications.put("ZZJ", "ALA");
2402 public static String getCanonicalAminoAcid(String aA)
2404 String canonical = modifications.get(aA);
2405 return canonical == null ? aA : canonical;
2408 // main method generates perl representation of residue property hash
2414 public static void main(String[] args)
2416 Hashtable<String, Vector<String>> aaProps = new Hashtable<>();
2417 System.out.println("my %aa = {");
2418 // invert property hashes
2419 for (String pname : propHash.keySet())
2421 Map<String, Integer> phash = propHash.get(pname);
2422 for (String rname : phash.keySet())
2424 Vector<String> aprops = aaProps.get(rname);
2427 aprops = new Vector<>();
2428 aaProps.put(rname, aprops);
2430 Integer hasprop = phash.get(rname);
2431 if (hasprop.intValue() == 1)
2433 aprops.addElement(pname);
2437 Enumeration<String> res = aaProps.keys();
2438 while (res.hasMoreElements())
2440 String rname = res.nextElement();
2442 System.out.print("'" + rname + "' => [");
2443 Enumeration<String> props = aaProps.get(rname).elements();
2444 while (props.hasMoreElements())
2446 System.out.print("'" + props.nextElement() + "'");
2447 if (props.hasMoreElements())
2449 System.out.println(", ");
2452 System.out.println("]" + (res.hasMoreElements() ? "," : ""));
2454 System.out.println("};");
2460 * Returns a list of residue characters for the specified inputs
2462 * @param forNucleotide
2463 * @param includeAmbiguous
2466 public static List<String> getResidues(boolean forNucleotide,
2467 boolean includeAmbiguous)
2469 List<String> result = new ArrayList<>();
2472 for (String nuc : nucleotideName.keySet())
2474 int val = nucleotideIndex[nuc.charAt(0)];
2475 if ((!includeAmbiguous && val > 4) || (val >= maxNucleotideIndex))
2479 nuc = nuc.toUpperCase(Locale.ROOT);
2480 if (!result.contains(nuc))
2491 for (String res : aa3Hash.keySet())
2493 int index = aa3Hash.get(res).intValue();
2494 if ((!includeAmbiguous && index >= 20) || index >= maxProteinIndex)
2498 res = res.toUpperCase(Locale.ROOT);
2499 if (!result.contains(res))
2510 * Returns the single letter code for a three letter code, or '0' if not known
2512 * @param threeLetterCode
2513 * not case sensitive
2516 public static char getSingleCharacterCode(String threeLetterCode)
2518 if (threeLetterCode == null)
2522 Integer index = ResidueProperties.aa3Hash
2523 .get(threeLetterCode.toUpperCase(Locale.ROOT));
2524 return index == null ? '0' : aa[index].charAt(0);