Clean-up, refactoring, commenting. Parameters file containts only options since Jalvi...
authorDaniel Barton <daluke.barton@gmail.com>
Fri, 30 Aug 2013 09:57:53 +0000 (10:57 +0100)
committerDaniel Barton <daluke.barton@gmail.com>
Fri, 30 Aug 2013 09:57:53 +0000 (10:57 +0100)
15 files changed:
conf/Executable.properties
conf/settings/RNAalifoldOptionsOnly.xml [new file with mode: 0644]
conf/settings/RNAalifoldParameters.xml
datamodel/compbio/data/sequence/RNAStructScoreManager.java
datamodel/compbio/data/sequence/Range.java
datamodel/compbio/data/sequence/Score.java
runner/compbio/runner/structure/RNAalifold.java
testsrc/compbio/ws/client/TestRNAalifoldWS.java
testsrc/testdata/RNAalifoldParameters.xml [deleted file]
webservices/compbio/data/msa/FoldWS.java [deleted file]
webservices/compbio/ws/client/Jws2Client.java
webservices/compbio/ws/client/Services.java
webservices/compbio/ws/client/WSTester.java
webservices/compbio/ws/server/RNAalifoldWS.java
webservices/compbio/ws/server/WSUtil.java

index 333477e..ba9b4a7 100644 (file)
@@ -199,5 +199,5 @@ aacon.presets.file=conf/settings/AAConPresets.xml
 #####                                  RNAALIFOLD CONFIGURATION                         ######\r
 local.rnaalifold.bin.windows=binaries/windows/ViennaRNA/RNAalifold.exe\r
 local.rnaalifold.bin=binaries/src/ViennaRNA/Progs/RNAalifold\r
-rnaalifold.parameters.file=conf/settings/RNAalifoldParameters.xml\r
+rnaalifold.parameters.file=conf/settings/RNAalifoldOptionsOnly.xml\r
 \r
diff --git a/conf/settings/RNAalifoldOptionsOnly.xml b/conf/settings/RNAalifoldOptionsOnly.xml
new file mode 100644 (file)
index 0000000..7f8ef44
--- /dev/null
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
+<runnerConfig>
+       <runnerClassName>compbio.runner.structure.RNAalifold</runnerClassName>
+       <options isRequired='false'>
+               <name>Endgaps</name>
+               <description>Score pairs with endgaps same as gap-gap pairs</description>
+               <optionNames>-E</optionNames>
+       </options>
+       <options isRequired='false'>
+               <name>Most Informative Sequence</name>
+               <description>Ouput Set of nucleotides with frequency > average</description>
+               <optionNames>--mis</optionNames>
+       </options>
+       <options isRequired='false'>
+               <name>Partition Function</name>
+               <description>Output partition function and probability matrix</description>
+               <optionNames>-p</optionNames>
+       </options>
+       <options isRequired='false'>
+               <name>Circular</name>
+               <description>Assume circular RNA molecule</description>
+               <optionNames>-c</optionNames>
+       </options>
+       <!--  Not Currently available with circular structures (-c) -->
+       <options isRequired='false'>
+               <name>G-Quadruplex</name>
+               <description>Incorporate G-Quadruplex formation into prediction algorithm</description>
+               <optionNames>-g</optionNames>
+       </options>
+       <options isRequired='false'>
+               <name>d2</name>
+               <description>dangling energies will be added for the bases adjacent to a helix on both sides</description>
+               <optionNames>-d2</optionNames>
+       </options>
+       <options isRequired='false'>
+               <name>No LP</name>
+               <description>Produce Structures without lonely pairs</description>
+               <optionNames>--noLP</optionNames>
+       </options>
+       <options isRequired='false'>
+               <name>No GU</name>
+               <description>Do not allow GU pairs</description>
+               <optionNames>--noGU</optionNames>
+       </options>
+       <options isRequired='false'>
+               <name>No Closing GU</name>
+               <description>Do not allow GU pairs at the end of sequences</description>
+               <optionNames>--noClosingGU</optionNames>
+       </options>
+       <options isRequired='false'>
+               <name>old</name>
+               <description>Use old energy evaluation, treating gaps as characters</description>
+               <optionNames>--old</optionNames>
+       </options>
+       <options isRequired='false'>
+               <name>Ribosum Scoring</name>
+               <description>Use Ribosum Scoring Matrix</description>
+               <optionNames>-r</optionNames>
+       </options>
+       <options isRequired='false'>
+               <name>d2</name>
+               <description>
+               Dangling energies are added for the bases adjacent to a helix on both sides
+               </description>
+               <optionNames>-d2</optionNames>
+       </options>
+       <options isRequired='false'>
+               <name>MEA Structure</name>
+               <description>Maximum Expected Accuracy Structure</description>
+               <optionNames>--MEA</optionNames>
+       </options>
+       
+       
+       
+</runnerConfig>
\ No newline at end of file
index a730f64..e79c44c 100644 (file)
@@ -70,7 +70,7 @@
                <optionNames>--MEA</optionNames>
        </options>
        
