public class Blosum62ColourScheme extends ResidueColourScheme\r
{\r
\r
- // need to keep an eye on the changing visible consensus sequence\r
- AlignViewport av;\r
-\r
- public Blosum62ColourScheme(AlignViewport av)\r
+ public Blosum62ColourScheme()\r
{\r
super();\r
- this.av = av;\r
}\r
\r
- public Color findColour(String s, int j, Vector aa)\r
+ public Color findColour(String s, int j)\r
{\r
+ Hashtable hash = (Hashtable)consensus.elementAt(j);\r
+\r
+ if (!jalview.util.Comparison.isGap((s.charAt(0))))\r
+ {\r
+ String max = (String)hash.get("maxResidue");\r
\r
- if (!jalview.util.Comparison.isGap((s.charAt(0))))\r
- {\r
- String max = av.getVisibleConsensus().charAt(j) + "";\r
+ if (max.indexOf(s)>-1)\r
+ return new Color(154, 154, 255);\r
+ else {\r
\r
- if (s.equals(max))\r
- return new Color(154, 154, 255);\r
- else if (ResidueProperties.getBLOSUM62(max, s) > 0)\r
+ int c = 0,\r
+ max_aa=0,\r
+ n=max.length();\r
+ do {\r
+ c+=ResidueProperties.getBLOSUM62(max.substring(max_aa, max_aa+1), s);\r
+ } while (++max_aa<n);\r
+\r
+ if (c>0)\r
return new Color(204, 204, 255);\r
else\r
return Color.white;\r
-\r
}\r
- else\r
+ }\r
+ else\r
return Color.white;\r
\r
}\r
\r
public boolean canThreshold()\r
{\r
- return false;\r
+ return true;\r
}\r
\r
}\r