X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FClustalxColourScheme.java;h=eaf2a5f96e10ce729406c13d848ff438439deac8;hb=8bb6d4ca134e9b72bfd44aff6a51c6b14185a69d;hp=1e38a6d00ec197ba359e48b0e8ce5899f5d3b2c4;hpb=1774759f889464551c244c070b7771dabbb4bad2;p=jalview.git diff --git a/src/jalview/schemes/ClustalxColourScheme.java b/src/jalview/schemes/ClustalxColourScheme.java index 1e38a6d..eaf2a5f 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 @@ -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,22 @@ 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) { - - if(cons2.length<=j) - return currentColour; + Color 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; @@ -284,7 +281,7 @@ public class ClustalxColourScheme } if(conservationColouring) - applyConservation(j); + currentColour = applyConservation(currentColour, j); return currentColour; }