X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FPIDColourScheme.java;h=66f180be4c72186c75934d0e2cb817a4dd865b8f;hb=c6f74fc7b3c9bcf8571435e5f52169d72581af15;hp=cfc9f9472139dde27c2e9e215d87208813234b17;hpb=efc31b4a8d5cee63555586804a2b79c06bdb5a14;p=jalview.git diff --git a/src/jalview/schemes/PIDColourScheme.java b/src/jalview/schemes/PIDColourScheme.java index cfc9f94..66f180b 100755 --- a/src/jalview/schemes/PIDColourScheme.java +++ b/src/jalview/schemes/PIDColourScheme.java @@ -18,8 +18,6 @@ */ package jalview.schemes; -import java.util.*; - import java.awt.*; import jalview.datamodel.*; @@ -39,31 +37,34 @@ public class PIDColourScheme public Color findColour(String s, int j) { + char res = s.charAt(0); + if ('a' <= res && res <= 'z') + { + s = String.valueOf(res -= ('a' - 'A')); + } + + if ( (threshold != 0) && !aboveThreshold(s, j)) { return Color.white; } - Color c = Color.white; - Hashtable hash = (Hashtable) consensus.elementAt(j); + currentColour = Color.white; double sc = 0; - if ( (Integer.parseInt(hash.get("maxCount").toString()) != -1) && - hash.contains(s)) + if ( (Integer.parseInt(consensus[j].get("maxCount").toString()) != -1) && + consensus[j].contains(s)) { - sc = ( ( (Integer) hash.get(s)).intValue() * 100.0) / - ( (Integer) hash.get( - "size")).intValue(); + sc = ((Float)consensus[j].get(ignoreGaps)).floatValue(); - // MC Should be isGap - if (!jalview.util.Comparison.isGap( (s.charAt(0)))) + if (!jalview.util.Comparison.isGap( res )) { for (int i = 0; i < thresholds.length; i++) { if (sc > thresholds[i]) { - c = pidColours[i]; + currentColour = pidColours[i]; break; } @@ -71,6 +72,9 @@ public class PIDColourScheme } } - return c; + if(conservationColouring) + applyConservation(j); + + return currentColour; } }