Clover icon

jalviewX

  1. Project Clover database Wed Oct 31 2018 15:13:58 GMT
  2. Package jalview.schemes

File ResidueProperties.java

 

Coverage histogram

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

Code metrics

102
1,975
32
1
2,640
2,373
95
0.05
61.72
32
2.97

Classes

Class Line # Actions
ResidueProperties 33 1,975 95 59
0.972024797.2%
 

Contributing tests

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