From 42d82f347c559914cc57499c43daa49aed0573b8 Mon Sep 17 00:00:00 2001 From: Daniel Barton Date: Fri, 16 Aug 2013 16:25:31 +0100 Subject: [PATCH] Webservice working with ScoreManager --- testsrc/compbio/ws/client/TestRNAalifoldWS.java | 18 ++++++++++++------ webservices/compbio/ws/server/RNAalifoldWS.java | 12 ------------ webservices/compbio/ws/server/WSUtil.java | 5 +++-- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/testsrc/compbio/ws/client/TestRNAalifoldWS.java b/testsrc/compbio/ws/client/TestRNAalifoldWS.java index 5e66f43..c5f3f6d 100644 --- a/testsrc/compbio/ws/client/TestRNAalifoldWS.java +++ b/testsrc/compbio/ws/client/TestRNAalifoldWS.java @@ -1,4 +1,4 @@ -package compbio.ws.client; + package compbio.ws.client; import compbio.metadata.AllTestSuit; import static org.testng.Assert.assertEquals; @@ -45,7 +45,7 @@ import compbio.ws.server.RNAalifoldWS; public class TestRNAalifoldWS { - FoldWS foldws; + SequenceAnnotation foldws; @BeforeTest(groups = {AllTestSuit.test_group_webservices}) void initConnection() { @@ -53,7 +53,7 @@ public class TestRNAalifoldWS { try { JABAService client = Jws2Client.connect( "http://localhost:8080/jabaws", Services.RNAalifoldWS); - foldws = (FoldWS) client; + foldws = (SequenceAnnotation) client; } catch (ConnectException e) { e.printStackTrace(); fail(e.getMessage()); @@ -74,14 +74,20 @@ public class TestRNAalifoldWS { Alignment aln = ClustalAlignmentUtil.readClustalFile(new FileInputStream( AllTestSuit.test_input_aln)); + List fsl = aln.getSequences(); + try { List> options = new ArrayList>(); options.add(foldws.getRunnerOptions().getArgumentByOptionName("--mis")); + options.add(foldws.getRunnerOptions().getArgumentByOptionName("-p")); + options.add(foldws.getRunnerOptions().getArgumentByOptionName("--MEA")); + System.out.println("TestRNAalifoldWS: print options: " + options.toString()); - String jobId = foldws.customFold(aln, options); + + String jobId = foldws.customAnalize(fsl, options); System.out.println("J: " + jobId); - String result = foldws.getResult(jobId); - System.out.println("fold results: \n" + result); + ScoreManager result = foldws.getAnnotation(jobId); + System.out.println("fold results: \n" + result.asRNAStruct().toString()); assertNotNull(result); } catch (UnsupportedRuntimeException e) { diff --git a/webservices/compbio/ws/server/RNAalifoldWS.java b/webservices/compbio/ws/server/RNAalifoldWS.java index b05c973..34f0aaf 100644 --- a/webservices/compbio/ws/server/RNAalifoldWS.java +++ b/webservices/compbio/ws/server/RNAalifoldWS.java @@ -48,18 +48,6 @@ public class RNAalifoldWS extends SequenceAnnotationService super (new RNAalifold(), log); } - /* - * No options are supported, thus the result of this call will be as simple - * call to analize without parameters - */ - @Override - public String customAnalize(List sequences, - List> options) throws UnsupportedRuntimeException, - LimitExceededException, JobSubmissionException, - WrongParameterException { - - return analize(sequences); - } /* * No presets are supported, thus the result of this call will be as simple diff --git a/webservices/compbio/ws/server/WSUtil.java b/webservices/compbio/ws/server/WSUtil.java index 9d81a6a..7646747 100644 --- a/webservices/compbio/ws/server/WSUtil.java +++ b/webservices/compbio/ws/server/WSUtil.java @@ -153,8 +153,9 @@ public final class WSUtil { throw LimitExceededException.newLimitExceeded(limit, sequences); } log.debug("Method: " + method + " with task: " + confExec.getTaskId()); - - compbio.runner.Util.writeInput(sequences, confExec); + // Change this line for RNAalifold testing + // compbio.runner.Util.writeInput(sequences, confExec); + compbio.runner.Util.writeClustalInput(sequences, confExec, '-'); AsyncExecutor engine = Configurator.getAsyncEngine(confExec); String jobId = engine.submitJob(confExec); reportUsage(confExec, log); -- 1.7.10.2