JAL-1358 jalview displays some RNA struture annotation but the format is very messed up
authorDaniel Barton <daluke.barton@gmail.com>
Tue, 27 Aug 2013 16:37:06 +0000 (17:37 +0100)
committerDaniel Barton <daluke.barton@gmail.com>
Tue, 27 Aug 2013 16:37:06 +0000 (17:37 +0100)
lib/min-jabaws-client-3.0.0.jar [new file with mode: 0644]
src/jalview/ws/jws2/RNAalifoldClient.java
src/jalview/ws/jws2/SequenceAnnotationWSClient.java

diff --git a/lib/min-jabaws-client-3.0.0.jar b/lib/min-jabaws-client-3.0.0.jar
new file mode 100644 (file)
index 0000000..c70a615
Binary files /dev/null and b/lib/min-jabaws-client-3.0.0.jar differ
index 9592142..7d06701 100644 (file)
@@ -157,7 +157,11 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements
                        
                        
                        if (ourAnnot.size() > 0) {
+                               
+                               // Modify the visible annotation on the alignment viewport with the
+        // new alignment annotation rows created.
                                updateOurAnnots(ourAnnot);
+                               ap.adjustAnnotationHeight();
                        }
                        
                }
index d57eae4..e985f41 100644 (file)
@@ -61,17 +61,20 @@ public class SequenceAnnotationWSClient extends Jws2Client
     initSequenceAnnotationWSClient(sh, alignFrame, preset, editParams);
   }
 
+  // dan think. Do I need to change this method to run RNAalifold through the GUI
+  
   public void initSequenceAnnotationWSClient(final Jws2Instance sh,
           AlignFrame alignFrame, WsParamSetI preset, boolean editParams)
   {
-    if (alignFrame.getViewport().getAlignment().isNucleotide())
-    {
-      JOptionPane.showMessageDialog(Desktop.desktop, sh.serviceType
-              + " can only be used\nfor amino acid alignments.",
-              "Wrong type of sequences!", JOptionPane.WARNING_MESSAGE);
-      return;
-
-    }
+       // dan changed! dan test. comment out if conditional
+//    if (alignFrame.getViewport().getAlignment().isNucleotide())
+//    {
+//      JOptionPane.showMessageDialog(Desktop.desktop, sh.serviceType
+//              + " can only be used\nfor amino acid alignments.",
+//              "Wrong type of sequences!", JOptionPane.WARNING_MESSAGE);
+//      return;
+//
+//    }
     if (sh.action.toLowerCase().contains("conservation"))
     {
       // Build an AACon style client - take alignment, return annotation for
@@ -131,7 +134,65 @@ public class SequenceAnnotationWSClient extends Jws2Client
               .startWorker(
                       new AADisorderClient(sh, alignFrame, preset, paramset));
     }
+    
+    
+    // dan test dan changed!
+    if (sh.action.toLowerCase().contains("rna structure prediction"))
+    {
 
+       List<AlignCalcWorkerI> clnts = alignFrame.getViewport()
+                       .getCalcManager()
+                       .getRegisteredWorkersOfClass(RNAalifoldClient.class);
+       if (clnts == null || clnts.size() == 0)
+       {
+               if (!processParams(sh, editParams))
+               {
+                       return;
+               }
+               RNAalifoldClient worker;
+               alignFrame
+                                               .getViewport()
+                                               .getCalcManager()
+                                               .registerWorker(
+                                                                       worker = new RNAalifoldClient(sh, alignFrame,
+                                                                                                       this.preset, paramset));
+               alignFrame.getViewport().getCalcManager().startWorker(worker);
+       }
+       else 
+       {
+               RNAalifoldClient worker = (RNAalifoldClient) clnts.get(0);
+               if (editParams)
+               {
+                       paramset = worker.getArguments();
+                       preset = worker.getPreset();
+               }
+               
+               if (!processParams(sh, editParams, true))
+        {
+          return;
+        }
+               
+               // reinstate worker if it was blacklisted (might have happened due to
+        // invalid parameters)
+        alignFrame.getViewport().getCalcManager().workerMayRun(worker);
+        worker.updateParameters(this.preset, paramset);
+       }
+       
+    }
+    
+//     
+//     if (!processParams(sh, editParams, true))
+//     {
+//             return;
+//     }
+//
+//     alignFrame
+//                     .getViewport()
+//                     .getCalcManager()
+//                     .startWorker(
+//                                     new RNAalifoldClient(sh, alignFrame, preset, paramset));
+//     
+    
   }
 
   public SequenceAnnotationWSClient(AAConSettings fave,