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