JAL-3954 Add EBI phmmer to web services menu.
authorMateusz Warowny <mmzwarowny@dundee.ac.uk>
Mon, 14 Feb 2022 16:56:18 +0000 (17:56 +0100)
committerMateusz Warowny <mmzwarowny@dundee.ac.uk>
Mon, 14 Feb 2022 16:56:18 +0000 (17:56 +0100)
src/jalview/gui/AlignFrame.java
src/jalview/gui/Desktop.java
src/jalview/hmmer/rest/PhmmerClient.java
src/jalview/ws2/gui/PhmmerMenuBuilder.java
src/jalview/ws2/hmmer/PhmmerWebService.java

index b84e8ca..568e000 100644 (file)
@@ -118,6 +118,7 @@ import jalview.ws.seqfetcher.DbSourceProxy;
 import jalview.ws2.slivka.SlivkaWSDiscoverer;
 import jalview.ws2.WebServiceDiscovererI;
 import jalview.ws2.gui.WebServicesMenuBuilder;
+import jalview.ws2.hmmer.PhmmerWSDiscoverer;
 import jalview.ws2.operations.Operation;
 
 import java.io.IOException;
@@ -4660,6 +4661,13 @@ public class AlignFrame extends GAlignFrame
         buildWebServicesMenu(discoverer, submenu);
         webService.add(submenu);
       }
+      if (Cache.getDefault("SHOW_EBI_SERVICES", true))
+      {
+        PhmmerWSDiscoverer discoverer = PhmmerWSDiscoverer.getInstance();
+        JMenu submenu = new JMenu("EBI");
+        buildWebServicesMenu(discoverer, submenu);
+        webService.add(submenu);
+      }
       if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
       {
         WSDiscovererI jws2servs = Jws2Discoverer.getInstance();
index db9931b..5a9d546 100644 (file)
@@ -2738,6 +2738,10 @@ public class Desktop extends GDesktop
     {
       tasks.add(jalview.ws2.slivka.SlivkaWSDiscoverer.getInstance().startDiscoverer());
     }
+    if (Cache.getDefault("SHOW_EBI_SERVICES", true))
+    {
+      tasks.add(jalview.ws2.hmmer.PhmmerWSDiscoverer.getInstance().startDiscoverer());
+    }
     if (blocking)
     {
       for (Future<?> task : tasks) {
index 119c805..0dc9404 100644 (file)
@@ -96,6 +96,10 @@ public class PhmmerClient {
     return new PhmmerClient(new URL(defaultURL));
   }
 
+  public URL getUrl() {
+    return baseUrl;
+  }
+
   public PhmmerRequestBuilder newRequestBuilder() {
     return new PhmmerRequestBuilder(mxValues, databaseValues);
   }
index 09e549e..6edb712 100644 (file)
@@ -59,6 +59,7 @@ public class PhmmerMenuBuilder implements MenuEntryProviderI
               });
         }
       });
+      parent.add(item);
     }
     SequenceI[] sequences = frame.getViewport().getAlignment().getSequencesArray();
   }
index 297906c..175e9b4 100644 (file)
@@ -30,8 +30,7 @@ public class PhmmerWebService implements WebServiceI
   @Override
   public String getHostName()
   {
-    // TODO Auto-generated method stub
-    return null;
+    return client.getUrl().toString();
   }
 
   @Override
@@ -102,7 +101,7 @@ public class PhmmerWebService implements WebServiceI
         reqBuilder.popen(Float.parseFloat(value));
         break;
       case "Gap Penalties[extend]":
-        reqBuilder.popen(Float.parseFloat(value));
+        reqBuilder.pextend(Float.parseFloat(value));
         break;
       case "Gap Penalties[Substitution scoring matrix]":
         reqBuilder.mx(value);