X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fschemes%2FPIDColourScheme.java;h=1575a6a5d8a7a1f87f1138cca08995bc8c48cf31;hb=04011072920c5e2587a8d549869ee47e28ad7d81;hp=8cea5071aa04572c3a7fb34f1d1a56137cc03c08;hpb=96786b7b949dc261a9556e13a17870166915d0e9;p=jalview.git diff --git a/src/jalview/schemes/PIDColourScheme.java b/src/jalview/schemes/PIDColourScheme.java index 8cea507..1575a6a 100755 --- a/src/jalview/schemes/PIDColourScheme.java +++ b/src/jalview/schemes/PIDColourScheme.java @@ -37,34 +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; + currentColour = Color.white; double sc = 0; - if ( (Integer.parseInt(consensus[j].get("maxCount").toString()) != -1) && - consensus[j].contains(s)) - { - sc = ((Float)consensus[j].get(ignoreGaps)).floatValue(); + if(consensus.length<=j) + return Color.white; - 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; } }