\r
public Color findColour(String s, int j)\r
{\r
+\r
+ if(cons2.length<=j)\r
+ return currentColour;\r
+\r
+\r
if ( (threshold != 0) && !aboveThreshold(s, j))\r
{\r
return Color.white;\r
return currentColour;\r
}\r
\r
- for (int k = 0; k < ResidueColour[i].conses.length; k++)\r
+ for (int k = 0; k < ResidueColour[i].conses.length; k++)\r
+ {\r
+ if (ResidueColour[i].conses[k].isConserved(cons2, j, size))\r
{\r
- if (ResidueColour[i].conses[k].isConserved(cons2, j, size))\r
- {\r
- currentColour = ResidueColour[i].c;\r
- }\r
+ currentColour = ResidueColour[i].c;\r
}\r
+ }\r
\r
if (i == 4)\r
{\r
\r
double sc = 0;\r
\r
- if ( (Integer.parseInt(consensus[j].get("maxCount").toString()) != -1) &&\r
- consensus[j].contains(s))\r
- {\r
- sc = ((Float)consensus[j].get(ignoreGaps)).floatValue();\r
+ if(consensus.length<=j)\r
+ return Color.white;\r
\r
- if (!jalview.util.Comparison.isGap( res ))\r
+ if ( (Integer.parseInt(consensus[j].get("maxCount").toString()) != -1) &&\r
+ consensus[j].contains(s))\r
{\r
- for (int i = 0; i < thresholds.length; i++)\r
+ sc = ( (Float) consensus[j].get(ignoreGaps)).floatValue();\r
+\r
+ if (!jalview.util.Comparison.isGap(res))\r
{\r
- if (sc > thresholds[i])\r
+ for (int i = 0; i < thresholds.length; i++)\r
{\r
- currentColour = pidColours[i];\r
+ if (sc > thresholds[i])\r
+ {\r
+ currentColour = pidColours[i];\r
\r
- break;\r
+ break;\r
+ }\r
}\r
}\r
}\r
- }\r
\r
if(conservationColouring)\r
applyConservation(j);\r