From: Mateusz Warowny Date: Mon, 14 Feb 2022 16:56:18 +0000 (+0100) Subject: JAL-3954 Add EBI phmmer to web services menu. X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1fa51fb503271433bdd2d8c70cdfee0c1c7512b1;p=jalview.git JAL-3954 Add EBI phmmer to web services menu. --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index b84e8ca..568e000 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -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(); diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index db9931b..5a9d546 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -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) { diff --git a/src/jalview/hmmer/rest/PhmmerClient.java b/src/jalview/hmmer/rest/PhmmerClient.java index 119c805..0dc9404 100644 --- a/src/jalview/hmmer/rest/PhmmerClient.java +++ b/src/jalview/hmmer/rest/PhmmerClient.java @@ -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); } diff --git a/src/jalview/ws2/gui/PhmmerMenuBuilder.java b/src/jalview/ws2/gui/PhmmerMenuBuilder.java index 09e549e..6edb712 100644 --- a/src/jalview/ws2/gui/PhmmerMenuBuilder.java +++ b/src/jalview/ws2/gui/PhmmerMenuBuilder.java @@ -59,6 +59,7 @@ public class PhmmerMenuBuilder implements MenuEntryProviderI }); } }); + parent.add(item); } SequenceI[] sequences = frame.getViewport().getAlignment().getSequencesArray(); } diff --git a/src/jalview/ws2/hmmer/PhmmerWebService.java b/src/jalview/ws2/hmmer/PhmmerWebService.java index 297906c..175e9b4 100644 --- a/src/jalview/ws2/hmmer/PhmmerWebService.java +++ b/src/jalview/ws2/hmmer/PhmmerWebService.java @@ -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);