X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FClustalxColourScheme.java;h=8dd8994d8f61f93d7045b9513c27568bc381ce96;hb=0eca27bca577e774acd5aefb165e7c6396a1995e;hp=1e38a6d00ec197ba359e48b0e8ce5899f5d3b2c4;hpb=1774759f889464551c244c070b7771dabbb4bad2;p=jalview.git diff --git a/src/jalview/schemes/ClustalxColourScheme.java b/src/jalview/schemes/ClustalxColourScheme.java index 1e38a6d..8dd8994 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) 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 @@ -70,24 +70,23 @@ public class ClustalxColourScheme int res; int i; int j = 0; - String seq; + char[] seq; while (j < seqs.size()) { seq = ( (SequenceI) seqs.elementAt(j)).getSequence(); - int end_j = seq.length() - 1; + int end_j = seq.length - 1; for (i = start; i <= end_j; i++) { - if ( (seq.length() - 1) < i) + if ( (seq.length - 1) < i) { res = 23; } else { - res = ( (Integer) ResidueProperties.aaHash.get(seq.charAt(i) + - "")).intValue(); + res = ResidueProperties.aaIndex[seq[i]]; } cons2[i][res]++; @@ -241,24 +240,21 @@ public class ClustalxColourScheme ResidueColour[19] = colours[0]; // V } - public Color findColour(String s) + public Color findColour(char c) { return Color.pink; } - public Color findColour(String s, int j) + public Color findColour(char c, int j) { + Color currentColour; - if(cons2.length<=j) - return currentColour; - - - if ( (threshold != 0) && !aboveThreshold(s, j)) + if (cons2.length <= j || (threshold != 0 && !aboveThreshold(c, j))) { return Color.white; } - int i = ( (Integer) ResidueProperties.aaHash.get(s)).intValue(); + int i = ResidueProperties.aaIndex[c]; currentColour = Color.white; @@ -267,13 +263,13 @@ public class ClustalxColourScheme return currentColour; } - for (int k = 0; k < ResidueColour[i].conses.length; k++) - { - if (ResidueColour[i].conses[k].isConserved(cons2, j, size)) + for (int k = 0; k < ResidueColour[i].conses.length; k++) { - currentColour = ResidueColour[i].c; + if (ResidueColour[i].conses[k].isConserved(cons2, j, size)) + { + currentColour = ResidueColour[i].c; + } } - } if (i == 4) { @@ -283,8 +279,10 @@ public class ClustalxColourScheme } } - if(conservationColouring) - applyConservation(j); + if (conservationColouring) + { + currentColour = applyConservation(currentColour, j); + } return currentColour; }