*/\r
package jalview.schemes;\r
\r
-import java.util.*;\r
-\r
import java.awt.*;\r
\r
import jalview.datamodel.*;\r
}\r
\r
Color c = Color.white;\r
- Hashtable hash = (Hashtable) consensus.elementAt(j);\r
\r
double sc = 0;\r
\r
- if ( (Integer.parseInt(hash.get("maxCount").toString()) != -1) &&\r
- hash.contains(s))\r
+ if ( (Integer.parseInt(consensus[j].get("maxCount").toString()) != -1) &&\r
+ consensus[j].contains(s))\r
{\r
- sc = ( ( (Integer) hash.get(s)).intValue() * 100.0) /\r
- ( (Integer) hash.get(\r
- "size")).intValue();\r
+ sc = ((Float)consensus[j].get(ignoreGaps)).floatValue();\r
\r
- // MC Should be isGap\r
if (!jalview.util.Comparison.isGap( (s.charAt(0))))\r
{\r
for (int i = 0; i < thresholds.length; i++)\r
Color[] colors;\r
int threshold = 0;\r
\r
+ /* Set when threshold colouring to either pid_gaps or pid_nogaps*/\r
+ protected String ignoreGaps = "pid_gaps";\r
+\r
/** DOCUMENT ME!! */\r
- public Vector consensus;\r
+ public Hashtable [] consensus;\r
\r
/**\r
* Creates a new ResidueColourScheme object.\r
*\r
* @param consensus DOCUMENT ME!\r
*/\r
- public void setConsensus(Vector consensus)\r
+ public void setConsensus(Vector vconsensus)\r
{\r
- this.consensus = consensus;\r
+ int i, iSize=vconsensus.size();\r
+ consensus = new Hashtable[iSize];\r
+ for(i=0; i<iSize; i++)\r
+ consensus[i] = (Hashtable)vconsensus.elementAt(i);\r
}\r
\r
/**\r
*\r
* @param ct DOCUMENT ME!\r
*/\r
- public void setThreshold(int ct)\r
+ public void setThreshold(int ct, boolean ignoreGaps)\r
{\r
threshold = ct;\r
+ if(ignoreGaps)\r
+ this.ignoreGaps = "pid_nogaps";\r
+ else\r
+ this.ignoreGaps = "pid_gaps";\r
}\r
\r
/**\r
*/\r
public boolean aboveThreshold(String s, int j)\r
{\r
- Hashtable hash = (Hashtable) consensus.elementAt(j);\r
-\r
- if ((((Integer) hash.get("maxCount")).intValue() != -1) &&\r
- hash.contains(s))\r
+ if(consensus==null)\r
+ System.out.println("its null");\r
+ if ((((Integer) consensus[j].get("maxCount")).intValue() != -1) &&\r
+ consensus[j].contains(s))\r
{\r
- //// resCount//////////////////// ///////////////seq count////////////\r
- double sc = (((Integer) hash.get(s)).intValue() * 100.0) / ((Integer) hash.get(\r
- "size")).intValue();\r
+ float ratio = ((Float)consensus[j].get(ignoreGaps)).floatValue();\r
\r
- if (sc >= threshold)\r
+ if (ratio >= threshold)\r
{\r
return true;\r
}\r
static\r
{\r
aa2Triplet.put("A", "ALA");\r
+ aa2Triplet.put("a", "ALA");\r
aa2Triplet.put("R", "ARG");\r
+ aa2Triplet.put("r", "ARG");\r
aa2Triplet.put("N", "ASN");\r
+ aa2Triplet.put("n", "ASN");\r
aa2Triplet.put("D", "ASP");\r
+ aa2Triplet.put("d", "ASP");\r
aa2Triplet.put("C", "CYS");\r
+ aa2Triplet.put("c", "CYS");\r
aa2Triplet.put("Q", "GLN");\r
+ aa2Triplet.put("q", "GLN");\r
aa2Triplet.put("E", "GLU");\r
+ aa2Triplet.put("e", "GLU");\r
aa2Triplet.put("G", "GLY");\r
+ aa2Triplet.put("g", "GLY");\r
aa2Triplet.put("H", "HIS");\r
+ aa2Triplet.put("h", "HIS");\r
aa2Triplet.put("I", "ILE");\r
+ aa2Triplet.put("i", "ILE");\r
aa2Triplet.put("L", "LEU");\r
+ aa2Triplet.put("l", "LEU");\r
aa2Triplet.put("K", "LYS");\r
+ aa2Triplet.put("k", "LYS");\r
aa2Triplet.put("M", "MET");\r
+ aa2Triplet.put("m", "MET");\r
aa2Triplet.put("F", "PHE");\r
+ aa2Triplet.put("f", "PHE");\r
aa2Triplet.put("P", "PRO");\r
+ aa2Triplet.put("p", "PRO");\r
aa2Triplet.put("S", "SER");\r
+ aa2Triplet.put("s", "SER");\r
aa2Triplet.put("T", "THR");\r
+ aa2Triplet.put("t", "THR");\r
aa2Triplet.put("W", "TRP");\r
+ aa2Triplet.put("w", "TRP");\r
aa2Triplet.put("Y", "TYR");\r
+ aa2Triplet.put("y", "TYR");\r
aa2Triplet.put("V", "VAL");\r
+ aa2Triplet.put("v", "VAL");\r
}\r
\r
public static String[] aa =\r