Clover icon

Coverage Report

  1. Project Clover database Wed Dec 10 2025 18:09:41 GMT
  2. Package jalview.schemes

File ResidueProperties.java

Code metrics

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