From c84ec6492607920b938cfa3645e1a92e15727dd1 Mon Sep 17 00:00:00 2001 From: Daniel Barton Date: Fri, 30 Aug 2013 10:57:53 +0100 Subject: [PATCH] Clean-up, refactoring, commenting. Parameters file containts only options since Jalview still can't deal with them --- conf/Executable.properties | 2 +- conf/settings/RNAalifoldOptionsOnly.xml | 75 ++++++ conf/settings/RNAalifoldParameters.xml | 5 +- .../data/sequence/RNAStructScoreManager.java | 8 +- datamodel/compbio/data/sequence/Range.java | 11 +- datamodel/compbio/data/sequence/Score.java | 17 +- runner/compbio/runner/structure/RNAalifold.java | 13 +- testsrc/compbio/ws/client/TestRNAalifoldWS.java | 22 +- testsrc/testdata/RNAalifoldParameters.xml | 254 -------------------- webservices/compbio/data/msa/FoldWS.java | 59 ----- webservices/compbio/ws/client/Jws2Client.java | 72 ------ webservices/compbio/ws/client/Services.java | 11 +- webservices/compbio/ws/client/WSTester.java | 42 ---- webservices/compbio/ws/server/RNAalifoldWS.java | 4 +- webservices/compbio/ws/server/WSUtil.java | 29 +-- 15 files changed, 113 insertions(+), 511 deletions(-) create mode 100644 conf/settings/RNAalifoldOptionsOnly.xml delete mode 100644 testsrc/testdata/RNAalifoldParameters.xml delete mode 100644 webservices/compbio/data/msa/FoldWS.java diff --git a/conf/Executable.properties b/conf/Executable.properties index 333477e..ba9b4a7 100644 --- a/conf/Executable.properties +++ b/conf/Executable.properties @@ -199,5 +199,5 @@ aacon.presets.file=conf/settings/AAConPresets.xml ##### RNAALIFOLD CONFIGURATION ###### local.rnaalifold.bin.windows=binaries/windows/ViennaRNA/RNAalifold.exe local.rnaalifold.bin=binaries/src/ViennaRNA/Progs/RNAalifold -rnaalifold.parameters.file=conf/settings/RNAalifoldParameters.xml +rnaalifold.parameters.file=conf/settings/RNAalifoldOptionsOnly.xml diff --git a/conf/settings/RNAalifoldOptionsOnly.xml b/conf/settings/RNAalifoldOptionsOnly.xml new file mode 100644 index 0000000..7f8ef44 --- /dev/null +++ b/conf/settings/RNAalifoldOptionsOnly.xml @@ -0,0 +1,75 @@ + + + compbio.runner.structure.RNAalifold + + Endgaps + Score pairs with endgaps same as gap-gap pairs + -E + + + Most Informative Sequence + Ouput Set of nucleotides with frequency > average + --mis + + + Partition Function + Output partition function and probability matrix + -p + + + Circular + Assume circular RNA molecule + -c + + + + G-Quadruplex + Incorporate G-Quadruplex formation into prediction algorithm + -g + + + d2 + dangling energies will be added for the bases adjacent to a helix on both sides + -d2 + + + No LP + Produce Structures without lonely pairs + --noLP + + + No GU + Do not allow GU pairs + --noGU + + + No Closing GU + Do not allow GU pairs at the end of sequences + --noClosingGU + + + old + Use old energy evaluation, treating gaps as characters + --old + + + Ribosum Scoring + Use Ribosum Scoring Matrix + -r + + + d2 + + Dangling energies are added for the bases adjacent to a helix on both sides + + -d2 + + + MEA Structure + Maximum Expected Accuracy Structure + --MEA + + + + + \ No newline at end of file diff --git a/conf/settings/RNAalifoldParameters.xml b/conf/settings/RNAalifoldParameters.xml index a730f64..e79c44c 100644 --- a/conf/settings/RNAalifoldParameters.xml +++ b/conf/settings/RNAalifoldParameters.xml @@ -70,7 +70,7 @@ --MEA - + scaling factor @@ -96,7 +96,7 @@ Temperature - Rescale Energy parameters to Temperature + Rescale Energy parameterss to Temperature -T 37 @@ -105,6 +105,7 @@ 1000000 + cfactor weight of covariance term diff --git a/datamodel/compbio/data/sequence/RNAStructScoreManager.java b/datamodel/compbio/data/sequence/RNAStructScoreManager.java index d2da2e1..428828d 100644 --- a/datamodel/compbio/data/sequence/RNAStructScoreManager.java +++ b/datamodel/compbio/data/sequence/RNAStructScoreManager.java @@ -39,7 +39,6 @@ public class RNAStructScoreManager extends ScoreManager { this.seqScores = seqScores; } - // I put this in purely because it mirrors a method in ScoreManager, not because I need it public static RNAStructScoreManager newInstance(List structs, List> data) { return new RNAStructScoreManager(structs, data); } @@ -60,6 +59,11 @@ public class RNAStructScoreManager extends ScoreManager { return data; } + + /* + * I want to be able to get the information in a ScoreHolder Object by + * + */ // Send this data Structure back to something approximating the stdoutFile // with extra information from alifold.out @@ -98,7 +102,7 @@ public class RNAStructScoreManager extends ScoreManager { Score s = iScores.next(); Range r = s.getRanges().first(); Float score = s.getScores().get(0); - out += String.format("%4d %4d %.1f%n", r.getFrom(), r.getTo(), + out += String.format("%4d %4d %.1f%n", r.from, r.to, score); } } diff --git a/datamodel/compbio/data/sequence/Range.java b/datamodel/compbio/data/sequence/Range.java index 9ade348..8dd7da9 100644 --- a/datamodel/compbio/data/sequence/Range.java +++ b/datamodel/compbio/data/sequence/Range.java @@ -41,11 +41,6 @@ public class Range implements Comparable { this.to = Integer.parseInt(twoElementAr[1].trim()); } - // Daniel Check these get methods are ok with Jim - public int getFrom() { return from; } - public int getTo() { return to; } - - @Override public String toString() { return from + "-" + to; @@ -76,7 +71,11 @@ public class Range implements Comparable { return true; } - // daniel wants to mess with method. this is how it was + /* + * Daniel messed with this method. + * It now compares Ranges based on + */ + // @Override // public int compareTo(Range o) { // if (o == null) diff --git a/datamodel/compbio/data/sequence/Score.java b/datamodel/compbio/data/sequence/Score.java index 1cac69c..0ca5152 100644 --- a/datamodel/compbio/data/sequence/Score.java +++ b/datamodel/compbio/data/sequence/Score.java @@ -232,25 +232,26 @@ public class Score implements Comparable { writer.flush(); } + // Old compareTo method // @Override // public int compareTo(Score o) { // return this.method.compareTo(o.method); // } - /* daniel wants to mess with this method and, while preserving the - * ordering when the method Enumerations are different, add additional - * constraints on how equal Score objects must be to be considered equal + /* daniel messed with this method. While preserving the original + * ordering when the method Enumerations are different, additional + * constraints have been added on how equal Score objects must be + * to be considered equal. * * It is necessary to distinguish Score objects by their ranges in order * to use a Set of Score objects to represent the alifold.out information * - * It is necessary to distinguish Score objects by their scores in order - * to return Stochastic Backtrack information reliably + * Distinguishing score objects by their Scores has the result of ordering + * the base pair contacts so into descending probability. + * + * Should this be in a new extended Score class? */ - - - @Override public int compareTo(Score o) { if (this.method.compareTo(o.method) != 0) { diff --git a/runner/compbio/runner/structure/RNAalifold.java b/runner/compbio/runner/structure/RNAalifold.java index c6c79ec..918918e 100644 --- a/runner/compbio/runner/structure/RNAalifold.java +++ b/runner/compbio/runner/structure/RNAalifold.java @@ -3,26 +3,15 @@ package compbio.runner.structure; import java.io.FileNotFoundException; import java.io.IOException; -import java.util.Arrays; -import java.util.List; - - - - import org.apache.log4j.Logger; -import compbio.data.sequence.ScoreManager; import compbio.data.sequence.RNAStructScoreManager; -import compbio.data.sequence.UnknownFileFormatException; import compbio.engine.client.PipedExecutable; import compbio.engine.client.SkeletalExecutable; import compbio.metadata.ResultNotAvailableException; import compbio.runner.Util; - -import compbio.engine.client.CommandBuilder; - public class RNAalifold extends SkeletalExecutable implements PipedExecutable { @@ -31,7 +20,7 @@ public class RNAalifold extends SkeletalExecutable // May not be necessary as defult is "" but still dont know // How to deal with different key value separators for different params - public static final String KEY_VALUE_SEPARATOR = " "; + public static final String KEY_VALUE_SEPARATOR = Util.SPACE; public RNAalifold() { super(KEY_VALUE_SEPARATOR); diff --git a/testsrc/compbio/ws/client/TestRNAalifoldWS.java b/testsrc/compbio/ws/client/TestRNAalifoldWS.java index 5452c4e..cafe9cb 100644 --- a/testsrc/compbio/ws/client/TestRNAalifoldWS.java +++ b/testsrc/compbio/ws/client/TestRNAalifoldWS.java @@ -1,16 +1,13 @@ package compbio.ws.client; -import compbio.metadata.AllTestSuit; -import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.fail; -import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; -import java.io.Writer; import java.io.OutputStreamWriter; +import java.io.Writer; import java.net.ConnectException; import java.util.ArrayList; import java.util.List; @@ -20,29 +17,20 @@ import javax.xml.ws.WebServiceException; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; -import compbio.data.msa.FoldWS; import compbio.data.msa.JABAService; import compbio.data.msa.SequenceAnnotation; import compbio.data.sequence.Alignment; import compbio.data.sequence.ClustalAlignmentUtil; -import compbio.data.sequence.ConservationMethod; import compbio.data.sequence.FastaSequence; import compbio.data.sequence.RNAStructScoreManager; -import compbio.data.sequence.ScoreManager; -import compbio.data.sequence.SequenceUtil; import compbio.data.sequence.UnknownFileFormatException; import compbio.metadata.AllTestSuit; import compbio.metadata.JobSubmissionException; import compbio.metadata.LimitExceededException; import compbio.metadata.Option; -import compbio.metadata.PresetManager; import compbio.metadata.ResultNotAvailableException; -import compbio.metadata.RunnerConfig; import compbio.metadata.UnsupportedRuntimeException; import compbio.metadata.WrongParameterException; -import compbio.runner.conservation.AACon; -import compbio.runner.structure.RNAalifold; -import compbio.util.SysPrefs; import compbio.ws.server.RNAalifoldWS; @@ -73,10 +61,6 @@ public class TestRNAalifoldWS { public void testFold() throws FileNotFoundException, IOException, UnknownFileFormatException { - -// String CURRENT_DIRECTORY = SysPrefs.getCurrentDirectory() -// + File.separator; - Alignment aln = ClustalAlignmentUtil.readClustalFile(new FileInputStream( AllTestSuit.test_input_aln)); @@ -94,10 +78,6 @@ public class TestRNAalifoldWS { System.out.println("J: " + jobId); RNAStructScoreManager result = (RNAStructScoreManager)foldws.getAnnotation(jobId); - - // standard and RNAStruct specific ways of formatting scoremanager - System.out.println("fold results: \n" + result.toString()); - Writer writer = new OutputStreamWriter(System.out); result.writeOut(writer); diff --git a/testsrc/testdata/RNAalifoldParameters.xml b/testsrc/testdata/RNAalifoldParameters.xml deleted file mode 100644 index 845f480..0000000 --- a/testsrc/testdata/RNAalifoldParameters.xml +++ /dev/null @@ -1,254 +0,0 @@ - - - compbio.runner.structure.RNAalifold - - Endgaps - Score pairs with endgaps same as gap-gap pairs - -E - --endgaps - -E - - - Most Informative Sequence - Ouput Set of nucleotides with frequency > average - --mis - - - Partition Function - Output partition function and probability matrix - -p - --partfunc - -p - - - p0 - deactivates the calculation of the pair probabilities - -p0 - - - color - Consensus structure plot is colored - --color - - - Alignment - Output structure annotated alignment - --aln - - - No Postscript - Do not produce postscript output - --noPS - - - Circular - Assume circular RNA molecule - -c - --circ - -c - - - - G-Quadruplex - Incorporate G-Quadruplex formation into prediction algorithm - -g - --gquad - -g - - - d2 - dangling energies will be added for the bases adjacent to a helix on both sides - -d2 - - - No LP - Produce Structures without lonely pairs - --noLP - - - No GU - Do not allow GU pairs - --noGU - - - No Closing GU - Do not allow GU pairs at the end of sequences - --noClosingGU - - - old - Use old energy evaluation, treating gaps as characters - --old - - - Ribosum Scoring - Use Ribosum Scoring Matrix - -r - --ribosum_scoring - -r - - - d2 - - Dangling energies are added for the bases adjacent to a helix on both sides - - -d2 - - - MEA Structure - Maximum Expected Accuracy Structure - --MEA - - - - - - - Stochastic Backtrack - Compute a number of random structures - -s - - - - 5 - - Integer - 1 - 100000 - - - - stochBT_en - Print Backtrack structures - --stochBT_en - 5 - - Integer - 1 - 100000 - - - - scaling factor - In calculating pf use scale*mfe as estimate for ensemble free energy] - -S - - 1.07 - - Float - 0 - 100 - - - - bppmThreshold - Threshold for base pair probabilities - --bppmThreshold - 0.000001 - - Float - 0.0000000000001 - 1.0 - - - - Temperature - Rescale Energy parameterss to Temperature - -T - - 37 - - Float - -274 - 1000000 - - - - Dangling End - How to treat Dangling End energies for bases adjacent to helices - -d - - 2 - - Integer - 0 - 100000 - - - - cfactor - weight of covariance term - --cfactor - 1.0 - - Float - 0 - 100000 - - - - nfactor - penalty for non-compatible sequences in covariance term - --nfactor - 1.0 - - Float - 0 - 100000 - - - - - - - - - - - - - - - - - - - - - - - - - Allow Pairs - allow pairs in addition to AU, GC and GU - --nsp - -GA - -GA - -AG - - - - betaScale - Set scaling of Boltzmann factors - --betaScale - 1.0 - - Float - 0 - 100000 - - - \ No newline at end of file diff --git a/webservices/compbio/data/msa/FoldWS.java b/webservices/compbio/data/msa/FoldWS.java deleted file mode 100644 index 19282d6..0000000 --- a/webservices/compbio/data/msa/FoldWS.java +++ /dev/null @@ -1,59 +0,0 @@ -package compbio.data.msa; - -import java.security.InvalidParameterException; -import java.util.List; - -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.naming.ldap.UnsolicitedNotificationEvent; - -import compbio.data.sequence.Alignment; -import compbio.data.sequence.RNAStruct; -import compbio.metadata.JobSubmissionException; -import compbio.metadata.LimitExceededException; -import compbio.metadata.Option; -import compbio.metadata.Preset; -import compbio.metadata.ResultNotAvailableException; -import compbio.metadata.UnsupportedRuntimeException; -import compbio.metadata.WrongParameterException; - -/* - * Interface for tools that results RNA secondary structure information - * - * Still Unsure whether It would be better to use just the aligned fastaList - * or the Alignment object - */ - -// effect of a different targetNamespace? -@WebService(targetNamespace = "http://msa.data.compbio/01/01/2010/") -public interface FoldWS - extends - JABAService, - JManagement, - Metadata { - - - // Is Alignment object JaxB compatible? - - String fold( - @WebParam(name = "alignment") Alignment alignment) - throws UnsupportedRuntimeException, LimitExceededException, - JobSubmissionException; - - String customFold( - @WebParam(name = "alignment") Alignment alignment, - @WebParam(name = "options") List> options) - throws UnsupportedRuntimeException, LimitExceededException, - JobSubmissionException, WrongParameterException; - - String presetFold( - @WebParam(name = "alignment") Alignment alignment, - @WebParam(name = "preset") Preset preset) - throws UnsupportedRuntimeException, LimitExceededException, - JobSubmissionException, WrongParameterException; - - String getResult(@WebParam(name = "jobId") String jobId) - throws ResultNotAvailableException; - -} diff --git a/webservices/compbio/ws/client/Jws2Client.java b/webservices/compbio/ws/client/Jws2Client.java index ae38d9f..7b781a2 100644 --- a/webservices/compbio/ws/client/Jws2Client.java +++ b/webservices/compbio/ws/client/Jws2Client.java @@ -43,7 +43,6 @@ import javax.xml.ws.Service; import javax.xml.ws.WebServiceException; import compbio.data.msa.JABAService; -import compbio.data.msa.FoldWS; import compbio.data.msa.Metadata; import compbio.data.msa.MsaWS; import compbio.data.msa.RegistryWS; @@ -51,7 +50,6 @@ import compbio.data.msa.SequenceAnnotation; import compbio.data.sequence.Alignment; import compbio.data.sequence.FastaSequence; import compbio.data.sequence.ScoreManager; -import compbio.data.sequence.ClustalAlignmentUtil; import compbio.data.sequence.SequenceUtil; import compbio.data.sequence.UnknownFileFormatException; import compbio.metadata.JobSubmissionException; @@ -516,76 +514,6 @@ public class Jws2Client { } /** - * Return RNA secondary structure from a file using FoldWS - * - * @param - * web service type e.g. Clustal - * @param file - * to read the results from - * @param foldws - * FoldWS required - * @param preset - * Preset to use optional - * @param customOptions - * file which contains new line separated list of options - * @return String - */ - -// static String fold(File file, FoldWS foldws, Preset preset, -// List> customOptions) { -// FileInputStream instream = null; -// Alignment alignment = null; -// String rnastruct = null; -// try { -// instream = new FileInputStream(file); -// alignment = ClustalAlignmentUtil.readClustalFile(instream); -// instream.close(); -// String jobId = null; -// if (customOptions != null && preset != null) { -// System.out.println("WARN: Parameters (-f) are defined together" -// + "with a preset (-r), ignoring preset! "); -// } -// if (customOptions != null) { -// jobId = foldws.customFold(alignment, customOptions); -// } else if (preset != null) { -// jobId = foldws.presetFold(alignment, preset); -// } else { -// jobId = foldws.fold(alignment); -// } -// System.out.println("\n\ncalling fold........."); -// Thread.sleep(1000); -// rnastruct = foldws.getResult(jobId); -// -// } catch (IOException e) { -// System.err.println("Exception while reading the input file. Exception details: "); -// e.printStackTrace(); -// } catch (UnknownFileFormatException e) { -// System.err.println("Exception while reading input file. Doesnt look like a Clustal format file"); -// e.printStackTrace(); -// } catch (JobSubmissionException e) { -// System.err.println("Exception while submitting job to the web server. "); -// e.printStackTrace(); -// } catch (ResultNotAvailableException e) { -// System.err.println("Exception while waiting for results. Exception details: "); -// e.printStackTrace(); -// } catch (InterruptedException ignored) { -// // ignore and propagate an interruption -// Thread.currentThread().interrupt(); -// } catch (WrongParameterException e) { -// e.printStackTrace(); -// } finally { -// if (instream != null) { -// try { -// instream.close(); -// } catch (IOException ignored) { -// // ignore -// } -// } -// } -// return rnastruct; -// } -// - /** * Prints Jws2Client usage information to standard out * * @param exitStatus diff --git a/webservices/compbio/ws/client/Services.java b/webservices/compbio/ws/client/Services.java index 8b0d200..2d2cdc8 100644 --- a/webservices/compbio/ws/client/Services.java +++ b/webservices/compbio/ws/client/Services.java @@ -26,7 +26,6 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.namespace.QName; import javax.xml.ws.Service; -import compbio.data.msa.FoldWS; import compbio.data.msa.JABAService; import compbio.data.msa.MsaWS; import compbio.data.msa.SequenceAnnotation; @@ -40,7 +39,8 @@ public enum Services { * Make sure this class has NO references to runners or engines as it is a * part of minimal client package. Such things should go into ServicesUtil */ - MafftWS, MuscleWS, ClustalWS, ClustalOWS, TcoffeeWS, ProbconsWS, AAConWS, JronnWS, DisemblWS, GlobPlotWS, IUPredWS, RNAalifoldWS; + MafftWS, MuscleWS, ClustalWS, ClustalOWS, TcoffeeWS, ProbconsWS, AAConWS, + JronnWS, DisemblWS, GlobPlotWS, IUPredWS, RNAalifoldWS; public static Services getService(String servName) { servName = servName.trim().toLowerCase(); @@ -196,8 +196,11 @@ public enum Services { // TODO reference public static final String RNAALIFOLD_INFO = new ServiceInfo( RNAalifoldWS, - "Reference to come", "2.1.2", - "http://www.tbi.univie.ac.at/RNA/").toString();; + "Ivo L. Hofacker, Martin Fekete, and Peter F. Stadler 'Secondary Structure Prediction" + + " for Aligned RNA Sequences'. J.Mol.Biol. 319: 1059-1066, 2002. Stephan H. Bernhart," + + " Ivo L. Hofacker, Sebastian Will, Andreas R. Gruber, and Peter F. Stadler. " + + "'RNAalifold: Improved consensus structure prediction for RNA alignments'. BMC Bioinformatics, 9:474, 2008.\r\n", + "2.1.2", "http://www.tbi.univie.ac.at/RNA/").toString();; @XmlAccessorType(XmlAccessType.FIELD) static class ServiceInfo { diff --git a/webservices/compbio/ws/client/WSTester.java b/webservices/compbio/ws/client/WSTester.java index 292d121..fd98f33 100644 --- a/webservices/compbio/ws/client/WSTester.java +++ b/webservices/compbio/ws/client/WSTester.java @@ -35,11 +35,9 @@ import javax.xml.ws.WebServiceException; import compbio.data.msa.JABAService; import compbio.data.msa.Metadata; import compbio.data.msa.MsaWS; -import compbio.data.msa.FoldWS; import compbio.data.msa.SequenceAnnotation; import compbio.data.sequence.Alignment; import compbio.data.sequence.FastaSequence; -import compbio.data.sequence.Program; import compbio.data.sequence.ScoreManager; import compbio.data.sequence.SequenceUtil; import compbio.metadata.JobStatus; @@ -211,14 +209,6 @@ public class WSTester { return succeed; } - private boolean testFoldWS(FoldWS foldws) throws Exception { - assert foldws != null; - - boolean succeed = testDefaultFold(foldws); - - // testMetadata(foldws); - return succeed; - } /** * Call most of web services functions and check the output * @@ -243,8 +233,6 @@ public class WSTester { } else if (wservice instanceof SequenceAnnotation) { return testSequenceAnnotationWS( (SequenceAnnotation) wservice, service); - } else if (wservice instanceof FoldWS) { - return testFoldWS( (FoldWS) wservice); } else { throw new UnsupportedOperationException("The service: " + wservice.getClass() + " is not supported! "); @@ -376,37 +364,7 @@ public class WSTester { return succeed; } - /** - * Fold using default settings - * - * @param - * @param foldws - * @throws UnsupportedRuntimeException - */ - private boolean testDefaultFold(FoldWS foldws) throws Exception { - writer.print("Testing fold with default parameters:"); - // load the input from the aligned fasta string at the top of the file - Alignment al = new Alignment(loadAlignment(), Program.CLUSTAL, '-'); - String rs = null; - boolean succeed = false; - - String taskId = foldws.fold(al); - writer.print("\nQuerying job status..."); - JobStatus status = foldws.getJobStatus(taskId); - while (status != JobStatus.FINISHED) { - Thread.sleep(1000); - status = foldws.getJobStatus(taskId); - } - writer.println(OK); - writer.print("Retrieving results..."); - rs = foldws.getResult(taskId); - succeed = true; - if (rs != null) { - writer.println(OK); - } - return succeed; - } /** * Test JWS2 web services * diff --git a/webservices/compbio/ws/server/RNAalifoldWS.java b/webservices/compbio/ws/server/RNAalifoldWS.java index b07882a..91081c4 100644 --- a/webservices/compbio/ws/server/RNAalifoldWS.java +++ b/webservices/compbio/ws/server/RNAalifoldWS.java @@ -9,13 +9,11 @@ import org.apache.log4j.Logger; import compbio.data.msa.JABAService; import compbio.data.msa.SequenceAnnotation; import compbio.data.sequence.FastaSequence; -import compbio.data.sequence.RNAStructScoreManager; import compbio.engine.client.ConfiguredExecutable; import compbio.metadata.JobSubmissionException; import compbio.metadata.LimitExceededException; import compbio.metadata.Option; import compbio.metadata.Preset; -import compbio.metadata.ResultNotAvailableException; import compbio.metadata.UnsupportedRuntimeException; import compbio.metadata.WrongParameterException; import compbio.runner.conservation.AACon; @@ -45,7 +43,7 @@ public class RNAalifoldWS extends SequenceAnnotationService } // Only purpose is to replace "analize" with "fold" method - // so that a clustal input file and not fasta will be generated + // so that a clustal input file and not fasta will be generated @Override public String customAnalize(List sequences, List> options) throws UnsupportedRuntimeException, diff --git a/webservices/compbio/ws/server/WSUtil.java b/webservices/compbio/ws/server/WSUtil.java index d230cde..e46c2d9 100644 --- a/webservices/compbio/ws/server/WSUtil.java +++ b/webservices/compbio/ws/server/WSUtil.java @@ -25,9 +25,7 @@ import java.util.Set; 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; @@ -114,29 +112,6 @@ public final class WSUtil { return jobId; } - // 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; -// } static void reportUsage(ConfiguredExecutable confExec, Logger logger) { if (GAUtils.IS_GA_ENABLED) { @@ -162,6 +137,8 @@ public final class WSUtil { } // Same as analize but Alifold takes clustal input not fasta + // An if condition in the above method might be a better solution but + // you need a way of finding out the type of confExec at runtime public static String fold(List sequences, ConfiguredExecutable confExec, Logger log, String method, @@ -173,6 +150,8 @@ public final class WSUtil { // This line is different from the above method compbio.runner.Util.writeClustalInput(sequences, confExec, '-'); AsyncExecutor engine = Configurator.getAsyncEngine(confExec); + System.out.println("Job Command: + " + + confExec.getParameters()); String jobId = engine.submitJob(confExec); reportUsage(confExec, log); return jobId; -- 1.7.10.2