From: amwaterhouse Date: Thu, 18 Nov 2004 18:37:45 +0000 (+0000) Subject: updates X-Git-Tag: Release_2_0~917 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=28c732f6b0a3a43029bcc529fef8ac1174befa69;p=jalview.git updates --- diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index aad8014..cc5d760 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -1,7 +1,10 @@ package jalview.datamodel; - +import jalview.analysis.*; import java.awt.*; +import java.util.StringTokenizer; +import MCview.*; + public class Sequence implements SequenceI { @@ -13,6 +16,54 @@ public class Sequence implements SequenceI protected int charHeight; protected String displayId; protected Color color = Color.white; + PDBfile pdb; + public int maxchain = -1; + + public int pdbstart; + public int pdbend; + public int seqstart; + public int seqend; + public void setPDBfile(PDBfile pdb) + { + this.pdb = pdb; + int max = -10; + maxchain = -1; + + for (int i=0; i < pdb.chains.size(); i++) { + + System.out.println("PDB sequence = " + ((PDBChain)pdb.chains.elementAt(i)).sequence); + // Now lets compare the sequences to get + // the start and end points. + + + StringTokenizer str = new StringTokenizer(sequence, "."); + String newString = ""; + + while (str.hasMoreTokens()) { + newString += str.nextToken(); + } + // Align the sequence to the pdb + AlignSeq as = new AlignSeq(this,((PDBChain)pdb.chains.elementAt(i)).sequence,"pep"); + as.calcScoreMatrix(); + as.traceAlignment(); + as.printAlignment(); + + System.out.println("Score = " + as.maxscore); + if (as.maxscore > max) { + System.out.println("New max score"); + max = as.maxscore; + maxchain = i; + + pdbstart = as.seq2start; + pdbend = as.seq2end; + seqstart = as.seq1start - 1 ; + seqend = as.seq1end -1; + } + + System.out.println("PDB start/end " + pdbstart + " " + pdbend); + System.out.println("SEQ start/end " + seqstart + " " + seqend); + } + } public Sequence(String name, String sequence, int start, int end) {