X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FPIDColourScheme.java;h=1575a6a5d8a7a1f87f1138cca08995bc8c48cf31;hb=04011072920c5e2587a8d549869ee47e28ad7d81;hp=cfc9f9472139dde27c2e9e215d87208813234b17;hpb=efc31b4a8d5cee63555586804a2b79c06bdb5a14;p=jalview.git diff --git a/src/jalview/schemes/PIDColourScheme.java b/src/jalview/schemes/PIDColourScheme.java index cfc9f94..1575a6a 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,38 +37,47 @@ 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)) - { - sc = ( ( (Integer) hash.get(s)).intValue() * 100.0) / - ( (Integer) hash.get( - "size")).intValue(); + if(consensus.length<=j) + return Color.white; - // MC Should be isGap - if (!jalview.util.Comparison.isGap( (s.charAt(0)))) + if ( (Integer.parseInt(consensus[j].get("maxCount").toString()) != -1) && + consensus[j].contains(s)) { - for (int i = 0; i < thresholds.length; i++) + sc = ( (Float) consensus[j].get(ignoreGaps)).floatValue(); + + if (!jalview.util.Comparison.isGap(res)) { - if (sc > thresholds[i]) + for (int i = 0; i < thresholds.length; i++) { - c = pidColours[i]; + if (sc > thresholds[i]) + { + currentColour = pidColours[i]; - break; + break; + } } } } - } - return c; + if(conservationColouring) + applyConservation(j); + + return currentColour; } }