X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fschemes%2FClustalxColourScheme.java;h=1bf8567861579edd333dcd8bd658f1a8bfa26f84;hb=79e0822af333c1c0597d53b0aa679846a590beb3;hp=0479e5c9854d3e584fa0957221f8b59bc6c21e11;hpb=1ecf6419aba86993b3c223bf5ec0fa79427baf85;p=jalview.git diff --git a/src/jalview/schemes/ClustalxColourScheme.java b/src/jalview/schemes/ClustalxColourScheme.java index 0479e5c..1bf8567 100755 --- a/src/jalview/schemes/ClustalxColourScheme.java +++ b/src/jalview/schemes/ClustalxColourScheme.java @@ -15,8 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* + package jalview.schemes; + +import jalview.datamodel.*; import java.util.*; import java.awt.*; @@ -42,14 +44,36 @@ public class ClustalxColourScheme implements ColourSchemeI } Vector colourTable = new Vector(); - public ClustalxColourScheme() { - this.cons2 = null; - this.size = 0; - makeColours(); - } - public ClustalxColourScheme(int[][] cons2, int size) { - this.cons2 = cons2; - this.size = size; + + + public ClustalxColourScheme(Vector seqs, int maxWidth) + { + cons2 = new int[maxWidth][24]; + int start = 0, end = maxWidth-1; + + // Initialize the array + for (int j=0;j<24;j++) + for (int i=0; i < maxWidth;i++) + cons2[i][j] = 0; + + int res,i, j = 0; + String seq; + while(j < seqs.size()) + { + seq = ( (SequenceI) seqs.elementAt(j)).getSequence(); + int end_j = seq.length()-1; + for (i = start; i <= end_j; i++) + { + if(seq.length()-119) + return c; + + for (int k=0; k < ResidueColour[i].conses.length ; k++) + if (ResidueColour[i].conses[k].isConserved(cons2,j,size)) + c = ResidueColour[i].c; + + if (i == 4) + { + if (conses[27].isConserved(cons2, j, size)) + c = (Color) colhash.get("PINK"); } + + + return c; + + } + + public void setConsensus(Vector consensus) + { + // Clustal colouring cannot be coloured by PID } - public void setColours(SequenceGroup sg) { - for (int j = 0; j < sg.sequences.size(); j++) { + public boolean canThreshold() + { + return false; + } - DrawableSequence s = (DrawableSequence)sg.sequences.elementAt(j); - for (int i = 0; i < s.getSequence().length();i++) { - setColours(s,i); - } - } + public boolean isUserDefinable() + { + return false; } } -*/ +class ConsensusColour { + + Consensus[] conses; + Color c; + + public ConsensusColour(Color c,Consensus[] conses) { + this.conses = conses; + // this.list = list; + this.c = c; + } +} + + + + + + + + + +