X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FClustalxColourScheme.java;h=4c20873c4a62a690dda22d31636ece89670ca1a4;hb=d587f1aa61946dc14f6f089cf1dc2a3116cfb773;hp=addf00f4e02549b301862a5534eccc8bfe801690;hpb=efc31b4a8d5cee63555586804a2b79c06bdb5a14;p=jalview.git diff --git a/src/jalview/schemes/ClustalxColourScheme.java b/src/jalview/schemes/ClustalxColourScheme.java index addf00f..4c20873 100755 --- a/src/jalview/schemes/ClustalxColourScheme.java +++ b/src/jalview/schemes/ClustalxColourScheme.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 @@ -86,8 +86,7 @@ public class ClustalxColourScheme } else { - res = ( (Integer) ResidueProperties.aaHash.get(seq.charAt(i) + - "")).intValue(); + res = ResidueProperties.aaIndex[seq.charAt(i)]; } cons2[i][res]++; @@ -248,37 +247,43 @@ public class ClustalxColourScheme public Color findColour(String s, int j) { - if ( (threshold != 0) && !aboveThreshold(s, j)) + Color currentColour; + + + if ( cons2.length<=j || (threshold != 0 && !aboveThreshold(s, j))) { return Color.white; } - int i = ( (Integer) ResidueProperties.aaHash.get(s)).intValue(); + int i = ResidueProperties.aaIndex[s.charAt(0)]; - 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) + currentColour = applyConservation(currentColour, j); + + return currentColour; } }