package jalview.datamodel;\r
\r
-\r
+import jalview.analysis.*;\r
import java.awt.*;\r
+import java.util.StringTokenizer;\r
+import MCview.*;\r
+\r
\r
public class Sequence implements SequenceI\r
{\r
protected int charHeight;\r
protected String displayId;\r
protected Color color = Color.white;\r
+ PDBfile pdb;\r
+ public int maxchain = -1;\r
+\r
+ public int pdbstart;\r
+ public int pdbend;\r
+ public int seqstart;\r
+ public int seqend;\r
+ public void setPDBfile(PDBfile pdb)\r
+ {\r
+ this.pdb = pdb;\r
+ int max = -10;\r
+ maxchain = -1;\r
+\r
+ for (int i=0; i < pdb.chains.size(); i++) {\r
+\r
+ System.out.println("PDB sequence = " + ((PDBChain)pdb.chains.elementAt(i)).sequence);\r
+ // Now lets compare the sequences to get\r
+ // the start and end points.\r
+\r
+\r
+ StringTokenizer str = new StringTokenizer(sequence, ".");\r
+ String newString = "";\r
+\r
+ while (str.hasMoreTokens()) {\r
+ newString += str.nextToken();\r
+ }\r
+ // Align the sequence to the pdb\r
+ AlignSeq as = new AlignSeq(this,((PDBChain)pdb.chains.elementAt(i)).sequence,"pep");\r
+ as.calcScoreMatrix();\r
+ as.traceAlignment();\r
+ as.printAlignment();\r
+\r
+ System.out.println("Score = " + as.maxscore);\r
+ if (as.maxscore > max) {\r
+ System.out.println("New max score");\r
+ max = as.maxscore;\r
+ maxchain = i;\r
+\r
+ pdbstart = as.seq2start;\r
+ pdbend = as.seq2end;\r
+ seqstart = as.seq1start - 1 ;\r
+ seqend = as.seq1end -1;\r
+ }\r
+\r
+ System.out.println("PDB start/end " + pdbstart + " " + pdbend);\r
+ System.out.println("SEQ start/end " + seqstart + " " + seqend);\r
+ }\r
+ }\r
\r
public Sequence(String name, String sequence, int start, int end)\r
{\r