X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FPIDColourScheme.java;h=a79f0833da6dc4ffcc7d25e1b9b315cf6a10bc56;hb=174230b4233d9ce80f94527768d2cd2f76da11ab;hp=3d1c18b7f5c726482b8e22efd71b6fde3fa9690d;hpb=83b55697263efc7b0c660eba6ea7091f6904257d;p=jalview.git diff --git a/src/jalview/schemes/PIDColourScheme.java b/src/jalview/schemes/PIDColourScheme.java index 3d1c18b..a79f083 100755 --- a/src/jalview/schemes/PIDColourScheme.java +++ b/src/jalview/schemes/PIDColourScheme.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -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; } }