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 List<String> STOP = Arrays.asList("TGA", "TAA", "TAG");
630 public static String START = "ATG";
633 * Nucleotide Ambiguity Codes
635 public static final Map<String, String[]> ambiguityCodes = new Hashtable<String, String[]>();
638 * Codon triplets with additional symbols for unambiguous codons that include
641 public static final Hashtable<String, String> codonHash2 = new Hashtable<String, String>();
644 * all ambiguity codes for a given base
646 public final static Hashtable<String, List<String>> _ambiguityCodes = new Hashtable<String, List<String>>();
651 * Ambiguity codes as per http://www.chem.qmul.ac.uk/iubmb/misc/naseq.html
653 ambiguityCodes.put("R", new String[] { "A", "G" });
654 ambiguityCodes.put("Y", new String[] { "T", "C" });
655 ambiguityCodes.put("W", new String[] { "A", "T" });
656 ambiguityCodes.put("S", new String[] { "G", "C" });
657 ambiguityCodes.put("M", new String[] { "A", "C" });
658 ambiguityCodes.put("K", new String[] { "G", "T" });
659 ambiguityCodes.put("H", new String[] { "A", "T", "C" });
660 ambiguityCodes.put("B", new String[] { "G", "T", "C" });
661 ambiguityCodes.put("V", new String[] { "G", "A", "C" });
662 ambiguityCodes.put("D", new String[] { "G", "A", "T" });
663 ambiguityCodes.put("N", new String[] { "G", "A", "T", "C" });
665 // Now build codon translation table
666 codonHash2.put("AAA", "K");
667 codonHash2.put("AAG", "K");
668 codonHash2.put("AAC", "N");
669 codonHash2.put("AAT", "N");
671 codonHash2.put("CAA", "Q");
672 codonHash2.put("CAG", "Q");
673 codonHash2.put("CAC", "H");
674 codonHash2.put("CAT", "H");
676 codonHash2.put("GAA", "E");
677 codonHash2.put("GAG", "E");
678 codonHash2.put("GAC", "D");
679 codonHash2.put("GAT", "D");
681 codonHash2.put("TAC", "Y");
682 codonHash2.put("TAT", "Y");
684 codonHash2.put("ACA", "T");
685 codonHash2.put("ACC", "T");
686 codonHash2.put("ACT", "T");
687 codonHash2.put("ACG", "T");
689 codonHash2.put("CCA", "P");
690 codonHash2.put("CCG", "P");
691 codonHash2.put("CCC", "P");
692 codonHash2.put("CCT", "P");
694 codonHash2.put("GCA", "A");
695 codonHash2.put("GCG", "A");
696 codonHash2.put("GCC", "A");
697 codonHash2.put("GCT", "A");
699 codonHash2.put("TCA", "S");
700 codonHash2.put("TCG", "S");
701 codonHash2.put("TCC", "S");
702 codonHash2.put("TCT", "S");
703 codonHash2.put("AGC", "S");
704 codonHash2.put("AGT", "S");
706 codonHash2.put("AGA", "R");
707 codonHash2.put("AGG", "R");
708 codonHash2.put("CGA", "R");
709 codonHash2.put("CGG", "R");
710 codonHash2.put("CGC", "R");
711 codonHash2.put("CGT", "R");
713 codonHash2.put("GGA", "G");
714 codonHash2.put("GGG", "G");
715 codonHash2.put("GGC", "G");
716 codonHash2.put("GGT", "G");
718 codonHash2.put("TGA", "*");
719 codonHash2.put("TAA", "*");
720 codonHash2.put("TAG", "*");
722 codonHash2.put("TGG", "W");
724 codonHash2.put("TGC", "C");
725 codonHash2.put("TGT", "C");
727 codonHash2.put("ATA", "I");
728 codonHash2.put("ATC", "I");
729 codonHash2.put("ATT", "I");
731 codonHash2.put("ATG", "M");
733 codonHash2.put("CTA", "L");
734 codonHash2.put("CTG", "L");
735 codonHash2.put("CTC", "L");
736 codonHash2.put("CTT", "L");
737 codonHash2.put("TTA", "L");
738 codonHash2.put("TTG", "L");
740 codonHash2.put("GTA", "V");
741 codonHash2.put("GTG", "V");
742 codonHash2.put("GTC", "V");
743 codonHash2.put("GTT", "V");
745 codonHash2.put("TTC", "F");
746 codonHash2.put("TTT", "F");
748 buildAmbiguityCodonSet();
752 * programmatic generation of codons including ambiguity codes
754 public static void buildAmbiguityCodonSet()
756 if (_ambiguityCodes.size() > 0)
759 .println("Ignoring multiple calls to buildAmbiguityCodonSet");
762 // Invert the ambiguity code set
763 for (Map.Entry<String, String[]> acode : ambiguityCodes.entrySet())
765 for (String r : acode.getValue())
767 List<String> codesfor = _ambiguityCodes.get(r);
768 if (codesfor == null)
770 _ambiguityCodes.put(r, codesfor = new ArrayList<String>());
772 if (!codesfor.contains(acode.getKey()))
774 codesfor.add(acode.getKey());
779 .println("Inconsistency in the IUBMB ambiguity code nomenclature table: collision for "
780 + acode.getKey() + " in residue " + r);
784 // and programmatically add in the ambiguity codes that yield the same amino
786 String[] unambcodons = codonHash2.keySet().toArray(
787 new String[codonHash2.size()]);
788 for (String codon : unambcodons)
790 String residue = codonHash2.get(codon);
791 String acodon[][] = new String[codon.length()][];
792 for (int i = 0, iSize = codon.length(); i < iSize; i++)
794 String _ac = "" + codon.charAt(i);
795 List<String> acodes = _ambiguityCodes.get(_ac);
798 acodon[i] = acodes.toArray(new String[acodes.size()]);
802 acodon[i] = new String[] {};
805 // enumerate all combinations and test for veracity of translation
806 int tpos[] = new int[codon.length()], cpos[] = new int[codon.length()];
807 for (int i = 0; i < tpos.length; i++)
811 tpos[acodon.length - 1] = 0;
813 while (tpos[0] < acodon[0].length)
815 // make all codons for this combination
816 char allres[][] = new char[tpos.length][];
818 for (ipos = 0; ipos < tpos.length; ipos++)
820 if (acodon[ipos].length == 0 || tpos[ipos] < 0)
822 _acodon += codon.charAt(ipos);
823 allres[ipos] = new char[] { codon.charAt(ipos) };
827 _acodon += acodon[ipos][tpos[ipos]];
828 String[] altbase = ambiguityCodes.get(acodon[ipos][tpos[ipos]]);
829 allres[ipos] = new char[altbase.length];
831 for (String ab : altbase)
833 allres[ipos][j++] = ab.charAt(0);
837 // test all codons for this combination
838 for (ipos = 0; ipos < cpos.length; ipos++)
842 boolean valid = true;
846 for (j = 0; j < cpos.length; j++)
848 _codon += allres[j][cpos[j]];
850 String tr = codonHash2.get(_codon);
851 if (valid = (tr != null && tr.equals(residue)))
853 // advance to next combination
854 ipos = acodon.length - 1;
855 while (++cpos[ipos] >= allres[ipos].length && ipos > 0)
861 } while (valid && cpos[0] < allres[0].length);
864 // Add this to the set of codons we will translate
865 // System.out.println("Adding ambiguity codon: " + _acodon + " for "
867 codonHash2.put(_acodon, residue);
871 // System.err.println("Rejecting ambiguity codon: " + _acodon
872 // + " for " + residue);
875 ipos = acodon.length - 1;
876 while (++tpos[ipos] >= acodon[ipos].length && ipos > 0)
885 // Stores residue codes/names and colours and other things
886 public static Map<String, Map<String, Integer>> propHash = new Hashtable<String, Map<String, Integer>>();
888 public static Map<String, Integer> hydrophobic = new Hashtable<String, Integer>();
890 public static Map<String, Integer> polar = new Hashtable<String, Integer>();
892 public static Map<String, Integer> small = new Hashtable<String, Integer>();
894 public static Map<String, Integer> positive = new Hashtable<String, Integer>();
896 public static Map<String, Integer> negative = new Hashtable<String, Integer>();
898 public static Map<String, Integer> charged = new Hashtable<String, Integer>();
900 public static Map<String, Integer> aromatic = new Hashtable<String, Integer>();
902 public static Map<String, Integer> aliphatic = new Hashtable<String, Integer>();
904 public static Map<String, Integer> tiny = new Hashtable<String, Integer>();
906 public static Map<String, Integer> proline = new Hashtable<String, Integer>();
910 hydrophobic.put("I", ONE);
911 hydrophobic.put("L", ONE);
912 hydrophobic.put("V", ONE);
913 hydrophobic.put("C", ONE);
914 hydrophobic.put("A", ONE);
915 hydrophobic.put("G", ONE);
916 hydrophobic.put("M", ONE);
917 hydrophobic.put("F", ONE);
918 hydrophobic.put("Y", ONE);
919 hydrophobic.put("W", ONE);
920 hydrophobic.put("H", ONE);
921 hydrophobic.put("K", ONE);
922 hydrophobic.put("X", ONE);
923 hydrophobic.put("-", ONE);
924 hydrophobic.put("*", ONE);
925 hydrophobic.put("R", ZERO);
926 hydrophobic.put("E", ZERO);
927 hydrophobic.put("Q", ZERO);
928 hydrophobic.put("D", ZERO);
929 hydrophobic.put("N", ZERO);
930 hydrophobic.put("S", ZERO);
931 hydrophobic.put("T", ONE);
932 hydrophobic.put("P", ZERO);
951 polar.put("I", ZERO);
952 polar.put("L", ZERO);
953 polar.put("V", ZERO);
954 polar.put("C", ZERO);
955 polar.put("A", ZERO);
956 polar.put("G", ZERO);
957 polar.put("M", ZERO);
958 polar.put("F", ZERO);
959 polar.put("P", ZERO);
964 small.put("I", ZERO);
965 small.put("L", ZERO);
970 small.put("M", ZERO);
971 small.put("F", ZERO);
972 small.put("Y", ZERO);
973 small.put("W", ZERO);
974 small.put("H", ZERO);
975 small.put("K", ZERO);
976 small.put("R", ZERO);
977 small.put("E", ZERO);
978 small.put("Q", ZERO);
990 positive.put("I", ZERO);
991 positive.put("L", ZERO);
992 positive.put("V", ZERO);
993 positive.put("C", ZERO);
994 positive.put("A", ZERO);
995 positive.put("G", ZERO);
996 positive.put("M", ZERO);
997 positive.put("F", ZERO);
998 positive.put("Y", ZERO);
999 positive.put("W", ZERO);
1000 positive.put("H", ONE);
1001 positive.put("K", ONE);
1002 positive.put("R", ONE);
1003 positive.put("E", ZERO);
1004 positive.put("Q", ZERO);
1005 positive.put("D", ZERO);
1006 positive.put("N", ZERO);
1007 positive.put("S", ZERO);
1008 positive.put("T", ZERO);
1009 positive.put("P", ZERO);
1010 positive.put("-", ONE);
1011 positive.put("*", ONE);
1016 negative.put("I", ZERO);
1017 negative.put("L", ZERO);
1018 negative.put("V", ZERO);
1019 negative.put("C", ZERO);
1020 negative.put("A", ZERO);
1021 negative.put("G", ZERO);
1022 negative.put("M", ZERO);
1023 negative.put("F", ZERO);
1024 negative.put("Y", ZERO);
1025 negative.put("W", ZERO);
1026 negative.put("H", ZERO);
1027 negative.put("K", ZERO);
1028 negative.put("R", ZERO);
1029 negative.put("E", ONE);
1030 negative.put("Q", ZERO);
1031 negative.put("D", ONE);
1032 negative.put("N", ZERO);
1033 negative.put("S", ZERO);
1034 negative.put("T", ZERO);
1035 negative.put("P", ZERO);
1036 negative.put("-", ONE);
1037 negative.put("*", ONE);
1042 charged.put("I", ZERO);
1043 charged.put("L", ZERO);
1044 charged.put("V", ZERO);
1045 charged.put("C", ZERO);
1046 charged.put("A", ZERO);
1047 charged.put("G", ZERO);
1048 charged.put("M", ZERO);
1049 charged.put("F", ZERO);
1050 charged.put("Y", ZERO);
1051 charged.put("W", ZERO);
1052 charged.put("H", ONE);
1053 charged.put("K", ONE);
1054 charged.put("R", ONE);
1055 charged.put("E", ONE);
1056 charged.put("Q", ZERO);
1057 charged.put("D", ONE);
1058 charged.put("N", ZERO); // Asparagine is polar but not
1060 // Alternative would be charged and
1061 // negative (in basic form)?
1062 charged.put("S", ZERO);
1063 charged.put("T", ZERO);
1064 charged.put("P", ZERO);
1065 charged.put("-", ONE);
1066 charged.put("*", ONE);
1071 aromatic.put("I", ZERO);
1072 aromatic.put("L", ZERO);
1073 aromatic.put("V", ZERO);
1074 aromatic.put("C", ZERO);
1075 aromatic.put("A", ZERO);
1076 aromatic.put("G", ZERO);
1077 aromatic.put("M", ZERO);
1078 aromatic.put("F", ONE);
1079 aromatic.put("Y", ONE);
1080 aromatic.put("W", ONE);
1081 aromatic.put("H", ONE);
1082 aromatic.put("K", ZERO);
1083 aromatic.put("R", ZERO);
1084 aromatic.put("E", ZERO);
1085 aromatic.put("Q", ZERO);
1086 aromatic.put("D", ZERO);
1087 aromatic.put("N", ZERO);
1088 aromatic.put("S", ZERO);
1089 aromatic.put("T", ZERO);
1090 aromatic.put("P", ZERO);
1091 aromatic.put("-", ONE);
1092 aromatic.put("*", ONE);
1097 aliphatic.put("I", ONE);
1098 aliphatic.put("L", ONE);
1099 aliphatic.put("V", ONE);
1100 aliphatic.put("C", ZERO);
1101 aliphatic.put("A", ZERO);
1102 aliphatic.put("G", ZERO);
1103 aliphatic.put("M", ZERO);
1104 aliphatic.put("F", ZERO);
1105 aliphatic.put("Y", ZERO);
1106 aliphatic.put("W", ZERO);
1107 aliphatic.put("H", ZERO);
1108 aliphatic.put("K", ZERO);
1109 aliphatic.put("R", ZERO);
1110 aliphatic.put("E", ZERO);
1111 aliphatic.put("Q", ZERO);
1112 aliphatic.put("D", ZERO);
1113 aliphatic.put("N", ZERO);
1114 aliphatic.put("S", ZERO);
1115 aliphatic.put("T", ZERO);
1116 aliphatic.put("P", ZERO);
1117 aliphatic.put("-", ONE);
1118 aliphatic.put("*", ONE);
1123 tiny.put("I", ZERO);
1124 tiny.put("L", ZERO);
1125 tiny.put("V", ZERO);
1126 tiny.put("C", ZERO);
1129 tiny.put("M", ZERO);
1130 tiny.put("F", ZERO);
1131 tiny.put("Y", ZERO);
1132 tiny.put("W", ZERO);
1133 tiny.put("H", ZERO);
1134 tiny.put("K", ZERO);
1135 tiny.put("R", ZERO);
1136 tiny.put("E", ZERO);
1137 tiny.put("Q", ZERO);
1138 tiny.put("D", ZERO);
1139 tiny.put("N", ZERO);
1141 tiny.put("T", ZERO);
1142 tiny.put("P", ZERO);
1149 proline.put("I", ZERO);
1150 proline.put("L", ZERO);
1151 proline.put("V", ZERO);
1152 proline.put("C", ZERO);
1153 proline.put("A", ZERO);
1154 proline.put("G", ZERO);
1155 proline.put("M", ZERO);
1156 proline.put("F", ZERO);
1157 proline.put("Y", ZERO);
1158 proline.put("W", ZERO);
1159 proline.put("H", ZERO);
1160 proline.put("K", ZERO);
1161 proline.put("R", ZERO);
1162 proline.put("E", ZERO);
1163 proline.put("Q", ZERO);
1164 proline.put("D", ZERO);
1165 proline.put("N", ZERO);
1166 proline.put("S", ZERO);
1167 proline.put("T", ZERO);
1168 proline.put("P", ONE);
1169 proline.put("-", ONE);
1170 proline.put("*", ONE);
1175 propHash.put("hydrophobic", hydrophobic);
1176 propHash.put("small", small);
1177 propHash.put("positive", positive);
1178 propHash.put("negative", negative);
1179 propHash.put("charged", charged);
1180 propHash.put("aromatic", aromatic);
1181 propHash.put("aliphatic", aliphatic);
1182 propHash.put("tiny", tiny);
1183 propHash.put("proline", proline);
1184 propHash.put("polar", polar);
1188 int[][] propMatrixF = new int[maxProteinIndex][maxProteinIndex], propMatrixPos = new int[maxProteinIndex][maxProteinIndex], propMatrixEpos = new int[maxProteinIndex][maxProteinIndex];
1189 for (int i = 0; i < maxProteinIndex; i++)
1191 int maxF = 0, maxP = 0, maxEP = 0;
1201 for (int j = i + 1; j < maxProteinIndex; j++)
1212 propMatrixF[i][j] = 0;
1213 propMatrixPos[i][j] = 0;
1214 propMatrixEpos[i][j] = 0;
1215 for (String ph : propHash.keySet())
1217 Map<String, Integer> pph = propHash.get(ph);
1218 if (pph.get(ic) != null && pph.get(jc) != null)
1220 int icp = pph.get(ic).intValue(), jcp = pph.get(jc).intValue();
1221 // Still working on these definitions.
1222 propMatrixPos[i][j] += icp == jcp && icp > 0 ? 2 : 0;
1223 propMatrixPos[j][i] += icp == jcp && icp > 0 ? 2 : 0;
1224 propMatrixF[i][j] += icp == jcp ? 2 : 0;
1225 propMatrixF[j][i] += icp == jcp ? 2 : 0;
1226 propMatrixEpos[i][j] += icp == jcp ? (1 + icp * 2) : 0;
1227 propMatrixEpos[j][i] += icp == jcp ? (1 + icp * 2) : 0;
1230 if (maxF < propMatrixF[i][j])
1232 maxF = propMatrixF[i][j];
1234 if (maxP < propMatrixPos[i][j])
1236 maxP = propMatrixPos[i][j];
1238 if (maxEP < propMatrixEpos[i][j])
1240 maxEP = propMatrixEpos[i][j];
1243 propMatrixF[i][i] = maxF;
1244 propMatrixPos[i][i] = maxP;
1245 propMatrixEpos[i][i] = maxEP;
1247 // JAL-1512 comment out physicochemical score matrices for 2.8.1 release
1248 // scoreMatrices.put("Conservation Pos", new
1249 // ScoreMatrix("Conservation Pos",propMatrixPos,0));
1250 // scoreMatrices.put("Conservation Both", new
1251 // ScoreMatrix("Conservation Both",propMatrixF,0));
1252 // scoreMatrices.put("Conservation EnhPos", new
1253 // ScoreMatrix("Conservation EnhPos",propMatrixEpos,0));
1254 scoreMatrices.put("PID", new PIDScoreModel());
1255 scoreMatrices.put("Displayed Features", new FeatureScoreModel());
1258 private ResidueProperties()
1262 public static double getHydmax()
1267 public static double getHydmin()
1272 public static double[] getHyd()
1277 public static Map<String, Integer> getAA3Hash()
1282 public static int[][] getDNA()
1284 return ResidueProperties.DNA;
1287 public static int[][] getBLOSUM62()
1289 return ResidueProperties.BLOSUM62;
1292 public static int getPAM250(String A1, String A2)
1294 return getPAM250(A1.charAt(0), A2.charAt(0));
1297 public static int getBLOSUM62(char c1, char c2)
1303 int a = aaIndex[c1];
1304 int b = aaIndex[c2];
1306 pog = ResidueProperties.BLOSUM62[a][b];
1307 } catch (Exception e)
1309 // System.out.println("Unknown residue in " + A1 + " " + A2);
1315 public static String codonTranslate(String lccodon)
1317 String cdn = codonHash2.get(lccodon.toUpperCase());
1318 if ("*".equals(cdn))
1325 public static int[][] getDefaultPeptideMatrix()
1327 return ResidueProperties.getBLOSUM62();
1330 public static int[][] getDefaultDnaMatrix()
1332 return ResidueProperties.getDNA();
1336 * get a ScoreMatrix based on its string name
1339 * @return matrix in scoreMatrices with key pwtype or null
1341 public static ScoreMatrix getScoreMatrix(String pwtype)
1343 Object val = scoreMatrices.get(pwtype);
1344 if (val != null && val instanceof ScoreMatrix)
1346 return (ScoreMatrix) val;
1352 * get a ScoreModel based on its string name
1355 * @return scoremodel of type pwtype or null
1357 public static ScoreModelI getScoreModel(String pwtype)
1359 return scoreMatrices.get(pwtype);
1362 public static int getPAM250(char c, char d)
1367 int pog = ResidueProperties.PAM250[a][b];
1372 public static Hashtable<String, String> toDssp3State;
1375 toDssp3State = new Hashtable<String, String>();
1376 toDssp3State.put("H", "H");
1377 toDssp3State.put("E", "E");
1378 toDssp3State.put("C", " ");
1379 toDssp3State.put(" ", " ");
1380 toDssp3State.put("T", " ");
1381 toDssp3State.put("B", "E");
1382 toDssp3State.put("G", "H");
1383 toDssp3State.put("I", "H");
1384 toDssp3State.put("X", " ");
1388 * translate from other dssp secondary structure alphabets to 3-state
1391 * @return ssstring as a three-state secondary structure assignment.
1393 public static String getDssp3state(String ssstring)
1395 if (ssstring == null)
1399 StringBuffer ss = new StringBuffer();
1400 for (int i = 0; i < ssstring.length(); i++)
1402 String ssc = ssstring.substring(i, i + 1);
1403 if (toDssp3State.containsKey(ssc))
1405 ss.append(toDssp3State.get(ssc));
1412 return ss.toString();
1417 modifications.put("MSE", "MET"); // Selenomethionine
1418 // the rest tbc; from
1419 // http://sourceforge.net/p/jmol/mailman/message/12833570/
1420 // modifications.put("CSE", "CYS"); // Selenocysteine
1421 // modifications.put("PTR", "TYR"); // Phosphotyrosine
1422 // modifications.put("SEP", "SER"); // Phosphoserine
1423 // modifications.put("HYP", "PRO"); // 4-hydroxyproline
1424 // modifications.put("5HP", "GLU"); // Pyroglutamic acid; 5-hydroxyproline
1425 // modifications.put("PCA", "GLU"); // Pyroglutamic acid
1426 // modifications.put("LYZ", "LYS"); // 5-hydroxylysine
1428 // Additional protein alphabets used in the SCOP database and PDB files
1430 // https://github.com/biopython/biopython/blob/master/Bio/Data/SCOPData.py
1431 modifications.put("00C", "CYS");
1432 modifications.put("01W", "XAA");
1433 modifications.put("02K", "ALA");
1434 modifications.put("03Y", "CYS");
1435 modifications.put("07O", "CYS");
1436 modifications.put("08P", "CYS");
1437 modifications.put("0A0", "ASP");
1438 modifications.put("0A1", "TYR");
1439 modifications.put("0A2", "LYS");
1440 modifications.put("0A8", "CYS");
1441 modifications.put("0AA", "VAL");
1442 modifications.put("0AB", "VAL");
1443 modifications.put("0AC", "GLY");
1444 modifications.put("0AD", "GLY");
1445 modifications.put("0AF", "TRP");
1446 modifications.put("0AG", "LEU");
1447 modifications.put("0AH", "SER");
1448 modifications.put("0AK", "ASP");
1449 modifications.put("0AM", "ALA");
1450 modifications.put("0AP", "CYS");
1451 modifications.put("0AU", "UR3");
1452 modifications.put("0AV", "ALA");
1453 modifications.put("0AZ", "PRO");
1454 modifications.put("0BN", "PHE");
1455 modifications.put("0C ", "CYS");
1456 modifications.put("0CS", "ALA");
1457 modifications.put("0DC", "CYS");
1458 modifications.put("0DG", "GLY");
1459 modifications.put("0DT", "THR");
1460 modifications.put("0FL", "ALA");
1461 modifications.put("0G ", "GLY");
1462 modifications.put("0NC", "ALA");
1463 modifications.put("0SP", "ALA");
1464 modifications.put("0U ", "UR3");
1465 modifications.put("0YG", "YG");
1466 modifications.put("10C", "CYS");
1467 modifications.put("125", "UR3");
1468 modifications.put("126", "UR3");
1469 modifications.put("127", "UR3");
1470 modifications.put("128", "ASN");
1471 modifications.put("12A", "ALA");
1472 modifications.put("143", "CYS");
1473 modifications.put("175", "ASG");
1474 modifications.put("193", "XAA");
1475 modifications.put("1AP", "ALA");
1476 modifications.put("1MA", "ALA");
1477 modifications.put("1MG", "GLY");
1478 modifications.put("1PA", "PHE");
1479 modifications.put("1PI", "ALA");
1480 modifications.put("1PR", "ASN");
1481 modifications.put("1SC", "CYS");
1482 modifications.put("1TQ", "TRP");
1483 modifications.put("1TY", "TYR");
1484 modifications.put("1X6", "SER");
1485 modifications.put("200", "PHE");
1486 modifications.put("23F", "PHE");
1487 modifications.put("23S", "XAA");
1488 modifications.put("26B", "THR");
1489 modifications.put("2AD", "XAA");
1490 modifications.put("2AG", "ALA");
1491 modifications.put("2AO", "XAA");
1492 modifications.put("2AR", "ALA");
1493 modifications.put("2AS", "XAA");
1494 modifications.put("2AT", "THR");
1495 modifications.put("2AU", "UR3");
1496 modifications.put("2BD", "ILE");
1497 modifications.put("2BT", "THR");
1498 modifications.put("2BU", "ALA");
1499 modifications.put("2CO", "CYS");
1500 modifications.put("2DA", "ALA");
1501 modifications.put("2DF", "ASN");
1502 modifications.put("2DM", "ASN");
1503 modifications.put("2DO", "XAA");
1504 modifications.put("2DT", "THR");
1505 modifications.put("2EG", "GLY");
1506 modifications.put("2FE", "ASN");
1507 modifications.put("2FI", "ASN");
1508 modifications.put("2FM", "MET");
1509 modifications.put("2GT", "THR");
1510 modifications.put("2HF", "HIS");
1511 modifications.put("2LU", "LEU");
1512 modifications.put("2MA", "ALA");
1513 modifications.put("2MG", "GLY");
1514 modifications.put("2ML", "LEU");
1515 modifications.put("2MR", "ARG");
1516 modifications.put("2MT", "PRO");
1517 modifications.put("2MU", "UR3");
1518 modifications.put("2NT", "THR");
1519 modifications.put("2OM", "UR3");
1520 modifications.put("2OT", "THR");
1521 modifications.put("2PI", "XAA");
1522 modifications.put("2PR", "GLY");
1523 modifications.put("2SA", "ASN");
1524 modifications.put("2SI", "XAA");
1525 modifications.put("2ST", "THR");
1526 modifications.put("2TL", "THR");
1527 modifications.put("2TY", "TYR");
1528 modifications.put("2VA", "VAL");
1529 modifications.put("2XA", "CYS");
1530 modifications.put("32S", "XAA");
1531 modifications.put("32T", "XAA");
1532 modifications.put("3AH", "HIS");
1533 modifications.put("3AR", "XAA");
1534 modifications.put("3CF", "PHE");
1535 modifications.put("3DA", "ALA");
1536 modifications.put("3DR", "ASN");
1537 modifications.put("3GA", "ALA");
1538 modifications.put("3MD", "ASP");
1539 modifications.put("3ME", "UR3");
1540 modifications.put("3NF", "TYR");
1541 modifications.put("3QN", "LYS");
1542 modifications.put("3TY", "XAA");
1543 modifications.put("3XH", "GLY");
1544 modifications.put("4AC", "ASN");
1545 modifications.put("4BF", "TYR");
1546 modifications.put("4CF", "PHE");
1547 modifications.put("4CY", "MET");
1548 modifications.put("4DP", "TRP");
1549 modifications.put("4F3", "GYG");
1550 modifications.put("4FB", "PRO");
1551 modifications.put("4FW", "TRP");
1552 modifications.put("4HT", "TRP");
1553 modifications.put("4IN", "TRP");
1554 modifications.put("4MF", "ASN");
1555 modifications.put("4MM", "XAA");
1556 modifications.put("4OC", "CYS");
1557 modifications.put("4PC", "CYS");
1558 modifications.put("4PD", "CYS");
1559 modifications.put("4PE", "CYS");
1560 modifications.put("4PH", "PHE");
1561 modifications.put("4SC", "CYS");
1562 modifications.put("4SU", "UR3");
1563 modifications.put("4TA", "ASN");
1564 modifications.put("4U7", "ALA");
1565 modifications.put("56A", "HIS");
1566 modifications.put("5AA", "ALA");
1567 modifications.put("5AB", "ALA");
1568 modifications.put("5AT", "THR");
1569 modifications.put("5BU", "UR3");
1570 modifications.put("5CG", "GLY");
1571 modifications.put("5CM", "CYS");
1572 modifications.put("5CS", "CYS");
1573 modifications.put("5FA", "ALA");
1574 modifications.put("5FC", "CYS");
1575 modifications.put("5FU", "UR3");
1576 modifications.put("5HP", "GLU");
1577 modifications.put("5HT", "THR");
1578 modifications.put("5HU", "UR3");
1579 modifications.put("5IC", "CYS");
1580 modifications.put("5IT", "THR");
1581 modifications.put("5IU", "UR3");
1582 modifications.put("5MC", "CYS");
1583 modifications.put("5MD", "ASN");
1584 modifications.put("5MU", "UR3");
1585 modifications.put("5NC", "CYS");
1586 modifications.put("5PC", "CYS");
1587 modifications.put("5PY", "THR");
1588 modifications.put("5SE", "UR3");
1589 modifications.put("5ZA", "TWG");
1590 modifications.put("64T", "THR");
1591 modifications.put("6CL", "LYS");
1592 modifications.put("6CT", "THR");
1593 modifications.put("6CW", "TRP");
1594 modifications.put("6HA", "ALA");
1595 modifications.put("6HC", "CYS");
1596 modifications.put("6HG", "GLY");
1597 modifications.put("6HN", "LYS");
1598 modifications.put("6HT", "THR");
1599 modifications.put("6IA", "ALA");
1600 modifications.put("6MA", "ALA");
1601 modifications.put("6MC", "ALA");
1602 modifications.put("6MI", "ASN");
1603 modifications.put("6MT", "ALA");
1604 modifications.put("6MZ", "ASN");
1605 modifications.put("6OG", "GLY");
1606 modifications.put("70U", "UR3");
1607 modifications.put("7DA", "ALA");
1608 modifications.put("7GU", "GLY");
1609 modifications.put("7JA", "ILE");
1610 modifications.put("7MG", "GLY");
1611 modifications.put("8AN", "ALA");
1612 modifications.put("8FG", "GLY");
1613 modifications.put("8MG", "GLY");
1614 modifications.put("8OG", "GLY");
1615 modifications.put("9NE", "GLU");
1616 modifications.put("9NF", "PHE");
1617 modifications.put("9NR", "ARG");
1618 modifications.put("9NV", "VAL");
1619 modifications.put("A ", "ALA");
1620 modifications.put("A1P", "ASN");
1621 modifications.put("A23", "ALA");
1622 modifications.put("A2L", "ALA");
1623 modifications.put("A2M", "ALA");
1624 modifications.put("A34", "ALA");
1625 modifications.put("A35", "ALA");
1626 modifications.put("A38", "ALA");
1627 modifications.put("A39", "ALA");
1628 modifications.put("A3A", "ALA");
1629 modifications.put("A3P", "ALA");
1630 modifications.put("A40", "ALA");
1631 modifications.put("A43", "ALA");
1632 modifications.put("A44", "ALA");
1633 modifications.put("A47", "ALA");
1634 modifications.put("A5L", "ALA");
1635 modifications.put("A5M", "CYS");
1636 modifications.put("A5N", "ASN");
1637 modifications.put("A5O", "ALA");
1638 modifications.put("A66", "XAA");
1639 modifications.put("AA3", "ALA");
1640 modifications.put("AA4", "ALA");
1641 modifications.put("AAR", "ARG");
1642 modifications.put("AB7", "XAA");
1643 modifications.put("ABA", "ALA");
1644 modifications.put("ABR", "ALA");
1645 modifications.put("ABS", "ALA");
1646 modifications.put("ABT", "ASN");
1647 modifications.put("ACB", "ASP");
1648 modifications.put("ACL", "ARG");
1649 modifications.put("AD2", "ALA");
1650 modifications.put("ADD", "XAA");
1651 modifications.put("ADX", "ASN");
1652 modifications.put("AEA", "XAA");
1653 modifications.put("AEI", "ASP");
1654 modifications.put("AET", "ALA");
1655 modifications.put("AFA", "ASN");
1656 modifications.put("AFF", "ASN");
1657 modifications.put("AFG", "GLY");
1658 modifications.put("AGM", "ARG");
1659 modifications.put("AGT", "CYS");
1660 modifications.put("AHB", "ASN");
1661 modifications.put("AHH", "XAA");
1662 modifications.put("AHO", "ALA");
1663 modifications.put("AHP", "ALA");
1664 modifications.put("AHS", "XAA");
1665 modifications.put("AHT", "XAA");
1666 modifications.put("AIB", "ALA");
1667 modifications.put("AKL", "ASP");
1668 modifications.put("AKZ", "ASP");
1669 modifications.put("ALA", "ALA");
1670 modifications.put("ALC", "ALA");
1671 modifications.put("ALM", "ALA");
1672 modifications.put("ALN", "ALA");
1673 modifications.put("ALO", "THR");
1674 modifications.put("ALQ", "XAA");
1675 modifications.put("ALS", "ALA");
1676 modifications.put("ALT", "ALA");
1677 modifications.put("ALV", "ALA");
1678 modifications.put("ALY", "LYS");
1679 modifications.put("AN8", "ALA");
1680 modifications.put("AP7", "ALA");
1681 modifications.put("APE", "XAA");
1682 modifications.put("APH", "ALA");
1683 modifications.put("API", "LYS");
1684 modifications.put("APK", "LYS");
1685 modifications.put("APM", "XAA");
1686 modifications.put("APP", "XAA");
1687 modifications.put("AR2", "ARG");
1688 modifications.put("AR4", "GLU");
1689 modifications.put("AR7", "ARG");
1690 modifications.put("ARG", "ARG");
1691 modifications.put("ARM", "ARG");
1692 modifications.put("ARO", "ARG");
1693 modifications.put("ARV", "XAA");
1694 modifications.put("AS ", "ALA");
1695 modifications.put("AS2", "ASP");
1696 modifications.put("AS9", "XAA");
1697 modifications.put("ASA", "ASP");
1698 modifications.put("ASB", "ASP");
1699 modifications.put("ASI", "ASP");
1700 modifications.put("ASK", "ASP");
1701 modifications.put("ASL", "ASP");
1702 modifications.put("ASM", "XAA");
1703 modifications.put("ASN", "ASN");
1704 modifications.put("ASP", "ASP");
1705 modifications.put("ASQ", "ASP");
1706 modifications.put("ASU", "ASN");
1707 modifications.put("ASX", "ASX");
1708 modifications.put("ATD", "THR");
1709 modifications.put("ATL", "THR");
1710 modifications.put("ATM", "THR");
1711 modifications.put("AVC", "ALA");
1712 modifications.put("AVN", "XAA");
1713 modifications.put("AYA", "ALA");
1714 modifications.put("AYG", "AYG");
1715 modifications.put("AZK", "LYS");
1716 modifications.put("AZS", "SER");
1717 modifications.put("AZY", "TYR");
1718 modifications.put("B1F", "PHE");
1719 modifications.put("B1P", "ASN");
1720 modifications.put("B2A", "ALA");
1721 modifications.put("B2F", "PHE");
1722 modifications.put("B2I", "ILE");
1723 modifications.put("B2V", "VAL");
1724 modifications.put("B3A", "ALA");
1725 modifications.put("B3D", "ASP");
1726 modifications.put("B3E", "GLU");
1727 modifications.put("B3K", "LYS");
1728 modifications.put("B3L", "XAA");
1729 modifications.put("B3M", "XAA");
1730 modifications.put("B3Q", "XAA");
1731 modifications.put("B3S", "SER");
1732 modifications.put("B3T", "XAA");
1733 modifications.put("B3U", "HIS");
1734 modifications.put("B3X", "ASN");
1735 modifications.put("B3Y", "TYR");
1736 modifications.put("BB6", "CYS");
1737 modifications.put("BB7", "CYS");
1738 modifications.put("BB8", "PHE");
1739 modifications.put("BB9", "CYS");
1740 modifications.put("BBC", "CYS");
1741 modifications.put("BCS", "CYS");
1742 modifications.put("BE2", "XAA");
1743 modifications.put("BFD", "ASP");
1744 modifications.put("BG1", "SER");
1745 modifications.put("BGM", "GLY");
1746 modifications.put("BH2", "ASP");
1747 modifications.put("BHD", "ASP");
1748 modifications.put("BIF", "PHE");
1749 modifications.put("BIL", "XAA");
1750 modifications.put("BIU", "ILE");
1751 modifications.put("BJH", "XAA");
1752 modifications.put("BLE", "LEU");
1753 modifications.put("BLY", "LYS");
1754 modifications.put("BMP", "ASN");
1755 modifications.put("BMT", "THR");
1756 modifications.put("BNN", "PHE");
1757 modifications.put("BNO", "XAA");
1758 modifications.put("BOE", "THR");
1759 modifications.put("BOR", "ARG");
1760 modifications.put("BPE", "CYS");
1761 modifications.put("BRU", "UR3");
1762 modifications.put("BSE", "SER");
1763 modifications.put("BT5", "ASN");
1764 modifications.put("BTA", "LEU");
1765 modifications.put("BTC", "CYS");
1766 modifications.put("BTR", "TRP");
1767 modifications.put("BUC", "CYS");
1768 modifications.put("BUG", "VAL");
1769 modifications.put("BVP", "UR3");
1770 modifications.put("BZG", "ASN");
1771 modifications.put("C ", "CYS");
1772 modifications.put("C12", "TYG");
1773 modifications.put("C1X", "LYS");
1774 modifications.put("C25", "CYS");
1775 modifications.put("C2L", "CYS");
1776 modifications.put("C2S", "CYS");
1777 modifications.put("C31", "CYS");
1778 modifications.put("C32", "CYS");
1779 modifications.put("C34", "CYS");
1780 modifications.put("C36", "CYS");
1781 modifications.put("C37", "CYS");
1782 modifications.put("C38", "CYS");
1783 modifications.put("C3Y", "CYS");
1784 modifications.put("C42", "CYS");
1785 modifications.put("C43", "CYS");
1786 modifications.put("C45", "CYS");
1787 modifications.put("C46", "CYS");
1788 modifications.put("C49", "CYS");
1789 modifications.put("C4R", "CYS");
1790 modifications.put("C4S", "CYS");
1791 modifications.put("C5C", "CYS");
1792 modifications.put("C66", "XAA");
1793 modifications.put("C6C", "CYS");
1794 modifications.put("C99", "TFG");
1795 modifications.put("CAF", "CYS");
1796 modifications.put("CAL", "XAA");
1797 modifications.put("CAR", "CYS");
1798 modifications.put("CAS", "CYS");
1799 modifications.put("CAV", "XAA");
1800 modifications.put("CAY", "CYS");
1801 modifications.put("CB2", "CYS");
1802 modifications.put("CBR", "CYS");
1803 modifications.put("CBV", "CYS");
1804 modifications.put("CCC", "CYS");
1805 modifications.put("CCL", "LYS");
1806 modifications.put("CCS", "CYS");
1807 modifications.put("CCY", "CYG");
1808 modifications.put("CDE", "XAA");
1809 modifications.put("CDV", "XAA");
1810 modifications.put("CDW", "CYS");
1811 modifications.put("CEA", "CYS");
1812 modifications.put("CFL", "CYS");
1813 modifications.put("CFY", "FCYG"); // check
1814 modifications.put("CG1", "GLY");
1815 modifications.put("CGA", "GLU");
1816 modifications.put("CGU", "GLU");
1817 modifications.put("CH ", "CYS");
1818 modifications.put("CH6", "MYG");
1819 modifications.put("CH7", "KYG");
1820 modifications.put("CHF", "XAA");
1821 modifications.put("CHG", "XAA");
1822 modifications.put("CHP", "GLY");
1823 modifications.put("CHS", "XAA");
1824 modifications.put("CIR", "ARG");
1825 modifications.put("CJO", "GYG");
1826 modifications.put("CLE", "LEU");
1827 modifications.put("CLG", "LYS");
1828 modifications.put("CLH", "LYS");
1829 modifications.put("CLV", "AFG");
1830 modifications.put("CM0", "ASN");
1831 modifications.put("CME", "CYS");
1832 modifications.put("CMH", "CYS");
1833 modifications.put("CML", "CYS");
1834 modifications.put("CMR", "CYS");
1835 modifications.put("CMT", "CYS");
1836 modifications.put("CNU", "UR3");
1837 modifications.put("CP1", "CYS");
1838 modifications.put("CPC", "XAA");
1839 modifications.put("CPI", "XAA");
1840 modifications.put("CQR", "GYG");
1841 modifications.put("CR0", "TLG");
1842 modifications.put("CR2", "GYG");
1843 modifications.put("CR5", "GLY");
1844 modifications.put("CR7", "KYG");
1845 modifications.put("CR8", "HYG");
1846 modifications.put("CRF", "TWG");
1847 modifications.put("CRG", "THG");
1848 modifications.put("CRK", "MYG");
1849 modifications.put("CRO", "GYG");
1850 modifications.put("CRQ", "QYG");
1851 modifications.put("CRU", "EYG");
1852 modifications.put("CRW", "ASG");
1853 modifications.put("CRX", "ASG");
1854 modifications.put("CS0", "CYS");
1855 modifications.put("CS1", "CYS");
1856 modifications.put("CS3", "CYS");
1857 modifications.put("CS4", "CYS");
1858 modifications.put("CS8", "ASN");
1859 modifications.put("CSA", "CYS");
1860 modifications.put("CSB", "CYS");
1861 modifications.put("CSD", "CYS");
1862 modifications.put("CSE", "CYS");
1863 modifications.put("CSF", "CYS");
1864 modifications.put("CSH", "SHG");
1865 modifications.put("CSI", "GLY");
1866 modifications.put("CSJ", "CYS");
1867 modifications.put("CSL", "CYS");
1868 modifications.put("CSO", "CYS");
1869 modifications.put("CSP", "CYS");
1870 modifications.put("CSR", "CYS");
1871 modifications.put("CSS", "CYS");
1872 modifications.put("CSU", "CYS");
1873 modifications.put("CSW", "CYS");
1874 modifications.put("CSX", "CYS");
1875 modifications.put("CSY", "SYG");
1876 modifications.put("CSZ", "CYS");
1877 modifications.put("CTE", "TRP");
1878 modifications.put("CTG", "THR");
1879 modifications.put("CTH", "THR");
1880 modifications.put("CUC", "XAA");
1881 modifications.put("CWR", "SER");
1882 modifications.put("CXM", "MET");
1883 modifications.put("CY0", "CYS");
1884 modifications.put("CY1", "CYS");
1885 modifications.put("CY3", "CYS");
1886 modifications.put("CY4", "CYS");
1887 modifications.put("CYA", "CYS");
1888 modifications.put("CYD", "CYS");
1889 modifications.put("CYF", "CYS");
1890 modifications.put("CYG", "CYS");
1891 modifications.put("CYJ", "XAA");
1892 modifications.put("CYM", "CYS");
1893 modifications.put("CYQ", "CYS");
1894 modifications.put("CYR", "CYS");
1895 modifications.put("CYS", "CYS");
1896 modifications.put("CZ2", "CYS");
1897 modifications.put("CZO", "GYG");
1898 modifications.put("CZZ", "CYS");
1899 modifications.put("D11", "THR");
1900 modifications.put("D1P", "ASN");
1901 modifications.put("D3 ", "ASN");
1902 modifications.put("D33", "ASN");
1903 modifications.put("D3P", "GLY");
1904 modifications.put("D3T", "THR");
1905 modifications.put("D4M", "THR");
1906 modifications.put("D4P", "XAA");
1907 modifications.put("DA ", "ALA");
1908 modifications.put("DA2", "XAA");
1909 modifications.put("DAB", "ALA");
1910 modifications.put("DAH", "PHE");
1911 modifications.put("DAL", "ALA");
1912 modifications.put("DAR", "ARG");
1913 modifications.put("DAS", "ASP");
1914 modifications.put("DBB", "THR");
1915 modifications.put("DBM", "ASN");
1916 modifications.put("DBS", "SER");
1917 modifications.put("DBU", "THR");
1918 modifications.put("DBY", "TYR");
1919 modifications.put("DBZ", "ALA");
1920 modifications.put("DC ", "CYS");
1921 modifications.put("DC2", "CYS");
1922 modifications.put("DCG", "GLY");
1923 modifications.put("DCI", "XAA");
1924 modifications.put("DCL", "XAA");
1925 modifications.put("DCT", "CYS");
1926 modifications.put("DCY", "CYS");
1927 modifications.put("DDE", "HIS");
1928 modifications.put("DDG", "GLY");
1929 modifications.put("DDN", "UR3");
1930 modifications.put("DDX", "ASN");
1931 modifications.put("DFC", "CYS");
1932 modifications.put("DFG", "GLY");
1933 modifications.put("DFI", "XAA");
1934 modifications.put("DFO", "XAA");
1935 modifications.put("DFT", "ASN");
1936 modifications.put("DG ", "GLY");
1937 modifications.put("DGH", "GLY");
1938 modifications.put("DGI", "GLY");
1939 modifications.put("DGL", "GLU");
1940 modifications.put("DGN", "GLN");
1941 modifications.put("DHA", "SER");
1942 modifications.put("DHI", "HIS");
1943 modifications.put("DHL", "XAA");
1944 modifications.put("DHN", "VAL");
1945 modifications.put("DHP", "XAA");
1946 modifications.put("DHU", "UR3");
1947 modifications.put("DHV", "VAL");
1948 modifications.put("DI ", "ILE");
1949 modifications.put("DIL", "ILE");
1950 modifications.put("DIR", "ARG");
1951 modifications.put("DIV", "VAL");
1952 modifications.put("DLE", "LEU");
1953 modifications.put("DLS", "LYS");
1954 modifications.put("DLY", "LYS");
1955 modifications.put("DM0", "LYS");
1956 modifications.put("DMH", "ASN");
1957 modifications.put("DMK", "ASP");
1958 modifications.put("DMT", "XAA");
1959 modifications.put("DN ", "ASN");
1960 modifications.put("DNE", "LEU");
1961 modifications.put("DNG", "LEU");
1962 modifications.put("DNL", "LYS");
1963 modifications.put("DNM", "LEU");
1964 modifications.put("DNP", "ALA");
1965 modifications.put("DNR", "CYS");
1966 modifications.put("DNS", "LYS");
1967 modifications.put("DOA", "XAA");
1968 modifications.put("DOC", "CYS");
1969 modifications.put("DOH", "ASP");
1970 modifications.put("DON", "LEU");
1971 modifications.put("DPB", "THR");
1972 modifications.put("DPH", "PHE");
1973 modifications.put("DPL", "PRO");
1974 modifications.put("DPP", "ALA");
1975 modifications.put("DPQ", "TYR");
1976 modifications.put("DPR", "PRO");
1977 modifications.put("DPY", "ASN");
1978 modifications.put("DRM", "UR3");
1979 modifications.put("DRP", "ASN");
1980 modifications.put("DRT", "THR");
1981 modifications.put("DRZ", "ASN");
1982 modifications.put("DSE", "SER");
1983 modifications.put("DSG", "ASN");
1984 modifications.put("DSN", "SER");
1985 modifications.put("DSP", "ASP");
1986 modifications.put("DT ", "THR");
1987 modifications.put("DTH", "THR");
1988 modifications.put("DTR", "TRP");
1989 modifications.put("DTY", "TYR");
1990 modifications.put("DU ", "UR3");
1991 modifications.put("DVA", "VAL");
1992 modifications.put("DXD", "ASN");
1993 modifications.put("DXN", "ASN");
1994 modifications.put("DYG", "DYG");
1995 modifications.put("DYS", "CYS");
1996 modifications.put("DZM", "ALA");
1997 modifications.put("E ", "ALA");
1998 modifications.put("E1X", "ALA");
1999 modifications.put("ECC", "GLN");
2000 modifications.put("EDA", "ALA");
2001 modifications.put("EFC", "CYS");
2002 modifications.put("EHP", "PHE");
2003 modifications.put("EIT", "THR");
2004 modifications.put("ENP", "ASN");
2005 modifications.put("ESB", "TYR");
2006 modifications.put("ESC", "MET");
2007 modifications.put("EXB", "XAA");
2008 modifications.put("EXY", "LEU");
2009 modifications.put("EY5", "ASN");
2010 modifications.put("EYS", "XAA");
2011 modifications.put("F2F", "PHE");
2012 modifications.put("FA2", "ALA");
2013 modifications.put("FA5", "ASN");
2014 modifications.put("FAG", "ASN");
2015 modifications.put("FAI", "ASN");
2016 modifications.put("FB5", "ALA");
2017 modifications.put("FB6", "ALA");
2018 modifications.put("FCL", "PHE");
2019 modifications.put("FFD", "ASN");
2020 modifications.put("FGA", "GLU");
2021 modifications.put("FGL", "GLY");
2022 modifications.put("FGP", "SER");
2023 modifications.put("FHL", "XAA");
2024 modifications.put("FHO", "LYS");
2025 modifications.put("FHU", "UR3");
2026 modifications.put("FLA", "ALA");
2027 modifications.put("FLE", "LEU");
2028 modifications.put("FLT", "TYR");
2029 modifications.put("FME", "MET");
2030 modifications.put("FMG", "GLY");
2031 modifications.put("FMU", "ASN");
2032 modifications.put("FOE", "CYS");
2033 modifications.put("FOX", "GLY");
2034 modifications.put("FP9", "PRO");
2035 modifications.put("FPA", "PHE");
2036 modifications.put("FRD", "XAA");
2037 modifications.put("FT6", "TRP");
2038 modifications.put("FTR", "TRP");
2039 modifications.put("FTY", "TYR");
2040 modifications.put("FVA", "VAL");
2041 modifications.put("FZN", "LYS");
2042 modifications.put("G ", "GLY");
2043 modifications.put("G25", "GLY");
2044 modifications.put("G2L", "GLY");
2045 modifications.put("G2S", "GLY");
2046 modifications.put("G31", "GLY");
2047 modifications.put("G32", "GLY");
2048 modifications.put("G33", "GLY");
2049 modifications.put("G36", "GLY");
2050 modifications.put("G38", "GLY");
2051 modifications.put("G42", "GLY");
2052 modifications.put("G46", "GLY");
2053 modifications.put("G47", "GLY");
2054 modifications.put("G48", "GLY");
2055 modifications.put("G49", "GLY");
2056 modifications.put("G4P", "ASN");
2057 modifications.put("G7M", "GLY");
2058 modifications.put("GAO", "GLY");
2059 modifications.put("GAU", "GLU");
2060 modifications.put("GCK", "CYS");
2061 modifications.put("GCM", "XAA");
2062 modifications.put("GDP", "GLY");
2063 modifications.put("GDR", "GLY");
2064 modifications.put("GFL", "GLY");
2065 modifications.put("GGL", "GLU");
2066 modifications.put("GH3", "GLY");
2067 modifications.put("GHG", "GLN");
2068 modifications.put("GHP", "GLY");
2069 modifications.put("GL3", "GLY");
2070 modifications.put("GLH", "GLN");
2071 modifications.put("GLJ", "GLU");
2072 modifications.put("GLK", "GLU");
2073 modifications.put("GLM", "XAA");
2074 modifications.put("GLN", "GLN");
2075 modifications.put("GLQ", "GLU");
2076 modifications.put("GLU", "GLU");
2077 modifications.put("GLX", "GLX");
2078 modifications.put("GLY", "GLY");
2079 modifications.put("GLZ", "GLY");
2080 modifications.put("GMA", "GLU");
2081 modifications.put("GMS", "GLY");
2082 modifications.put("GMU", "UR3");
2083 modifications.put("GN7", "GLY");
2084 modifications.put("GND", "XAA");
2085 modifications.put("GNE", "ASN");
2086 modifications.put("GOM", "GLY");
2087 modifications.put("GPL", "LYS");
2088 modifications.put("GS ", "GLY");
2089 modifications.put("GSC", "GLY");
2090 modifications.put("GSR", "GLY");
2091 modifications.put("GSS", "GLY");
2092 modifications.put("GSU", "GLU");
2093 modifications.put("GT9", "CYS");
2094 modifications.put("GTP", "GLY");
2095 modifications.put("GVL", "XAA");
2096 modifications.put("GYC", "CYG");
2097 modifications.put("GYS", "SYG");
2098 modifications.put("H2U", "UR3");
2099 modifications.put("H5M", "PRO");
2100 modifications.put("HAC", "ALA");
2101 modifications.put("HAR", "ARG");
2102 modifications.put("HBN", "HIS");
2103 modifications.put("HCS", "XAA");
2104 modifications.put("HDP", "UR3");
2105 modifications.put("HEU", "UR3");
2106 modifications.put("HFA", "XAA");
2107 modifications.put("HGL", "XAA");
2108 modifications.put("HHI", "HIS");
2109 modifications.put("HHK", "AK"); // check
2110 modifications.put("HIA", "HIS");
2111 modifications.put("HIC", "HIS");
2112 modifications.put("HIP", "HIS");
2113 modifications.put("HIQ", "HIS");
2114 modifications.put("HIS", "HIS");
2115 modifications.put("HL2", "LEU");
2116 modifications.put("HLU", "LEU");
2117 modifications.put("HMR", "ARG");
2118 modifications.put("HOL", "ASN");
2119 modifications.put("HPC", "PHE");
2120 modifications.put("HPE", "PHE");
2121 modifications.put("HPH", "PHE");
2122 modifications.put("HPQ", "PHE");
2123 modifications.put("HQA", "ALA");
2124 modifications.put("HRG", "ARG");
2125 modifications.put("HRP", "TRP");
2126 modifications.put("HS8", "HIS");
2127 modifications.put("HS9", "HIS");
2128 modifications.put("HSE", "SER");
2129 modifications.put("HSL", "SER");
2130 modifications.put("HSO", "HIS");
2131 modifications.put("HTI", "CYS");
2132 modifications.put("HTN", "ASN");
2133 modifications.put("HTR", "TRP");
2134 modifications.put("HV5", "ALA");
2135 modifications.put("HVA", "VAL");
2136 modifications.put("HY3", "PRO");
2137 modifications.put("HYP", "PRO");
2138 modifications.put("HZP", "PRO");
2139 modifications.put("I ", "ILE");
2140 modifications.put("I2M", "ILE");
2141 modifications.put("I58", "LYS");
2142 modifications.put("I5C", "CYS");
2143 modifications.put("IAM", "ALA");
2144 modifications.put("IAR", "ARG");
2145 modifications.put("IAS", "ASP");
2146 modifications.put("IC ", "CYS");
2147 modifications.put("IEL", "LYS");
2148 modifications.put("IEY", "HYG");
2149 modifications.put("IG ", "GLY");
2150 modifications.put("IGL", "GLY");
2151 modifications.put("IGU", "GLY");
2152 modifications.put("IIC", "SHG");
2153 modifications.put("IIL", "ILE");
2154 modifications.put("ILE", "ILE");
2155 modifications.put("ILG", "GLU");
2156 modifications.put("ILX", "ILE");
2157 modifications.put("IMC", "CYS");
2158 modifications.put("IML", "ILE");
2159 modifications.put("IOY", "PHE");
2160 modifications.put("IPG", "GLY");
2161 modifications.put("IPN", "ASN");
2162 modifications.put("IRN", "ASN");
2163 modifications.put("IT1", "LYS");
2164 modifications.put("IU ", "UR3");
2165 modifications.put("IYR", "TYR");
2166 modifications.put("IYT", "THR");
2167 modifications.put("IZO", "MET");
2168 modifications.put("JJJ", "CYS");
2169 modifications.put("JJK", "CYS");
2170 modifications.put("JJL", "CYS");
2171 modifications.put("JW5", "ASN");
2172 modifications.put("K1R", "CYS");
2173 modifications.put("KAG", "GLY");
2174 modifications.put("KCX", "LYS");
2175 modifications.put("KGC", "LYS");
2176 modifications.put("KNB", "ALA");
2177 modifications.put("KOR", "MET");
2178 modifications.put("KPI", "LYS");
2179 modifications.put("KST", "LYS");
2180 modifications.put("KYQ", "LYS");
2181 modifications.put("L2A", "XAA");
2182 modifications.put("LA2", "LYS");
2183 modifications.put("LAA", "ASP");
2184 modifications.put("LAL", "ALA");
2185 modifications.put("LBY", "LYS");
2186 modifications.put("LC ", "CYS");
2187 modifications.put("LCA", "ALA");
2188 modifications.put("LCC", "ASN");
2189 modifications.put("LCG", "GLY");
2190 modifications.put("LCH", "ASN");
2191 modifications.put("LCK", "LYS");
2192 modifications.put("LCX", "LYS");
2193 modifications.put("LDH", "LYS");
2194 modifications.put("LED", "LEU");
2195 modifications.put("LEF", "LEU");
2196 modifications.put("LEH", "LEU");
2197 modifications.put("LEI", "VAL");
2198 modifications.put("LEM", "LEU");
2199 modifications.put("LEN", "LEU");
2200 modifications.put("LET", "XAA");
2201 modifications.put("LEU", "LEU");
2202 modifications.put("LEX", "LEU");
2203 modifications.put("LG ", "GLY");
2204 modifications.put("LGP", "GLY");
2205 modifications.put("LHC", "XAA");
2206 modifications.put("LHU", "UR3");
2207 modifications.put("LKC", "ASN");
2208 modifications.put("LLP", "LYS");
2209 modifications.put("LLY", "LYS");
2210 modifications.put("LME", "GLU");
2211 modifications.put("LMF", "LYS");
2212 modifications.put("LMQ", "GLN");
2213 modifications.put("LMS", "ASN");
2214 modifications.put("LP6", "LYS");
2215 modifications.put("LPD", "PRO");
2216 modifications.put("LPG", "GLY");
2217 modifications.put("LPL", "XAA");
2218 modifications.put("LPS", "SER");
2219 modifications.put("LSO", "XAA");
2220 modifications.put("LTA", "XAA");
2221 modifications.put("LTR", "TRP");
2222 modifications.put("LVG", "GLY");
2223 modifications.put("LVN", "VAL");
2224 modifications.put("LYF", "LYS");
2225 modifications.put("LYK", "LYS");
2226 modifications.put("LYM", "LYS");
2227 modifications.put("LYN", "LYS");
2228 modifications.put("LYR", "LYS");
2229 modifications.put("LYS", "LYS");
2230 modifications.put("LYX", "LYS");
2231 modifications.put("LYZ", "LYS");
2232 modifications.put("M0H", "CYS");
2233 modifications.put("M1G", "GLY");
2234 modifications.put("M2G", "GLY");
2235 modifications.put("M2L", "LYS");
2236 modifications.put("M2S", "MET");
2237 modifications.put("M30", "GLY");
2238 modifications.put("M3L", "LYS");
2239 modifications.put("M5M", "CYS");
2240 modifications.put("MA ", "ALA");
2241 modifications.put("MA6", "ALA");
2242 modifications.put("MA7", "ALA");
2243 modifications.put("MAA", "ALA");
2244 modifications.put("MAD", "ALA");
2245 modifications.put("MAI", "ARG");
2246 modifications.put("MBQ", "TYR");
2247 modifications.put("MBZ", "ASN");
2248 modifications.put("MC1", "SER");
2249 modifications.put("MCG", "XAA");
2250 modifications.put("MCL", "LYS");
2251 modifications.put("MCS", "CYS");
2252 modifications.put("MCY", "CYS");
2253 modifications.put("MD3", "CYS");
2254 modifications.put("MD6", "GLY");
2255 modifications.put("MDH", "XAA");
2256 modifications.put("MDO", "ASG");
2257 modifications.put("MDR", "ASN");
2258 modifications.put("MEA", "PHE");
2259 modifications.put("MED", "MET");
2260 modifications.put("MEG", "GLU");
2261 modifications.put("MEN", "ASN");
2262 modifications.put("MEP", "UR3");
2263 modifications.put("MEQ", "GLN");
2264 modifications.put("MET", "MET");
2265 modifications.put("MEU", "GLY");
2266 modifications.put("MF3", "XAA");
2267 modifications.put("MFC", "GYG");
2268 modifications.put("MG1", "GLY");
2269 modifications.put("MGG", "ARG");
2270 modifications.put("MGN", "GLN");
2271 modifications.put("MGQ", "ALA");
2272 modifications.put("MGV", "GLY");
2273 modifications.put("MGY", "GLY");
2274 modifications.put("MHL", "LEU");
2275 modifications.put("MHO", "MET");
2276 modifications.put("MHS", "HIS");
2277 modifications.put("MIA", "ALA");
2278 modifications.put("MIS", "SER");
2279 modifications.put("MK8", "LEU");
2280 modifications.put("ML3", "LYS");
2281 modifications.put("MLE", "LEU");
2282 modifications.put("MLL", "LEU");
2283 modifications.put("MLY", "LYS");
2284 modifications.put("MLZ", "LYS");
2285 modifications.put("MME", "MET");
2286 modifications.put("MMO", "ARG");
2287 modifications.put("MMT", "THR");
2288 modifications.put("MND", "ASN");
2289 modifications.put("MNL", "LEU");
2290 modifications.put("MNU", "UR3");
2291 modifications.put("MNV", "VAL");
2292 modifications.put("MOD", "XAA");
2293 modifications.put("MP8", "PRO");
2294 modifications.put("MPH", "XAA");
2295 modifications.put("MPJ", "XAA");
2296 modifications.put("MPQ", "GLY");
2297 modifications.put("MRG", "GLY");
2298 modifications.put("MSA", "GLY");
2299 modifications.put("MSE", "MET");
2300 modifications.put("MSL", "MET");
2301 modifications.put("MSO", "MET");
2302 modifications.put("MSP", "XAA");
2303 modifications.put("MT2", "MET");
2304 modifications.put("MTR", "THR");
2305 modifications.put("MTU", "ALA");
2306 modifications.put("MTY", "TYR");
2307 modifications.put("MVA", "VAL");
2308 modifications.put("N ", "ASN");
2309 modifications.put("N10", "SER");
2310 modifications.put("N2C", "XAA");
2311 modifications.put("N5I", "ASN");
2312 modifications.put("N5M", "CYS");
2313 modifications.put("N6G", "GLY");
2314 modifications.put("N7P", "PRO");
2315 modifications.put("NA8", "ALA");
2316 modifications.put("NAL", "ALA");
2317 modifications.put("NAM", "ALA");
2318 modifications.put("NB8", "ASN");
2319 modifications.put("NBQ", "TYR");
2320 modifications.put("NC1", "SER");
2321 modifications.put("NCB", "ALA");
2322 modifications.put("NCX", "ASN");
2323 modifications.put("NCY", "XAA");
2324 modifications.put("NDF", "PHE");
2325 modifications.put("NDN", "UR3");
2326 modifications.put("NEM", "HIS");
2327 modifications.put("NEP", "HIS");
2328 modifications.put("NF2", "ASN");
2329 modifications.put("NFA", "PHE");
2330 modifications.put("NHL", "GLU");
2331 modifications.put("NIT", "XAA");
2332 modifications.put("NIY", "TYR");
2333 modifications.put("NLE", "LEU");
2334 modifications.put("NLN", "LEU");
2335 modifications.put("NLO", "LEU");
2336 modifications.put("NLP", "LEU");
2337 modifications.put("NLQ", "GLN");
2338 modifications.put("NMC", "GLY");
2339 modifications.put("NMM", "ARG");
2340 modifications.put("NMS", "THR");
2341 modifications.put("NMT", "THR");
2342 modifications.put("NNH", "ARG");
2343 modifications.put("NP3", "ASN");
2344 modifications.put("NPH", "CYS");
2345 modifications.put("NPI", "ALA");
2346 modifications.put("NRP", "LYG");
2347 modifications.put("NRQ", "MYG");
2348 modifications.put("NSK", "XAA");
2349 modifications.put("NTY", "TYR");
2350 modifications.put("NVA", "VAL");
2351 modifications.put("NYC", "TWG");
2352 modifications.put("NYG", "NYG");
2353 modifications.put("NYM", "ASN");
2354 modifications.put("NYS", "CYS");
2355 modifications.put("NZH", "HIS");
2356 modifications.put("O12", "XAA");
2357 modifications.put("O2C", "ASN");
2358 modifications.put("O2G", "GLY");
2359 modifications.put("OAD", "ASN");
2360 modifications.put("OAS", "SER");
2361 modifications.put("OBF", "XAA");
2362 modifications.put("OBS", "XAA");
2363 modifications.put("OCS", "CYS");
2364 modifications.put("OCY", "CYS");
2365 modifications.put("ODP", "ASN");
2366 modifications.put("OHI", "HIS");
2367 modifications.put("OHS", "ASP");
2368 modifications.put("OIC", "XAA");
2369 modifications.put("OIP", "ILE");
2370 modifications.put("OLE", "XAA");
2371 modifications.put("OLT", "THR");
2372 modifications.put("OLZ", "SER");
2373 modifications.put("OMC", "CYS");
2374 modifications.put("OMG", "GLY");
2375 modifications.put("OMT", "MET");
2376 modifications.put("OMU", "UR3");
2377 modifications.put("ONE", "UR3");
2378 modifications.put("ONH", "ALA");
2379 modifications.put("ONL", "XAA");
2380 modifications.put("OPR", "ARG");
2381 modifications.put("ORN", "ALA");
2382 modifications.put("ORQ", "ARG");
2383 modifications.put("OSE", "SER");
2384 modifications.put("OTB", "XAA");
2385 modifications.put("OTH", "THR");
2386 modifications.put("OTY", "TYR");
2387 modifications.put("OXX", "ASP");
2388 modifications.put("P ", "GLY");
2389 modifications.put("P1L", "CYS");
2390 modifications.put("P1P", "ASN");
2391 modifications.put("P2T", "THR");
2392 modifications.put("P2U", "UR3");
2393 modifications.put("P2Y", "PRO");
2394 modifications.put("P5P", "ALA");
2395 modifications.put("PAQ", "TYR");
2396 modifications.put("PAS", "ASP");
2397 modifications.put("PAT", "TRP");
2398 modifications.put("PAU", "ALA");
2399 modifications.put("PBB", "CYS");
2400 modifications.put("PBF", "PHE");
2401 modifications.put("PBT", "ASN");
2402 modifications.put("PCA", "GLU");
2403 modifications.put("PCC", "PRO");
2404 modifications.put("PCE", "XAA");
2405 modifications.put("PCS", "PHE");
2406 modifications.put("PDL", "XAA");
2407 modifications.put("PDU", "UR3");
2408 modifications.put("PEC", "CYS");
2409 modifications.put("PF5", "PHE");
2410 modifications.put("PFF", "PHE");
2411 modifications.put("PFX", "XAA");
2412 modifications.put("PG1", "SER");
2413 modifications.put("PG7", "GLY");
2414 modifications.put("PG9", "GLY");
2415 modifications.put("PGL", "XAA");
2416 modifications.put("PGN", "GLY");
2417 modifications.put("PGP", "GLY");
2418 modifications.put("PGY", "GLY");
2419 modifications.put("PHA", "PHE");
2420 modifications.put("PHD", "ASP");
2421 modifications.put("PHE", "PHE");
2422 modifications.put("PHI", "PHE");
2423 modifications.put("PHL", "PHE");
2424 modifications.put("PHM", "PHE");
2425 modifications.put("PIA", "AYG");
2426 modifications.put("PIV", "XAA");
2427 modifications.put("PLE", "LEU");
2428 modifications.put("PM3", "PHE");
2429 modifications.put("PMT", "CYS");
2430 modifications.put("POM", "PRO");
2431 modifications.put("PPN", "PHE");
2432 modifications.put("PPU", "ALA");
2433 modifications.put("PPW", "GLY");
2434 modifications.put("PQ1", "ASN");
2435 modifications.put("PR3", "CYS");
2436 modifications.put("PR5", "ALA");
2437 modifications.put("PR9", "PRO");
2438 modifications.put("PRN", "ALA");
2439 modifications.put("PRO", "PRO");
2440 modifications.put("PRS", "PRO");
2441 modifications.put("PSA", "PHE");
2442 modifications.put("PSH", "HIS");
2443 modifications.put("PST", "THR");
2444 modifications.put("PSU", "UR3");
2445 modifications.put("PSW", "CYS");
2446 modifications.put("PTA", "XAA");
2447 modifications.put("PTH", "TYR");
2448 modifications.put("PTM", "TYR");
2449 modifications.put("PTR", "TYR");
2450 modifications.put("PU ", "ALA");
2451 modifications.put("PUY", "ASN");
2452 modifications.put("PVH", "HIS");
2453 modifications.put("PVL", "XAA");
2454 modifications.put("PYA", "ALA");
2455 modifications.put("PYO", "UR3");
2456 modifications.put("PYX", "CYS");
2457 modifications.put("PYY", "ASN");
2458 modifications.put("QLG", "QLG");
2459 modifications.put("QMM", "GLN");
2460 modifications.put("QPA", "CYS");
2461 modifications.put("QPH", "PHE");
2462 modifications.put("QUO", "GLY");
2463 modifications.put("R ", "ALA");
2464 modifications.put("R1A", "CYS");
2465 modifications.put("R4K", "TRP");
2466 modifications.put("RC7", "HYG");
2467 modifications.put("RE0", "TRP");
2468 modifications.put("RE3", "TRP");
2469 modifications.put("RIA", "ALA");
2470 modifications.put("RMP", "ALA");
2471 modifications.put("RON", "XAA");
2472 modifications.put("RT ", "THR");
2473 modifications.put("RTP", "ASN");
2474 modifications.put("S1H", "SER");
2475 modifications.put("S2C", "CYS");
2476 modifications.put("S2D", "ALA");
2477 modifications.put("S2M", "THR");
2478 modifications.put("S2P", "ALA");
2479 modifications.put("S4A", "ALA");
2480 modifications.put("S4C", "CYS");
2481 modifications.put("S4G", "GLY");
2482 modifications.put("S4U", "UR3");
2483 modifications.put("S6G", "GLY");
2484 modifications.put("SAC", "SER");
2485 modifications.put("SAH", "CYS");
2486 modifications.put("SAR", "GLY");
2487 modifications.put("SBL", "SER");
2488 modifications.put("SC ", "CYS");
2489 modifications.put("SCH", "CYS");
2490 modifications.put("SCS", "CYS");
2491 modifications.put("SCY", "CYS");
2492 modifications.put("SD2", "XAA");
2493 modifications.put("SDG", "GLY");
2494 modifications.put("SDP", "SER");
2495 modifications.put("SEB", "SER");
2496 modifications.put("SEC", "ALA");
2497 modifications.put("SEG", "ALA");
2498 modifications.put("SEL", "SER");
2499 modifications.put("SEM", "SER");
2500 modifications.put("SEN", "SER");
2501 modifications.put("SEP", "SER");
2502 modifications.put("SER", "SER");
2503 modifications.put("SET", "SER");
2504 modifications.put("SGB", "SER");
2505 modifications.put("SHC", "CYS");
2506 modifications.put("SHP", "GLY");
2507 modifications.put("SHR", "LYS");
2508 modifications.put("SIB", "CYS");
2509 modifications.put("SIC", "DC"); // check
2510 modifications.put("SLA", "PRO");
2511 modifications.put("SLR", "PRO");
2512 modifications.put("SLZ", "LYS");
2513 modifications.put("SMC", "CYS");
2514 modifications.put("SME", "MET");
2515 modifications.put("SMF", "PHE");
2516 modifications.put("SMP", "ALA");
2517 modifications.put("SMT", "THR");
2518 modifications.put("SNC", "CYS");
2519 modifications.put("SNN", "ASN");
2520 modifications.put("SOC", "CYS");
2521 modifications.put("SOS", "ASN");
2522 modifications.put("SOY", "SER");
2523 modifications.put("SPT", "THR");
2524 modifications.put("SRA", "ALA");
2525 modifications.put("SSU", "UR3");
2526 modifications.put("STY", "TYR");
2527 modifications.put("SUB", "XAA");
2528 modifications.put("SUI", "DG");
2529 modifications.put("SUN", "SER");
2530 modifications.put("SUR", "UR3");
2531 modifications.put("SVA", "SER");
2532 modifications.put("SVV", "SER");
2533 modifications.put("SVW", "SER");
2534 modifications.put("SVX", "SER");
2535 modifications.put("SVY", "SER");
2536 modifications.put("SVZ", "XAA");
2537 modifications.put("SWG", "SWG");
2538 modifications.put("SYS", "CYS");
2539 modifications.put("T ", "THR");
2540 modifications.put("T11", "PHE");
2541 modifications.put("T23", "THR");
2542 modifications.put("T2S", "THR");
2543 modifications.put("T2T", "ASN");
2544 modifications.put("T31", "UR3");
2545 modifications.put("T32", "THR");
2546 modifications.put("T36", "THR");
2547 modifications.put("T37", "THR");
2548 modifications.put("T38", "THR");
2549 modifications.put("T39", "THR");
2550 modifications.put("T3P", "THR");
2551 modifications.put("T41", "THR");
2552 modifications.put("T48", "THR");
2553 modifications.put("T49", "THR");
2554 modifications.put("T4S", "THR");
2555 modifications.put("T5O", "UR3");
2556 modifications.put("T5S", "THR");
2557 modifications.put("T66", "XAA");
2558 modifications.put("T6A", "ALA");
2559 modifications.put("TA3", "THR");
2560 modifications.put("TA4", "XAA");
2561 modifications.put("TAF", "THR");
2562 modifications.put("TAL", "ASN");
2563 modifications.put("TAV", "ASP");
2564 modifications.put("TBG", "VAL");
2565 modifications.put("TBM", "THR");
2566 modifications.put("TC1", "CYS");
2567 modifications.put("TCP", "THR");
2568 modifications.put("TCQ", "TYR");
2569 modifications.put("TCR", "TRP");
2570 modifications.put("TCY", "ALA");
2571 modifications.put("TDD", "LEU");
2572 modifications.put("TDY", "THR");
2573 modifications.put("TFE", "THR");
2574 modifications.put("TFO", "ALA");
2575 modifications.put("TFQ", "PHE");
2576 modifications.put("TFT", "THR");
2577 modifications.put("TGP", "GLY");
2578 modifications.put("TH6", "THR");
2579 modifications.put("THC", "THR");
2580 modifications.put("THO", "XAA");
2581 modifications.put("THR", "THR");
2582 modifications.put("THX", "ASN");
2583 modifications.put("THZ", "ARG");
2584 modifications.put("TIH", "ALA");
2585 modifications.put("TLB", "ASN");
2586 modifications.put("TLC", "THR");
2587 modifications.put("TLN", "UR3");
2588 modifications.put("TMB", "THR");
2589 modifications.put("TMD", "THR");
2590 modifications.put("TNB", "CYS");
2591 modifications.put("TNR", "SER");
2592 modifications.put("TOX", "TRP");
2593 modifications.put("TP1", "THR");
2594 modifications.put("TPC", "CYS");
2595 modifications.put("TPG", "GLY");
2596 modifications.put("TPH", "XAA");
2597 modifications.put("TPL", "TRP");
2598 modifications.put("TPO", "THR");
2599 modifications.put("TPQ", "TYR");
2600 modifications.put("TQI", "TRP");
2601 modifications.put("TQQ", "TRP");
2602 modifications.put("TRF", "TRP");
2603 modifications.put("TRG", "LYS");
2604 modifications.put("TRN", "TRP");
2605 modifications.put("TRO", "TRP");
2606 modifications.put("TRP", "TRP");
2607 modifications.put("TRQ", "TRP");
2608 modifications.put("TRW", "TRP");
2609 modifications.put("TRX", "TRP");
2610 modifications.put("TS ", "ASN");
2611 modifications.put("TST", "XAA");
2612 modifications.put("TT ", "ASN");
2613 modifications.put("TTD", "THR");
2614 modifications.put("TTI", "UR3");
2615 modifications.put("TTM", "THR");
2616 modifications.put("TTQ", "TRP");
2617 modifications.put("TTS", "TYR");
2618 modifications.put("TY1", "TYR");
2619 modifications.put("TY2", "TYR");
2620 modifications.put("TY3", "TYR");
2621 modifications.put("TY5", "TYR");
2622 modifications.put("TYB", "TYR");
2623 modifications.put("TYI", "TYR");
2624 modifications.put("TYJ", "TYR");
2625 modifications.put("TYN", "TYR");
2626 modifications.put("TYO", "TYR");
2627 modifications.put("TYQ", "TYR");
2628 modifications.put("TYR", "TYR");
2629 modifications.put("TYS", "TYR");
2630 modifications.put("TYT", "TYR");
2631 modifications.put("TYU", "ASN");
2632 modifications.put("TYW", "TYR");
2633 modifications.put("TYX", "XAA");
2634 modifications.put("TYY", "TYR");
2635 modifications.put("TZB", "XAA");
2636 modifications.put("TZO", "XAA");
2637 modifications.put("U ", "UR3");
2638 modifications.put("U25", "UR3");
2639 modifications.put("U2L", "UR3");
2640 modifications.put("U2N", "UR3");
2641 modifications.put("U2P", "UR3");
2642 modifications.put("U31", "UR3");
2643 modifications.put("U33", "UR3");
2644 modifications.put("U34", "UR3");
2645 modifications.put("U36", "UR3");
2646 modifications.put("U37", "UR3");
2647 modifications.put("U8U", "UR3");
2648 modifications.put("UAR", "UR3");
2649 modifications.put("UCL", "UR3");
2650 modifications.put("UD5", "UR3");
2651 modifications.put("UDP", "ASN");
2652 modifications.put("UFP", "ASN");
2653 modifications.put("UFR", "UR3");
2654 modifications.put("UFT", "UR3");
2655 modifications.put("UMA", "ALA");
2656 modifications.put("UMP", "UR3");
2657 modifications.put("UMS", "UR3");
2658 modifications.put("UN1", "XAA");
2659 modifications.put("UN2", "XAA");
2660 modifications.put("UNK", "XAA");
2661 modifications.put("UR3", "UR3");
2662 modifications.put("URD", "UR3");
2663 modifications.put("US1", "UR3");
2664 modifications.put("US2", "UR3");
2665 modifications.put("US3", "THR");
2666 modifications.put("US5", "UR3");
2667 modifications.put("USM", "UR3");
2668 modifications.put("VAD", "VAL");
2669 modifications.put("VAF", "VAL");
2670 modifications.put("VAL", "VAL");
2671 modifications.put("VB1", "LYS");
2672 modifications.put("VDL", "XAA");
2673 modifications.put("VLL", "XAA");
2674 modifications.put("VLM", "XAA");
2675 modifications.put("VMS", "XAA");
2676 modifications.put("VOL", "XAA");
2677 modifications.put("WCR", "GYG");
2678 modifications.put("X ", "GLY");
2679 modifications.put("X2W", "GLU");
2680 modifications.put("X4A", "ASN");
2681 modifications.put("X9Q", "AFG");
2682 modifications.put("XAD", "ALA");
2683 modifications.put("XAE", "ASN");
2684 modifications.put("XAL", "ALA");
2685 modifications.put("XAR", "ASN");
2686 modifications.put("XCL", "CYS");
2687 modifications.put("XCN", "CYS");
2688 modifications.put("XCP", "XAA");
2689 modifications.put("XCR", "CYS");
2690 modifications.put("XCS", "ASN");
2691 modifications.put("XCT", "CYS");
2692 modifications.put("XCY", "CYS");
2693 modifications.put("XGA", "ASN");
2694 modifications.put("XGL", "GLY");
2695 modifications.put("XGR", "GLY");
2696 modifications.put("XGU", "GLY");
2697 modifications.put("XPR", "PRO");
2698 modifications.put("XSN", "ASN");
2699 modifications.put("XTH", "THR");
2700 modifications.put("XTL", "THR");
2701 modifications.put("XTR", "THR");
2702 modifications.put("XTS", "GLY");
2703 modifications.put("XTY", "ASN");
2704 modifications.put("XUA", "ALA");
2705 modifications.put("XUG", "GLY");
2706 modifications.put("XX1", "LYS");
2707 modifications.put("XXY", "THG");
2708 modifications.put("XYG", "DYG");
2709 modifications.put("Y ", "ALA");
2710 modifications.put("YCM", "CYS");
2711 modifications.put("YG ", "GLY");
2712 modifications.put("YOF", "TYR");
2713 modifications.put("YRR", "ASN");
2714 modifications.put("YYG", "GLY");
2715 modifications.put("Z ", "CYS");
2716 modifications.put("Z01", "ALA");
2717 modifications.put("ZAD", "ALA");
2718 modifications.put("ZAL", "ALA");
2719 modifications.put("ZBC", "CYS");
2720 modifications.put("ZBU", "UR3");
2721 modifications.put("ZCL", "PHE");
2722 modifications.put("ZCY", "CYS");
2723 modifications.put("ZDU", "UR3");
2724 modifications.put("ZFB", "XAA");
2725 modifications.put("ZGU", "GLY");
2726 modifications.put("ZHP", "ASN");
2727 modifications.put("ZTH", "THR");
2728 modifications.put("ZU0", "THR");
2729 modifications.put("ZZJ", "ALA");
2733 public static String getCanonicalAminoAcid(String aA)
2735 String canonical = modifications.get(aA);
2736 return canonical == null ? aA : canonical;
2739 // main method generates perl representation of residue property hash
2741 public static void main(String[] args)
2743 Hashtable<String, Vector<String>> aaProps = new Hashtable<String, Vector<String>>();
2744 System.out.println("my %aa = {");
2745 // invert property hashes
2746 for (String pname : propHash.keySet())
2748 Map<String, Integer> phash = propHash.get(pname);
2749 for (String rname : phash.keySet())
2751 Vector<String> aprops = aaProps.get(rname);
2754 aprops = new Vector<String>();
2755 aaProps.put(rname, aprops);
2757 Integer hasprop = phash.get(rname);
2758 if (hasprop.intValue() == 1)
2760 aprops.addElement(pname);
2764 Enumeration<String> res = aaProps.keys();
2765 while (res.hasMoreElements())
2767 String rname = res.nextElement();
2769 System.out.print("'" + rname + "' => [");
2770 Enumeration<String> props = aaProps.get(rname).elements();
2771 while (props.hasMoreElements())
2773 System.out.print("'" + props.nextElement() + "'");
2774 if (props.hasMoreElements())
2776 System.out.println(", ");
2779 System.out.println("]" + (res.hasMoreElements() ? "," : ""));
2781 System.out.println("};");
2787 * Returns a list of residue characters for the specified inputs
2789 * @param forNucleotide
2790 * @param includeAmbiguous
2793 public static List<String> getResidues(boolean forNucleotide,
2794 boolean includeAmbiguous)
2796 List<String> result = new ArrayList<String>();
2799 for (String nuc : nucleotideName.keySet())
2801 int val = nucleotideIndex[nuc.charAt(0)];
2802 if ((!includeAmbiguous && val > 4) || (val >= maxNucleotideIndex))
2806 nuc = nuc.toUpperCase();
2807 if (!result.contains(nuc))
2818 for (String res : aa3Hash.keySet())
2820 int index = aa3Hash.get(res).intValue();
2821 if ((!includeAmbiguous && index >= 20) || index >= maxProteinIndex)
2825 res = res.toUpperCase();
2826 if (!result.contains(res))
2837 * Returns the single letter code for a three letter code, or '0' if not known
2839 * @param threeLetterCode
2840 * not case sensitive
2843 public static char getSingleCharacterCode(String threeLetterCode)
2845 if (threeLetterCode == null)
2849 Integer index = ResidueProperties.aa3Hash.get(threeLetterCode
2851 return index == null ? '0' : aa[index].charAt(0);