Implemented clustal alignment via jemboss.
authorjprocter <Jim Procter>
Sat, 15 Jan 2005 15:04:16 +0000 (15:04 +0000)
committerjprocter <Jim Procter>
Sat, 15 Jan 2005 15:04:16 +0000 (15:04 +0000)
src/jalview/gui/AlignFrame.java

index f7b4ac5..96ba962 100755 (executable)
@@ -16,6 +16,7 @@ import jalview.schemes.*;
 import jalview.datamodel.*;\r
 import jalview.analysis.*;\r
 import jalview.io.*;\r
+import jalview.ws.*;\r
 import MCview.*;\r
 import java.awt.*;\r
 import java.awt.event.*;\r
@@ -23,6 +24,7 @@ import java.awt.print.*;
 import javax.swing.*;\r
 import javax.swing.event.*;\r
 import java.util.*;\r
+import jalview.datamodel.SequenceI;\r
 \r
 public class AlignFrame extends GAlignFrame\r
 {\r
@@ -456,7 +458,7 @@ public class AlignFrame extends GAlignFrame
   }\r
 \r
 \r
-  public void clustalColour_actionPerformed(ActionEvent e)\r
+  public void Colour_actionPerformed(ActionEvent e)\r
   {\r
     viewport.setGlobalColourScheme(new ClustalxColourScheme( ));\r
     conservationMenuItem.setSelected(false);\r
@@ -795,15 +797,35 @@ public class AlignFrame extends GAlignFrame
 \r
   public void clustalAlignMenuItem_actionPerformed(ActionEvent e)\r
   {\r
-    JOptionPane.showInternalMessageDialog(this, "Jalview is currently being reengineered"\r
-                                  +"\nwithin the Barton Group, Dundee University."\r
-                                  +"\nThis will be available as a web service 2005",\r
-                                  "Web service", JOptionPane.INFORMATION_MESSAGE);\r
+    // JBPNote\r
+    // Should check to see if the server settings are valid\r
+    // Need visual-delay indication here.\r
+    Jemboss jemboss = new Jemboss();\r
+\r
+    Vector sv = viewport.getAlignment().getSequences();\r
+    SequenceI[] seqs = new SequenceI[sv.size()];\r
+\r
+    int i=0;\r
+    do\r
+    {\r
+      seqs[i] = (SequenceI) sv.elementAt(i);\r
+    } while (++i<sv.size());\r
+\r
+    SequenceI[] alignment = jemboss.clustalW(seqs); // gaps removed within method\r
+\r
+    if (alignment != null)\r
+    {\r
+      AlignFrame af = new AlignFrame(new Alignment(alignment));\r
+      Desktop.addInternalFrame(af, getTitle().concat(" - ClustalW Alignment"), \r
+                               700, 500); // JBPNote - is there a new window geom. property ?\r
+    }\r
   }\r
 \r
   public void pdbTest_actionPerformed(ActionEvent e)\r
   {\r
-   String reply = JOptionPane.showInternalInputDialog(this, "Enter pdb code", "PDB test viewer", JOptionPane.QUESTION_MESSAGE);\r
+   String reply = \r
+       JOptionPane.showInternalInputDialog(this, "Enter pdb code", \r
+                                           "PDB test viewer", JOptionPane.QUESTION_MESSAGE);\r
 \r
    String url = "http://www.ebi.ac.uk/cgi-bin/pdbfetch?id=1a4u";\r
    if (reply.length()>1)\r