X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FPIDColourScheme.java;h=e1dbf4696706b9cd4b8c96bb4a6cf7f76d8a04cf;hb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;hp=86868948cbaabc6905181855e9ce8f6ac46c030c;hpb=4d2e0d36506302cc00677527725bcccbdf27d766;p=jalview.git diff --git a/src/jalview/schemes/PIDColourScheme.java b/src/jalview/schemes/PIDColourScheme.java index 8686894..e1dbf46 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) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2007 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 @@ -20,8 +20,8 @@ package jalview.schemes; import java.awt.*; +import jalview.analysis.*; import jalview.datamodel.*; -import jalview.analysis.AAFrequency; public class PIDColourScheme extends ResidueColourScheme @@ -45,7 +45,7 @@ public class PIDColourScheme if (consensus == null || j >= consensus.length - || consensus[j]==null) + || consensus[j] == null) { return Color.white; } @@ -59,30 +59,35 @@ public class PIDColourScheme double sc = 0; - if(consensus.length<=j) + if (consensus.length <= j) + { return Color.white; + } - if ( (Integer.parseInt(consensus[j].get(AAFrequency.MAXCOUNT).toString()) != -1) && - consensus[j].contains(String.valueOf(c))) - { - sc = ( (Float) consensus[j].get(ignoreGaps)).floatValue(); + if ( (Integer.parseInt(consensus[j].get(AAFrequency.MAXCOUNT).toString()) != + -1) && + consensus[j].contains(String.valueOf(c))) + { + sc = ( (Float) consensus[j].get(ignoreGaps)).floatValue(); - if (!jalview.util.Comparison.isGap(c)) + if (!jalview.util.Comparison.isGap(c)) + { + for (int i = 0; i < thresholds.length; i++) { - for (int i = 0; i < thresholds.length; i++) + if (sc > thresholds[i]) { - if (sc > thresholds[i]) - { - currentColour = pidColours[i]; + currentColour = pidColours[i]; - break; - } + break; } } } + } - if(conservationColouring) + if (conservationColouring) + { currentColour = applyConservation(currentColour, j); + } return currentColour; }