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