From f2ae581a7c93c7c92a574d6c92ee7e0d9fb7b775 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Fri, 13 Oct 2023 14:37:12 +0200 Subject: [PATCH] JAL-1601 Implement JPred4 WS client and discoverer --- j11lib/jpred-client-1.0-SNAPSHOT.jar | Bin 13237 -> 13317 bytes src/jalview/ws2/client/jpred4/JPred4WSClient.java | 29 ++++++++++++++------ .../ws2/client/jpred4/JPred4WSDiscoverer.java | 12 ++++++-- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/j11lib/jpred-client-1.0-SNAPSHOT.jar b/j11lib/jpred-client-1.0-SNAPSHOT.jar index 826f02835ba8ff8dd8220b1c18ba8aae7a22dfd3..0e7aacf6f1832b4aa63e9ed69cf4fd5d7ce90334 100644 GIT binary patch delta 5401 zcmY+IWmMEb+s5f!Kw@bSL}GVo1f*L8VG&q51ePu(MG*dogmf%OcgKR1NDD}JE@jYN zBGULO&wJkYJaf*>bu3PSf#Ih0_)Ol#7DCSYJ-KIx~ZthJyrr5kQ; zAlvdC@t(N&aY~Xe-J}!I5#1B<=#`$k%ON*J4B_JQHwzIo5xX3sN-K-=RPA6 zdzZ%;%w4SYcw&Vw6+sfx?*;E$nk$HB3D&aZtFmw4MEXEEItAJDvzPLsutP_!l^OW^ z>8;NIQ$?M?y3}!lnhR2Fg)Wg+W4*vMFSGIl?;*$Odu3~m&qZqs_Arb7gA?j&`73#5 zGvu+bnYNE@YGQk{?{}h2*SSm9XJRUk(|$VYk1{%?g0XX>5w4=`^&QzKSHI2IZDwY< zjAYsyvYr)H#D7J&awCaSe5XHHAAa$4tXN0|3|o$zh0MM+;MHw7VTY{8uVUc&T z*e;l2D!~gt5hv{le6CQU33&u7@28_cC#cqrn3;*m5rwC>-FTfVyQjhR#98zp43?R= z!IXC|{h1GiwpZA?Vgf!24$x3`vMd52ftFTX!Mi%!cVzRoaNcNr!CT~DT5Y4Ckqf#E zxZ+JaGvVZo@mDy;SEl{$$rq4V;mZ(0_|8o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(`wta(2+S8>)7cwff}S31Hi(lS7t_qGmFcRwc#6)^)bu}0L*Och zi?YxxQ>(^0;w&qOuIQY4rwH5rMv%-8i~DGZ^$6<5;1Mf`jo#jx21T zp?MjyR?=7b?1f^1U)Fj_Xe74nl-plu*eh^$dl*KnH4q@3W+~Qy=4mTa!%hXgyF{*- z(xBom(V5gJ!eP{2Z%o!cghpEbbqEc_ON0IwJmS5X#TKQclRsS$Pw|_!=G7N`$rR5a zC8+)-j&;xX1bVtlqPFg_Pu%qXDm(~>?n1^-iv&k#2DJ#UaPwt9X@`za9;pfRw;RVn z(3HP`ZGR>C$vFq-k0clAdu3G$SW4^$WAXv~QEd%$+s7n+12#lDsFY}GV&?2)2e;wK z;P50VCKb#2sLpd?iylUaxy`O8xix3X7q%sBgFTiU$sW>$Z)|Uj3aNm^ziBw1HEa!_ zrLSnek=5Rket2I~E%(X}N)^;aaVbu;>H9nHd$2KVgh2J^mnLsY^zHY|+cMM4bNv4! z3wJ=FevW(RKM?IJUpeMIM0+Kmgmn+xngPE547jim;9jkTMD8_J=pMwuCxzthb5z1g z_rAHX@x3++8{I2~h}FG%i$Lz##s5M%_;(TgM|Ue5*-Rc*THRr~F&qpG;6EPt-_`Ke zlp3B)4Ti@6Ngn+_?7@kFA@Dz`J8gJNL<^Uv1;9&%N$$^r1~Os=aNk)xa8e!uxD1Ho r{s sequences, List args, Credentials credentials) throws IOException { - var input = FileFormat.Fasta - .getWriter(null) - .print(sequences.toArray(SequenceI[]::new), false); + var input = mode == JPredRequest.Mode.MSA + ? FileFormat.Fasta + .getWriter(null) + .print(sequences.toArray(SequenceI[]::new), false) + : sequences.get(0).getSequenceAsString(); + JPredRequest request = JPredRequest .newBuilder() - .mode(JPredRequest.Mode.MSA) - .format(JPredRequest.Format.FASTA) + .mode(mode) + .format(format) .input(input) .build(); var jobId = client.submit(request); @@ -63,6 +72,8 @@ public class JPred4WSClient implements SecStructPredWebServiceClientI var status = client.getStatus(job.getJobId()); switch (status) { + case PENDING: + return JobStatus.QUEUED; case RUNNING: return JobStatus.RUNNING; case FINISHED: @@ -96,16 +107,16 @@ public class JPred4WSClient implements SecStructPredWebServiceClientI public void cancel(WebServiceJobHandle job) throws IOException, UnsupportedOperationException { - + } - + @Override public AlignFile getAlignmentFile(WebServiceJobHandle job) throws IOException { var url = client.getResultURL(job.getJobId(), ResultTypes.PSIBLAST_ALIGN); return new FastaFile(url.toString(), DataSourceType.URL); } - + @Override public JPredFile getPredictionFile(WebServiceJobHandle job) throws IOException { diff --git a/src/jalview/ws2/client/jpred4/JPred4WSDiscoverer.java b/src/jalview/ws2/client/jpred4/JPred4WSDiscoverer.java index 99c3f28..6cb1576 100644 --- a/src/jalview/ws2/client/jpred4/JPred4WSDiscoverer.java +++ b/src/jalview/ws2/client/jpred4/JPred4WSDiscoverer.java @@ -86,11 +86,17 @@ public class JPred4WSDiscoverer extends AbstractWebServiceDiscoverer wsBuilder.actionClass(SecStructPredAction.class); var webService = wsBuilder.build(); - var wsClient = new JPred4WSClient(client); - var actionBuilder = SecStructPredAction.newBuilder(wsClient); + var actionBuilder = SecStructPredAction.newBuilder( + new JPred4WSClient(client, false)); actionBuilder.webService(webService); - actionBuilder.name(""); + actionBuilder.name("JPred4"); webService.addAction(actionBuilder.build()); + + var actionBuilderMsa = SecStructPredAction.newBuilder( + new JPred4WSClient(client, true)); + actionBuilderMsa.webService(webService); + actionBuilderMsa.name("JPred4 (MSA)"); + webService.addAction(actionBuilderMsa.build()); return List.of(webService); } -- 1.7.10.2