X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FResidueProperties.java;h=65cc0f1181d99dd9d97b8e1aa4316303e9ae7c9d;hb=04011072920c5e2587a8d549869ee47e28ad7d81;hp=0b71381a2a027b7819a8e5ec844208ed02a25c4f;hpb=96786b7b949dc261a9556e13a17870166915d0e9;p=jalview.git diff --git a/src/jalview/schemes/ResidueProperties.java b/src/jalview/schemes/ResidueProperties.java index 0b71381..65cc0f1 100755 --- a/src/jalview/schemes/ResidueProperties.java +++ b/src/jalview/schemes/ResidueProperties.java @@ -25,10 +25,11 @@ import java.awt.*; public class ResidueProperties { //Stores residue codes/names and colours and other things - public static Hashtable aaHash = new Hashtable(); // stores the number value of the aa - public static Hashtable aa3Hash = new Hashtable(); - public static Hashtable aa2Triplet = new Hashtable(); - public static Hashtable nucleotideHash = new Hashtable(); + public static final Hashtable aaHash = new Hashtable(); // stores the number value of the aa + public static final Hashtable aa3Hash = new Hashtable(); + public static final Hashtable aa2Triplet = new Hashtable(); + public static final Hashtable nucleotideHash = new Hashtable(); + public static final Hashtable nucleotideName = new Hashtable(); static { @@ -55,6 +56,7 @@ public class ResidueProperties aaHash.put("B", new Integer(20)); aaHash.put("Z", new Integer(21)); aaHash.put("X", new Integer(22)); + aaHash.put("U", new Integer(22)); aaHash.put("a", new Integer(0)); aaHash.put("r", new Integer(1)); aaHash.put("n", new Integer(2)); @@ -78,6 +80,7 @@ public class ResidueProperties aaHash.put("b", new Integer(20)); aaHash.put("z", new Integer(21)); aaHash.put("x", new Integer(22)); + aaHash.put("u", new Integer(22)); aaHash.put("-", new Integer(23)); aaHash.put("*", new Integer(23)); aaHash.put(".", new Integer(23)); @@ -87,22 +90,49 @@ public class ResidueProperties static { nucleotideHash.put("A", new Integer(0)); + nucleotideHash.put("a", new Integer(0)); nucleotideHash.put("C", new Integer(1)); + nucleotideHash.put("c", new Integer(1)); nucleotideHash.put("G", new Integer(2)); + nucleotideHash.put("g", new Integer(2)); nucleotideHash.put("T", new Integer(3)); + nucleotideHash.put("t", new Integer(3)); nucleotideHash.put("U", new Integer(4)); + nucleotideHash.put("u", new Integer(4)); + nucleotideHash.put("I", new Integer(5)); + nucleotideHash.put("i", new Integer(5)); + nucleotideHash.put("X", new Integer(6)); + nucleotideHash.put("x", new Integer(6)); + nucleotideHash.put("R", new Integer(7)); + nucleotideHash.put("r", new Integer(7)); + nucleotideHash.put("Y", new Integer(8)); + nucleotideHash.put("y", new Integer(8)); + nucleotideHash.put("N", new Integer(9)); + nucleotideHash.put("n", new Integer(9)); + + + nucleotideName.put("A", "Adenine"); + nucleotideName.put("a", "Adenine"); + nucleotideName.put("G", "Guanine"); + nucleotideName.put("g", "Guanine"); + nucleotideName.put("C", "Cytosine"); + nucleotideName.put("c", "Cytosine"); + nucleotideName.put("T", "Thymine"); + nucleotideName.put("t", "Thymine"); + nucleotideName.put("U", "Uracil"); + nucleotideName.put("u", "Uracil"); + nucleotideName.put("I", "Inosine"); + nucleotideName.put("i", "Inosine"); + nucleotideName.put("X", "Xanthine"); + nucleotideName.put("x", "Xanthine"); + nucleotideName.put("R", "Unknown Purine"); + nucleotideName.put("r", "Unknown Purine"); + nucleotideName.put("Y", "Unknown Pyrimidine"); + nucleotideName.put("y", "Unknown Pyrimidine"); + nucleotideName.put("N", "Unknown"); + nucleotideName.put("n", "Unknown"); } - // These numbers should correspond to the indices in the Color hashes - public static Hashtable aaSpecialsHash = new Hashtable(); - - static - { - aaSpecialsHash.put("-", new Integer(23)); - aaSpecialsHash.put("*", new Integer(24)); - aaSpecialsHash.put(".", new Integer(25)); - aaSpecialsHash.put(" ", new Integer(26)); - } static { @@ -126,9 +156,10 @@ public class ResidueProperties aa3Hash.put("TRP", new Integer(17)); aa3Hash.put("TYR", new Integer(18)); aa3Hash.put("VAL", new Integer(19)); - aa3Hash.put("B", new Integer(20)); - aa3Hash.put("Z", new Integer(21)); - aa3Hash.put("X", new Integer(22)); + // IUB Nomenclature for ambiguous peptides + aa3Hash.put("ASX", new Integer(20)); // "B"; + aa3Hash.put("GLX", new Integer(21)); // X + aa3Hash.put("XAA", new Integer(22));// X unknown aa3Hash.put("-", new Integer(23)); aa3Hash.put("*", new Integer(23)); aa3Hash.put(".", new Integer(23)); @@ -179,13 +210,13 @@ public class ResidueProperties aa2Triplet.put("v", "VAL"); } - public static String[] aa = + public static final String[] aa = { "A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "_", "*", ".", " " }; - public static Color midBlue = new Color(100, 100, 255); - public static Vector scaleColours = new Vector(); + public static final Color midBlue = new Color(100, 100, 255); + public static final Vector scaleColours = new Vector(); static { @@ -201,7 +232,7 @@ public class ResidueProperties scaleColours.addElement(Color.white); } - public static Color[] taylor = + public static final Color[] taylor = { new Color(204, 255, 0), // A Greenish-yellowy-yellow new Color(0, 0, 255), // R Blueish-bluey-blue @@ -230,7 +261,7 @@ public class ResidueProperties Color.white, // * Color.white // . }; - public static Color[] nucleotide = + public static final Color[] nucleotide = { new Color(100, 247, 63), // A new Color(255, 179, 64), // C @@ -238,7 +269,7 @@ public class ResidueProperties new Color(60, 136, 238), // T new Color(60, 136, 238) // U }; - public static Color[] color = + public static final Color[] color = { Color.pink, // A midBlue, // R @@ -270,7 +301,7 @@ public class ResidueProperties }; // Dunno where I got these numbers from - public static double[] hyd2 = + public static final double[] hyd2 = { 0.62, //A 0.29, //R @@ -296,39 +327,39 @@ public class ResidueProperties 0.0, //Z 0.0 //X }; - public static double[] helix = + public static final double[] helix = { 1.42, 0.98, 0.67, 1.01, 0.70, 1.11, 1.51, 0.57, 1.00, 1.08, 1.21, 1.16, 1.45, 1.13, 0.57, 0.77, 0.83, 1.08, 0.69, 1.06, 0.84, 1.31, 1.00, 0.0 }; - public static double helixmin = 0.57; - public static double helixmax = 1.51; - public static double[] strand = + public static final double helixmin = 0.57; + public static final double helixmax = 1.51; + public static final double[] strand = { 0.83, 0.93, 0.89, 0.54, 1.19, 1.10, 0.37, 0.75, 0.87, 1.60, 1.30, 0.74, 1.05, 1.38, 0.55, 0.75, 1.19, 1.37, 1.47, 1.70, 0.72, 0.74, 1.0, 0.0 }; - public static double strandmin = 0.37; - public static double strandmax = 1.7; - public static double[] turn = + public static final double strandmin = 0.37; + public static final double strandmax = 1.7; + public static final double[] turn = { 0.66, 0.95, 1.56, 1.46, 1.19, 0.98, 0.74, 1.56, 0.95, 0.47, 0.59, 1.01, 0.60, 0.60, 1.52, 1.43, 0.96, 0.96, 1.14, 0.50, 1.51, 0.86, 1.00, 0, 0 }; - public static double turnmin = 0.47; - public static double turnmax = 1.56; - public static double[] buried = + public static final double turnmin = 0.47; + public static final double turnmax = 1.56; + public static final double[] buried = { 1.7, 0.1, 0.4, 0.4, 4.6, 0.3, 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, 2.9, 0.4, 0.3, 1.358, 0.00 }; - public static double buriedmin = 0.05; - public static double buriedmax = 4.6; + public static final double buriedmin = 0.05; + public static final double buriedmax = 4.6; // This is hydropathy index // Kyte, J., and Doolittle, R.F., J. Mol. Biol. // 1157, 105-132, 1982 - public static double[] hyd = + public static final double[] hyd = { 1.8, -4.5, -3.5, -3.5, 2.5, -3.5, -3.5, -0.4, -3.2, 4.5, 3.8, -3.9, 1.9, 2.8, -1.6, -0.8, -0.7, -0.9, -1.3, 4.2, -3.5, -3.5, -0.49, 0.0 @@ -536,7 +567,7 @@ public class ResidueProperties -8, -8, -8, -8, -8, -8, 1 }, }; - public static Hashtable ssHash = new Hashtable(); // stores the number value of the aa + public static final Hashtable ssHash = new Hashtable(); // stores the number value of the aa static { @@ -564,13 +595,13 @@ public class ResidueProperties { 1, 1, 1, 1, 1}, // - }; - public static Color[] pidColours = + public static final Color[] pidColours = { midBlue, new Color(153, 153, 255), // Color.lightGray, new Color(204, 204, 255), }; - public static float[] pidThresholds = + public static final float[] pidThresholds = { 80, 60, 40, }; public static Hashtable codonHash = new Hashtable(); @@ -793,27 +824,6 @@ public class ResidueProperties Phe.addElement("TTT"); } - public static Color[][] groupColors = - { - { - Color.red, Color.red.brighter(), Color.red.brighter().brighter()}, - { - Color.orange, Color.orange.brighter(), - Color.orange.brighter().brighter() - }, - { - Color.green, Color.green.brighter(), Color.green.brighter().brighter()}, - { - Color.blue, Color.blue.brighter(), Color.blue.brighter().brighter()}, - { - Color.magenta, Color.magenta.brighter(), - Color.magenta.brighter().brighter() - }, - { - Color.cyan, Color.cyan.brighter(), Color.cyan.brighter().brighter()}, - { - Color.pink, Color.pink.brighter(), Color.pink.brighter().brighter()}, - }; //Stores residue codes/names and colours and other things public static Hashtable propHash = new Hashtable(); @@ -1104,20 +1114,6 @@ public class ResidueProperties propHash.put("polar", polar); } - public static Hashtable chainColours = new Hashtable(); - - static - { - chainColours.put("A", Color.red); - chainColours.put("B", Color.orange); - chainColours.put("C", Color.yellow); - chainColours.put("D", Color.green); - chainColours.put("E", Color.cyan); - chainColours.put("F", Color.blue); - chainColours.put("G", Color.magenta); - chainColours.put("H", Color.pink); - } - private ResidueProperties() { } @@ -1203,7 +1199,7 @@ public class ResidueProperties String key = (String) e.nextElement(); Vector tmp = (Vector) codonHash.get(key); - if (tmp.contains(codon)) + if (tmp.contains(codon.toUpperCase())) { return key; } @@ -1211,9 +1207,4 @@ public class ResidueProperties return null; } - - public static Hashtable getChainColours() - { - return chainColours; - } }