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