X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FClustalxColourScheme.java;h=1e38a6d00ec197ba359e48b0e8ce5899f5d3b2c4;hb=91c5d2144a780716e755e99882acffe46b40f18f;hp=addf00f4e02549b301862a5534eccc8bfe801690;hpb=efc31b4a8d5cee63555586804a2b79c06bdb5a14;p=jalview.git diff --git a/src/jalview/schemes/ClustalxColourScheme.java b/src/jalview/schemes/ClustalxColourScheme.java index addf00f..1e38a6d 100755 --- a/src/jalview/schemes/ClustalxColourScheme.java +++ b/src/jalview/schemes/ClustalxColourScheme.java @@ -248,6 +248,11 @@ public class ClustalxColourScheme public Color findColour(String s, int j) { + + if(cons2.length<=j) + return currentColour; + + if ( (threshold != 0) && !aboveThreshold(s, j)) { return Color.white; @@ -255,30 +260,33 @@ public class ClustalxColourScheme int i = ( (Integer) ResidueProperties.aaHash.get(s)).intValue(); - Color c = Color.white; + currentColour = Color.white; if (i > 19) { - return c; + return currentColour; } - for (int k = 0; k < ResidueColour[i].conses.length; k++) + for (int k = 0; k < ResidueColour[i].conses.length; k++) + { + if (ResidueColour[i].conses[k].isConserved(cons2, j, size)) { - if (ResidueColour[i].conses[k].isConserved(cons2, j, size)) - { - c = ResidueColour[i].c; - } + currentColour = ResidueColour[i].c; } + } if (i == 4) { if (conses[27].isConserved(cons2, j, size)) { - c = (Color) colhash.get("PINK"); + currentColour = (Color) colhash.get("PINK"); } } - return c; + if(conservationColouring) + applyConservation(j); + + return currentColour; } }