From: Daniel Barton Date: Wed, 21 Aug 2013 10:55:21 +0000 (+0100) Subject: Update the last commit which missed some files. RNAStructScoreManager X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=78cd52a6b64a7a0133b5467f80213f2d173f43f4;p=jabaws.git Update the last commit which missed some files. RNAStructScoreManager replacing RNAStruct. Webservices returns ScoreManager!?!- --- diff --git a/webservices/compbio/ws/server/WSUtil.java b/webservices/compbio/ws/server/WSUtil.java index 7646747..a3f96d8 100644 --- a/webservices/compbio/ws/server/WSUtil.java +++ b/webservices/compbio/ws/server/WSUtil.java @@ -27,6 +27,7 @@ import org.apache.log4j.Logger; import compbio.data.sequence.Alignment; import compbio.data.sequence.FastaSequence; +import compbio.data.sequence.RNAStructScoreManager; import compbio.data.sequence.ScoreManager; import compbio.engine.AsyncExecutor; import compbio.engine.Configurator; @@ -115,27 +116,27 @@ public final class WSUtil { // Hardcoded gapchar '-' in this method - public static String fold(Alignment alignment, - ConfiguredExecutable confExec, Logger logger, - String callingMethod, Limit limit) - throws LimitExceededException, JobSubmissionException { - - List sequences = alignment.getSequences(); - if (limit != null && limit.isExceeded(sequences)) { - throw LimitExceededException.newLimitExceeded(limit, sequences); - } - compbio.runner.Util.writeClustalInput(sequences, confExec, '-'); - System.out.println("WSUtil-fold: Writing the clustal input file on the server: to file: " - + confExec.getInput()); - System.out.println("WSUtil-fold: The executable is configured with parameters: " - + confExec.getParameters()); -// System.out.println("WSUTil-fold: Dump the configured executable:\n" -// + confExec.toString()); - AsyncExecutor engine = Configurator.getAsyncEngine(confExec); - String jobId = engine.submitJob(confExec); - reportUsage(confExec, logger); - return jobId; - } +// public static String fold(Alignment alignment, +// ConfiguredExecutable confExec, Logger logger, +// String callingMethod, Limit limit) +// throws LimitExceededException, JobSubmissionException { +// +// List sequences = alignment.getSequences(); +// if (limit != null && limit.isExceeded(sequences)) { +// throw LimitExceededException.newLimitExceeded(limit, sequences); +// } +// compbio.runner.Util.writeClustalInput(sequences, confExec, '-'); +// System.out.println("WSUtil-fold: Writing the clustal input file on the server: to file: " +// + confExec.getInput()); +// System.out.println("WSUtil-fold: The executable is configured with parameters: " +// + confExec.getParameters()); +//// System.out.println("WSUTil-fold: Dump the configured executable:\n" +//// + confExec.toString()); +// AsyncExecutor engine = Configurator.getAsyncEngine(confExec); +// String jobId = engine.submitJob(confExec); +// reportUsage(confExec, logger); +// return jobId; +// } static void reportUsage(ConfiguredExecutable confExec, Logger logger) { if (GAUtils.IS_GA_ENABLED) { @@ -153,8 +154,23 @@ public final class WSUtil { throw LimitExceededException.newLimitExceeded(limit, sequences); } log.debug("Method: " + method + " with task: " + confExec.getTaskId()); - // Change this line for RNAalifold testing - // compbio.runner.Util.writeInput(sequences, confExec); + compbio.runner.Util.writeInput(sequences, confExec); + AsyncExecutor engine = Configurator.getAsyncEngine(confExec); + String jobId = engine.submitJob(confExec); + reportUsage(confExec, log); + return jobId; + } + + // Same as analize but Alifold takes clustal input not fasta + + public static String fold(List sequences, + ConfiguredExecutable confExec, Logger log, String method, + Limit limit) throws JobSubmissionException { + if (limit != null && limit.isExceeded(sequences)) { + throw LimitExceededException.newLimitExceeded(limit, sequences); + } + log.debug("Method: " + method + " with task: " + confExec.getTaskId()); + // This line is different from the above method compbio.runner.Util.writeClustalInput(sequences, confExec, '-'); AsyncExecutor engine = Configurator.getAsyncEngine(confExec); String jobId = engine.submitJob(confExec); @@ -193,13 +209,21 @@ public final class WSUtil { } } - public static ScoreManager getAnnotation(String jobId, Logger log) + // test + // set return type back to ScoreManager + public static RNAStructScoreManager getAnnotation(String jobId, Logger log) throws ResultNotAvailableException { WSUtil.validateJobId(jobId); AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId); ConfiguredExecutable aacon = (ConfiguredExecutable) asyncEngine .getResults(jobId); - ScoreManager mas = aacon.getResults(); + + + // test RNAalifold +// ScoreManager mas = aacon.getResults(); + + RNAStructScoreManager mas = aacon.getResults(); + log.trace(jobId + " getConservation : " + mas); return mas; }