X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FClustalxColourScheme.java;h=8dd8994d8f61f93d7045b9513c27568bc381ce96;hb=cb25f36c03700f3d42099d89a4f676c5d6cc63d7;hp=4c20873c4a62a690dda22d31636ece89670ca1a4;hpb=d640a8ce605b836b2e6eb1771994d3baef5c31a0;p=jalview.git diff --git a/src/jalview/schemes/ClustalxColourScheme.java b/src/jalview/schemes/ClustalxColourScheme.java index 4c20873..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) 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 @@ -70,23 +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 = ResidueProperties.aaIndex[seq.charAt(i)]; + res = ResidueProperties.aaIndex[seq[i]]; } cons2[i][res]++; @@ -240,22 +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 || (threshold != 0 && !aboveThreshold(s, j))) + if (cons2.length <= j || (threshold != 0 && !aboveThreshold(c, j))) { return Color.white; } - int i = ResidueProperties.aaIndex[s.charAt(0)]; + int i = ResidueProperties.aaIndex[c]; currentColour = Color.white; @@ -264,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) { @@ -280,8 +279,10 @@ public class ClustalxColourScheme } } - if(conservationColouring) + if (conservationColouring) + { currentColour = applyConservation(currentColour, j); + } return currentColour; }