Prompt before blasting
authoramwaterhouse <Andrew Waterhouse>
Mon, 31 Oct 2005 15:53:31 +0000 (15:53 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 31 Oct 2005 15:53:31 +0000 (15:53 +0000)
src/jalview/io/SequenceFeatureFetcher.java

index 520ba03..35a9a95 100755 (executable)
@@ -96,7 +96,7 @@ public class SequenceFeatureFetcher implements Runnable
   public SequenceFeatureFetcher(AlignmentI align, AlignmentPanel ap)\r
   {\r
     unknownSequences = new ArrayList();\r
-    this.align = align;\r
+    this.align = align.getDataset();\r
     this.ap = ap;\r
 \r
     Thread thread = new Thread(this);\r
@@ -139,6 +139,7 @@ public class SequenceFeatureFetcher implements Runnable
                                           "xml", null);\r
 \r
 \r
+\r
           if (file != null)\r
           {\r
             ReadUniprotFile(file, align, ids);\r
@@ -163,6 +164,13 @@ public class SequenceFeatureFetcher implements Runnable
 \r
     if (unknownSequences.size() > 0)\r
     {\r
+      int reply = javax.swing.JOptionPane.showInternalConfirmDialog(\r
+          Desktop.desktop, "Couldn't find a match for "+unknownSequences.size()+" sequences."\r
+              +"\nPerform blast for unknown sequences?",\r
+                  "Blast for Unidentified Sequences",\r
+                   javax.swing.JOptionPane.YES_NO_OPTION, javax.swing.JOptionPane.QUESTION_MESSAGE);\r
+\r
+      if(reply == javax.swing.JOptionPane.YES_OPTION)\r
        new WSWUBlastClient(ap, align, unknownSequences);\r
     }\r
     else\r
@@ -194,18 +202,20 @@ public class SequenceFeatureFetcher implements Runnable
     for (i = 0; i < iSize; i++)\r
     {\r
       entry = (UniprotEntry) entries.elementAt(i);\r
-      String idmatch = entry.getAccession();\r
+      String idmatch = entry.getAccession().elementAt(0).toString();\r
       sequence = align.findName(idmatch);\r
 \r
       if (sequence == null)\r
       {\r
         //Sequence maybe Name, not Accession\r
-        idmatch = entry.getName();\r
+\r
+        idmatch = entry.getName().elementAt(0).toString();;\r
         sequence = align.findName(idmatch);\r
       }\r
 \r
       if (sequence == null)\r
       {\r
+        System.out.println("not found");\r
         continue;\r
       }\r
 \r