X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FPIDColourScheme.java;h=1575a6a5d8a7a1f87f1138cca08995bc8c48cf31;hb=ec187a3251292293356cc9ee42f90d5c7d5a3a78;hp=9dc4c66aa729c9086b2d84d37a47f47432bea273;hpb=503ebba0021fa583fa7af58f9406f9234274fd7c;p=jalview.git diff --git a/src/jalview/schemes/PIDColourScheme.java b/src/jalview/schemes/PIDColourScheme.java index 9dc4c66..1575a6a 100755 --- a/src/jalview/schemes/PIDColourScheme.java +++ b/src/jalview/schemes/PIDColourScheme.java @@ -40,7 +40,7 @@ public class PIDColourScheme char res = s.charAt(0); if ('a' <= res && res <= 'z') { - s = Character.toString(res -= ('a' - 'A')); + s = String.valueOf(res -= ('a' - 'A')); } @@ -49,31 +49,35 @@ public class PIDColourScheme 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( res )) + 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; } }