-       <prmSeparator> </prmSeparator>
+       <prmSeparator> </prmSeparator>  
        
        <parameters isRequired='false'>
                <name>scaling factor</name>
@@ -96,7 +96,7 @@
        </parameters>
        <parameters isRequired='false'>
                <name>Temperature</name>
-               <description>Rescale Energy parameters to Temperature</description>
+               <description>Rescale Energy parameterss to Temperature</description>
                <optionNames>-T</optionNames>
                <defaultValue>37</defaultValue>
                <validValue>
                        <max>1000000</max>
                </validValue>
        </parameters>
+       
        <parameters isRequired='false'>
                <name>cfactor</name>
                <description>weight of covariance term</description>
index d2da2e1..428828d 100644 (file)
@@ -39,7 +39,6 @@ public class RNAStructScoreManager extends ScoreManager {
                this.seqScores = seqScores;\r
        }\r
        \r
-       // I put this in purely because it mirrors a method in ScoreManager, not because I need it \r
        public static RNAStructScoreManager newInstance(List<String> structs, List<TreeSet<Score>> data) {\r
                return new RNAStructScoreManager(structs, data);\r
        }\r
@@ -60,6 +59,11 @@ public class RNAStructScoreManager extends ScoreManager {
                return data;\r
                \r
        }\r
+       \r
+       /*\r
+        *  I want to be able to get the information in a ScoreHolder Object by\r
+        *  \r
+        */\r
 \r
        // Send this data Structure back to something approximating the stdoutFile\r
        // with extra information from alifold.out\r
@@ -98,7 +102,7 @@ public class RNAStructScoreManager extends ScoreManager {
                                Score s = iScores.next();\r
                                Range r = s.getRanges().first();\r
                                Float score = s.getScores().get(0);\r
-                               out += String.format("%4d  %4d    %.1f%n", r.getFrom(), r.getTo(),\r
+                               out += String.format("%4d  %4d    %.1f%n", r.from, r.to,\r
                                                score);\r
                        }\r
                }\r
index 9ade348..8dd7da9 100644 (file)
@@ -41,11 +41,6 @@ public class Range implements Comparable<Range> {
                this.to = Integer.parseInt(twoElementAr[1].trim());\r
        }\r
        \r
