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