Clover icon

Coverage Report

  1. Project Clover database Mon Nov 11 2024 17:27:16 GMT
  2. Package jalview.schemes

File ResidueProperties.java

 

Coverage histogram

../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

74
1,799
31
1
2,548
2,303
76
0.04
58.03
31
2.45

Classes

Class Line # Actions
ResidueProperties 36 1,799 76
0.974789997.5%
 

Contributing tests

This file is covered by 91 tests. .

Source view

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