-       // Daniel Check these get methods are ok with Jim\r
-       public int getFrom() { return from; }\r
-       public int getTo() { return to; }\r
-       \r
-       \r
        @Override\r
        public String toString() {\r
                return from + "-" + to;\r
@@ -76,7 +71,11 @@ public class Range implements Comparable<Range> {
                return true;\r
        }\r
 \r
-       // daniel wants to mess with method. this is how it was\r
+       /*\r
+        *  Daniel messed with this method.\r
+        *  It now compares Ranges based on \r
+        */\r
+       \r
 //     @Override\r
 //     public int compareTo(Range o) {\r
 //             if (o == null)\r
index 1cac69c..0ca5152 100644 (file)
@@ -232,25 +232,26 @@ public class Score implements Comparable<Score> {
                writer.flush();\r
        }\r
 \r
+       // Old compareTo method\r
 //     @Override\r
 //     public int compareTo(Score o) {\r
 //             return this.method.compareTo(o.method);\r
 //     }\r
        \r
-       /* daniel wants to mess with this method and, while preserving the \r
-        * ordering when the method Enumerations are different, add additional\r
-        * constraints on how equal Score objects must be to be considered equal\r
+       /* daniel messed with this method. While preserving the original\r
+        * ordering when the method Enumerations are different, additional\r
+        * constraints have been added on how equal Score objects must be \r
+        * to be considered equal.\r
         * \r
         * It is necessary to distinguish Score objects by their ranges in order\r
         * to use a Set of Score objects to represent the alifold.out information\r
         * \r
-        * It is necessary to distinguish Score objects by their scores in order\r
-        * to return Stochastic Backtrack information reliably\r
+        * Distinguishing score objects by their Scores has the result of ordering\r
+        * the base pair contacts so into descending probability.\r
+        * \r
+        * Should this be in a new extended Score class?\r
         */\r
        \r
-       \r
-\r
-       \r
        @Override\r
        public int compareTo(Score o) {\r
                if (this.method.compareTo(o.method) != 0) {\r
index c6c79ec..918918e 100644 (file)
@@ -3,26 +3,15 @@ package compbio.runner.structure;
 \r
 import java.io.FileNotFoundException;\r
 import java.io.IOException;\r
-import java.util.Arrays;\r
-import java.util.List;\r
-\r
-\r
-\r
-\r
 \r
 import org.apache.log4j.Logger;\r
 \r
-import compbio.data.sequence.ScoreManager;\r
 import compbio.data.sequence.RNAStructScoreManager;\r
-import compbio.data.sequence.UnknownFileFormatException;\r
 import compbio.engine.client.PipedExecutable;\r
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.runner.Util;\r
 \r
-\r
-import compbio.engine.client.CommandBuilder;\r
-\r
 public class RNAalifold extends SkeletalExecutable<RNAalifold> \r
                implements PipedExecutable<RNAalifold> {\r
        \r
@@ -31,7 +20,7 @@ public class RNAalifold extends SkeletalExecutable<RNAalifold>
 \r
        // May not be necessary as defult is "<space>" but still dont know\r
        // How to deal with different key value separators for different params\r
-       public static final String KEY_VALUE_SEPARATOR = " ";\r
+       public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
        \r
        public RNAalifold() {\r
                super(KEY_VALUE_SEPARATOR);\r
index 5452c4e..cafe9cb 100644 (file)
@@ -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 (file)
index 845f480..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
-<runnerConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                       xsi:noNamespaceSchemaLocation="RunnerConfigSchema.xsd">
-       <runnerClassName>compbio.runner.structure.RNAalifold</runnerClassName>
-       <options isRequired='false'>
-               <name>Endgaps</name>
-               <description>Score pairs with endgaps same as gap-gap pairs</description>
-               <optionNames>-E</optionNames>
-               <optionNames>--endgaps</optionNames>
-               <defaultValue>-E</defaultValue>
-       </options>
-       <options isRequired='false'>
-               <name>Most Informative Sequence</name>
-               <description>Ouput Set of nucleotides with frequency > average</description>
-               <optionNames>--mis</optionNames>
-       </options>
-       <options isRequired='false'>
-               <name>Partition Function</name>
-               <description>Output partition function and probability matrix</description>
-               <optionNames>-p</optionNames>
-               <optionNames>--partfunc</optionNames>
-               <defaultValue>-p</defaultValue>
-       </options>
-       <options isRequired='false'>
-               <name>p0</name>
-               <description>deactivates the calculation of the pair probabilities</description>
-               <optionNames>-p0</optionNames>
-       </options>
-       <options isRequired='false'>
-               <name>color</name>
-               <description>Consensus structure plot is colored</description>
-               <optionNames>--color</optionNames>
-       </options>
-       <options isRequired='false'>
-               <name>Alignment</name>
-               <description>Output structure annotated alignment</description>
-               <optionNames>--aln</optionNames>
-       </options>
-       <options isRequired='false'>
-               <name>No Postscript</name>      
-               <description>Do not produce postscript output</description>
-               <optionNames>--noPS</optionNames>
-       </options>
-       <options isRequired='false'>
-               <name>Circular</name>
-               <description>Assume circular RNA molecule</description>
-               <optionNames>-c</optionNames>
-               <optionNames>--circ</optionNames>
-               <defaultValue>-c</defaultValue>
-       </options>
-       <!--  Not Currently available with circular structures (-c) -->
-       <options isRequired='false'>
-               <name>G-Quadruplex</name>
-               <description>Incorporate G-Quadruplex formation into prediction algorithm</description>
-               <optionNames>-g</optionNames>
-               <optionNames>--gquad</optionNames>
-               <defaultValue>-g</defaultValue>
-       </options>
-       <options isRequired='false'>
-               <name>d2</name>
-               <description>dangling energies will be added for the bases adjacent to a helix on both sides</description>
-               <optionNames>-d2</optionNames>
-       </options>
-       <options isRequired='false'>
-               <name>No LP</name>
-               <description>Produce Structures without lonely pairs</description>
-               <optionNames>--noLP</optionNames>
-       </options>
-       <options isRequired='false'>
-               <name>No GU</name>
-               <description>Do not allow GU pairs</description>
-               <optionNames>--noGU</optionNames>
-       </options>
-       <options isRequired='false'>
-               <name>No Closing GU</name>
-               <description>Do not allow GU pairs at the end of sequences</description>
-               <optionNames>--noClosingGU</optionNames>
-       </options>
-       <options isRequired='false'>
-               <name>old</name>
-               <description>Use old energy evaluation, treating gaps as characters</description>
-               <optionNames>--old</optionNames>
-       </options>
-       <options isRequired='false'>
-               <name>Ribosum Scoring</name>
-               <description>Use Ribosum Scoring Matrix</description>
-               <optionNames>-r</optionNames>
-               <optionNames>--ribosum_scoring</optionNames>
-               <defaultValue>-r</defaultValue>
-       </options>
-       <options isRequired='false'>
-               <name>d2</name>
-               <description>
-               Dangling energies are added for the bases adjacent to a helix on both sides
-               </description>
-               <optionNames>-d2</optionNames>
-       </options>
-       <options isRequired='false'>
-               <name>MEA Structure</name>
-               <description>Maximum Expected Accuracy Structure</description>
-               <optionNames>--MEA</optionNames>
-       </options>
-<!-- Constraints are entered on the command line followed by the input .aln file
-        Causing problems for a batch RNAalifold execution system -->
-<!--  
-       <option isRequired='false'>
-               <name>Constraints</name>
-               <description>Structures calculated subject to constraints</description>
-               <optionNames>-C</optionNames>
-               <validValue>
-                       <type>String</type>
-               </validValue>
-       </option> -->
-       
-       <prmSeparator> </prmSeparator>
-       <parameters isRequired='false'>
-               <name>Stochastic Backtrack</name>
-               <description>Compute a number of random structures</description>
-               <optionNames>-s</optionNames>
-<!--           Having multiple optionNames requires a default value but -->
-<!--                   in a parameter defaultValue refers to the argument -->
-<!--           <optionNames>-stochBT</optionNames> -->
-               <defaultValue>5</defaultValue>  
-               <validValue>
-                       <type>Integer</type>
-                       <min>1</min>
-                       <max>100000</max>
-               </validValue>
-       </parameters>
-       <parameters isRequired='false'>
-               <name>stochBT_en</name>
-               <description>Print Backtrack structures</description>
-               <optionNames>--stochBT_en</optionNames>
-               <defaultValue>5</defaultValue>  <!-- arbitrary -->
-               <validValue>
-                       <type>Integer</type>
-                       <min>1</min>
-                       <max>100000</max>
-               </validValue>
-       </parameters>
-       <parameters isRequired='false'>
-               <name>scaling factor</name>
-               <description>In calculating pf use scale*mfe as estimate for ensemble free energy]</description>
-               <optionNames>-S</optionNames>
-<!--           <optionNames>-pfScale</optionNames> -->
-               <defaultValue>1.07</defaultValue>
-               <validValue>
-                       <type>Float</type>
-                       <min>0</min>
-                       <max>100</max>
-               </validValue>
-       </parameters>
-       <parameters isRequired='false'>
-               <name>bppmThreshold</name>
-               <description>Threshold for base pair probabilities</description>
-               <optionNames>--bppmThreshold</optionNames>
-               <defaultValue>0.000001</defaultValue>
-               <validValue>
-                       <type>Float</type>
-                       <min>0.0000000000001</min>
-                       <max>1.0</max>
-               </validValue>
-       </parameters>
-       <parameters isRequired='false'>
-               <name>Temperature</name>
-               <description>Rescale Energy parameterss to Temperature</description>
-               <optionNames>-T</optionNames>
-<!--           <optionNames>-temp</optionNames> -->
-               <defaultValue>37</defaultValue>
-               <validValue>
-                       <type>Float</type>
-                       <min>-274</min>
-                       <max>1000000</max>
-               </validValue>
-       </parameters>
-       <parameters isRequired='false'>
-               <name>Dangling End</name>
-               <description>How to treat Dangling End energies for bases adjacent to helices</description>
-               <optionNames>-d</optionNames>
-<!--           <optionNames>-dangles</optionNames> -->
-               <defaultValue>2</defaultValue>
-               <validValue>
-                       <type>Integer</type>
-                       <min>0</min>
-                       <max>100000</max>
-               </validValue>
-       </parameters>
-       <parameters isRequired='false'>
-               <name>cfactor</name>
-               <description>weight of covariance term</description>
-               <optionNames>--cfactor</optionNames>
-               <defaultValue>1.0</defaultValue>
-               <validValue>
-                       <type>Float</type>
-                       <min>0</min>
-                       <max>100000</max>
-               </validValue>
-       </parameters>
-       <parameters isRequired='false'>
-               <name>nfactor</name>
-               <description>penalty for non-compatible sequences in covariance term</description>      
-               <optionNames>--nfactor</optionNames>
-               <defaultValue>1.0</defaultValue>
-               <validValue>
-                       <type>Float</type>
-                       <min>0</min>
-                       <max>100000</max>
-               </validValue>
-       </parameters>
-       
-<!--    How to deal with default/possible values for parameter files? -->
-<!--   <parameters isRequired='false'> -->
-<!--           <name>Ribosum File</name> -->
-<!--           <description>Use Specified Ribosum Matrix</description> -->
-<!--           <optionNames>-R</optionNames> -->
-<!--           <optionNames>-ribosum_file</optionNames>  -->
-<!--   </parameters> -->
-<!--   <parameters isRequired='false'> -->
-<!--           <name>Paramfile</name> -->
-<!--           <description>Use Energy parameters from a file</description> -->
-<!--           <optionNames>-P</optionNames> -->
-<!--           <optionNames>-paramFile</optionNames>  -->
-<!--           <validValue> -->
-<!--                   <type>String</type> -->
-<!--           </validValue> -->
-<!--   </parameters> -->
-       
-       <!-- The values of this parameter are in the form of a comma separated
-                       list of allowed pairs. This makes a complete parameter list
-                       too large to be represented as a list of possible values
-                       How to deal with this? -->
-                       <!--  just support the most biologically viable pairs? -->
-       
-       <parameters isRequired='false'>
-               <name>Allow Pairs</name>
-               <description>allow pairs in addition to AU, GC and GU</description>
-               <optionNames>--nsp</optionNames>
-               <defaultValue>-GA</defaultValue>
-               <possibleValues>-GA</possibleValues>
-               <possibleValues>-AG</possibleValues>
-       </parameters>
-       <!--  Is dependant on -p (partfunc) -->
-       <parameters isRequired='false'>
-               <name>betaScale</name>
-               <description>Set scaling of Boltzmann factors</description>
-               <optionNames>--betaScale</optionNames>
-               <defaultValue>1.0</defaultValue>
-               <validValue>
-                       <type>Float</type>
-                       <min>0</min>
-                       <max>100000</max>
-               </validValue>
-       </parameters>
-</runnerConfig>
\ 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 (file)
index 19282d6..0000000
+++ /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<T> 
-               extends 
-                       JABAService,
-                       JManagement,
-                       Metadata<T> {
-
-       
-       // 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<Option<T>> options)
-                       throws UnsupportedRuntimeException, LimitExceededException,
-                       JobSubmissionException, WrongParameterException;
-       
-       String presetFold(
-                       @WebParam(name = "alignment") Alignment alignment,
-                       @WebParam(name = "preset") Preset<T> preset)
-                       throws UnsupportedRuntimeException, LimitExceededException,
-                       JobSubmissionException, WrongParameterException;
-       
-       String getResult(@WebParam(name = "jobId") String jobId)
-               throws ResultNotAvailableException;
-                       
-}
index ae38d9f..7b781a2 100644 (file)
@@ -43,7 +43,6 @@ import javax.xml.ws.Service;
 import javax.xml.ws.WebServiceException;\r
 \r
 import compbio.data.msa.JABAService;\r
-import compbio.data.msa.FoldWS;\r
 import compbio.data.msa.Metadata;\r
 import compbio.data.msa.MsaWS;\r
 import compbio.data.msa.RegistryWS;\r
@@ -51,7 +50,6 @@ import compbio.data.msa.SequenceAnnotation;
 import compbio.data.sequence.Alignment;\r
 import compbio.data.sequence.FastaSequence;\r
 import compbio.data.sequence.ScoreManager;\r
-import compbio.data.sequence.ClustalAlignmentUtil;\r
 import compbio.data.sequence.SequenceUtil;\r
 import compbio.data.sequence.UnknownFileFormatException;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -516,76 +514,6 @@ public class Jws2Client {
        }\r
        \r
        /**\r
-        * Return RNA secondary structure from a file using FoldWS\r
-        * \r
-        * @param <T>\r
-        *            web service type e.g. Clustal\r
-        * @param file\r
-        *            to read the results from\r
-        * @param foldws\r
-        *            FoldWS required\r
-        * @param preset\r
-        *            Preset to use optional\r
-        * @param customOptions\r
-        *            file which contains new line separated list of options\r
-        * @return String\r
-        */\r
-       \r
-//     static <T> String fold(File file, FoldWS<T> foldws, Preset<T> preset,\r
-//                     List<Option<T>> customOptions) {\r
-//             FileInputStream instream = null;\r
-//             Alignment alignment = null;\r
-//             String rnastruct = null;\r
-//             try {\r
-//                     instream = new FileInputStream(file);\r
-//                     alignment = ClustalAlignmentUtil.readClustalFile(instream);\r
-//                     instream.close();\r
-//                     String jobId = null;\r
-//                     if (customOptions != null && preset != null) {\r
-//                             System.out.println("WARN: Parameters (-f) are defined together"\r
-//                                             + "with a preset (-r), ignoring preset! ");\r
-//                     }\r
-//                     if (customOptions != null) {\r
-//                             jobId = foldws.customFold(alignment, customOptions);\r
-//                     } else if (preset != null) {\r
-//                             jobId = foldws.presetFold(alignment, preset);\r
-//                     } else {\r
-//                             jobId = foldws.fold(alignment);\r
-//                     }\r
-//                     System.out.println("\n\ncalling fold.........");\r
-//                     Thread.sleep(1000);\r
-//                     rnastruct = foldws.getResult(jobId);\r
-//                             \r
-//             } catch (IOException e) {\r
-//                     System.err.println("Exception while reading the input file. Exception details: ");\r
-//                     e.printStackTrace();\r
-//             } catch (UnknownFileFormatException e) {\r
-//                     System.err.println("Exception while reading input file. Doesnt look like a Clustal format file");\r
-//                     e.printStackTrace();\r
-//             } catch (JobSubmissionException e) {\r
-//                     System.err.println("Exception while submitting job to the web server. ");\r
-//                     e.printStackTrace();\r
-//             } catch (ResultNotAvailableException e) {\r
-//                     System.err.println("Exception while waiting for results. Exception details: ");\r
-//                     e.printStackTrace();\r
-//             } catch (InterruptedException ignored) {\r
-//                     // ignore and propagate an interruption\r
-//                     Thread.currentThread().interrupt();\r
-//             } catch (WrongParameterException e) {\r
-//                     e.printStackTrace();\r
-//             } finally {\r
-//                     if (instream != null) {\r
-//                             try {\r
-//                                     instream.close();\r
-//                             } catch (IOException ignored) {\r
-//                                     // ignore\r
-//                             }\r
-//                     }\r
-//             }\r
-//             return rnastruct;\r
-//     }\r
-//             \r
-       /**\r
         * Prints Jws2Client usage information to standard out\r
         * \r
         * @param exitStatus\r
index 8b0d200..2d2cdc8 100644 (file)
@@ -26,7 +26,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.namespace.QName;\r
 import javax.xml.ws.Service;\r
 \r
-import compbio.data.msa.FoldWS;\r
 import compbio.data.msa.JABAService;\r
 import compbio.data.msa.MsaWS;\r
 import compbio.data.msa.SequenceAnnotation;\r
@@ -40,7 +39,8 @@ public enum Services {
         * Make sure this class has NO references to runners or engines as it is a\r
         * part of minimal client package. Such things should go into ServicesUtil\r
         */\r
-       MafftWS, MuscleWS, ClustalWS, ClustalOWS, TcoffeeWS, ProbconsWS, AAConWS, JronnWS, DisemblWS, GlobPlotWS, IUPredWS, RNAalifoldWS;\r
+       MafftWS, MuscleWS, ClustalWS, ClustalOWS, TcoffeeWS, ProbconsWS, AAConWS,\r
+       JronnWS, DisemblWS, GlobPlotWS, IUPredWS, RNAalifoldWS;\r
 \r
        public static Services getService(String servName) {\r
                servName = servName.trim().toLowerCase();\r
@@ -196,8 +196,11 @@ public enum Services {
        // TODO reference\r
        public static final String RNAALIFOLD_INFO = new ServiceInfo(\r
                        RNAalifoldWS,\r
-                       "Reference to come", "2.1.2",\r
-                       "http://www.tbi.univie.ac.at/RNA/").toString();;\r
+                       "Ivo L. Hofacker, Martin Fekete, and Peter F. Stadler 'Secondary Structure Prediction"\r
+                       + " for Aligned RNA Sequences'. J.Mol.Biol. 319: 1059-1066, 2002. Stephan H. Bernhart,"\r
+                       + " Ivo L. Hofacker, Sebastian Will, Andreas R. Gruber, and Peter F. Stadler. "\r
+                       + "'RNAalifold: Improved consensus structure prediction for RNA alignments'. BMC Bioinformatics, 9:474, 2008.\r\n",\r
+                       "2.1.2", "http://www.tbi.univie.ac.at/RNA/").toString();;\r
                        \r
        @XmlAccessorType(XmlAccessType.FIELD)\r
        static class ServiceInfo {\r
index 292d121..fd98f33 100644 (file)
@@ -35,11 +35,9 @@ import javax.xml.ws.WebServiceException;
 import compbio.data.msa.JABAService;\r
 import compbio.data.msa.Metadata;\r
 import compbio.data.msa.MsaWS;\r
-import compbio.data.msa.FoldWS;\r
 import compbio.data.msa.SequenceAnnotation;\r
 import compbio.data.sequence.Alignment;\r
 import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.Program;\r
 import compbio.data.sequence.ScoreManager;\r
 import compbio.data.sequence.SequenceUtil;\r
 import compbio.metadata.JobStatus;\r
@@ -211,14 +209,6 @@ public class WSTester {
                return succeed;\r
        }\r
        \r
-       private <T> boolean testFoldWS(FoldWS<T> foldws) throws Exception {\r
-               assert foldws != null;\r
-               \r
-               boolean succeed = testDefaultFold(foldws);\r
-               \r
-               // testMetadata(foldws);\r
-               return succeed;\r
-       }\r
        /**\r
         * Call most of web services functions and check the output\r
         * \r
@@ -243,8 +233,6 @@ public class WSTester {
                        } else if (wservice instanceof SequenceAnnotation) {\r
                                return testSequenceAnnotationWS(\r
                                                (SequenceAnnotation<T>) wservice, service);\r
-                       } else if (wservice instanceof FoldWS) {\r
-                               return testFoldWS( (FoldWS<T>) wservice);\r
                        } else {\r
                                throw new UnsupportedOperationException("The service: "\r
                                                + wservice.getClass() + " is not supported! ");\r
@@ -376,37 +364,7 @@ public class WSTester {
                return succeed;\r
        }\r
        \r
-       /**\r
-        * Fold using default settings\r
-        * \r
-        * @param <T>\r
-        * @param foldws\r
-        * @throws UnsupportedRuntimeException\r
-        */\r
        \r
-       private <T> boolean testDefaultFold(FoldWS<T> foldws) throws Exception {\r
-               writer.print("Testing fold with default parameters:");\r
-               // load the input from the aligned fasta string at the top of the file\r
-               Alignment al = new Alignment(loadAlignment(), Program.CLUSTAL, '-');\r
-               String rs = null;\r
-               boolean succeed = false;\r
-               \r
-               String taskId = foldws.fold(al);\r
-               writer.print("\nQuerying job status...");\r
-               JobStatus status = foldws.getJobStatus(taskId);\r
-               while (status != JobStatus.FINISHED) {\r
-                       Thread.sleep(1000);\r
-                       status = foldws.getJobStatus(taskId);\r
-               }\r
-               writer.println(OK);\r
-               writer.print("Retrieving results...");\r
-               rs = foldws.getResult(taskId);\r
-               succeed = true;\r
-               if (rs != null) {\r
-                       writer.println(OK);\r
-               }\r
-               return succeed;\r
-       }\r
        /**\r
         * Test JWS2 web services\r
         * \r
index b07882a..91081c4 100644 (file)
@@ -9,13 +9,11 @@ import org.apache.log4j.Logger;
 import compbio.data.msa.JABAService;\r
 import compbio.data.msa.SequenceAnnotation;\r
 import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.RNAStructScoreManager;\r
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.metadata.JobSubmissionException;\r
 import compbio.metadata.LimitExceededException;\r
 import compbio.metadata.Option;\r
 import compbio.metadata.Preset;\r
-import compbio.metadata.ResultNotAvailableException;\r
 import compbio.metadata.UnsupportedRuntimeException;\r
 import compbio.metadata.WrongParameterException;\r
 import compbio.runner.conservation.AACon;\r
@@ -45,7 +43,7 @@ public class RNAalifoldWS extends SequenceAnnotationService<RNAalifold>
        }\r
 \r
        // Only purpose is to replace "analize" with "fold" method \r
-               // so that a clustal input file and not fasta will be generated\r
+       // so that a clustal input file and not fasta will be generated\r
        @Override\r
        public String customAnalize(List<FastaSequence> sequences,\r
                        List<Option<RNAalifold>> options) throws UnsupportedRuntimeException,\r
index d230cde..e46c2d9 100644 (file)
@@ -25,9 +25,7 @@ import java.util.Set;
 \r
 import org.apache.log4j.Logger;\r
 \r
-import compbio.data.sequence.Alignment;\r
 import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.RNAStructScoreManager;\r
 import compbio.data.sequence.ScoreManager;\r
 import compbio.engine.AsyncExecutor;\r
 import compbio.engine.Configurator;\r
@@ -114,29 +112,6 @@ public final class WSUtil {
                return jobId;\r
        }\r
        \r
-       // Hardcoded gapchar '-' in this method\r
-       \r
-//     public static <T> String fold(Alignment alignment,\r
-//                     ConfiguredExecutable<T> confExec, Logger logger,\r
-//                     String callingMethod, Limit<T> limit)\r
-//                     throws LimitExceededException, JobSubmissionException {\r
-//             \r
-//             List<FastaSequence> sequences = alignment.getSequences();\r
-//             if (limit != null && limit.isExceeded(sequences)) {\r
-//                     throw LimitExceededException.newLimitExceeded(limit, sequences);\r
-//             }\r
-//             compbio.runner.Util.writeClustalInput(sequences, confExec, '-');\r
-//             System.out.println("WSUtil-fold: Writing the clustal input file on the server: to file: "\r
-//                             + confExec.getInput());\r
-//             System.out.println("WSUtil-fold: The executable is configured with parameters: " \r
-//                             + confExec.getParameters());\r
-////           System.out.println("WSUTil-fold: Dump the configured executable:\n" \r
-////                           + confExec.toString());\r
-//             AsyncExecutor engine = Configurator.getAsyncEngine(confExec);\r
-//             String jobId = engine.submitJob(confExec);\r
-//             reportUsage(confExec, logger);\r
-//             return jobId;\r
-//     }\r
 \r
        static <T> void reportUsage(ConfiguredExecutable<T> confExec, Logger logger) {\r
                if (GAUtils.IS_GA_ENABLED) {\r
@@ -162,6 +137,8 @@ public final class WSUtil {
        }\r
        \r
        // Same as analize but Alifold takes clustal input not fasta\r
+       // An if condition in the above method might be a better solution but \r
+       // you need a way of finding out the type of confExec at runtime\r
        \r
        public static <T> String fold(List<FastaSequence> sequences,\r
                        ConfiguredExecutable<T> confExec, Logger log, String method,\r
@@ -173,6 +150,8 @@ public final class WSUtil {
                // This line is different from the above method\r
                compbio.runner.Util.writeClustalInput(sequences, confExec, '-');\r
                AsyncExecutor engine = Configurator.getAsyncEngine(confExec);\r
+               System.out.println("Job Command: + " \r
+                               + confExec.getParameters());\r
                String jobId = engine.submitJob(confExec);\r
                reportUsage(confExec, log);\r
                return jobId;\r