Clean-up, refactoring, commenting. Parameters file containts only options since Jalvi...
[jabaws.git] / webservices / compbio / ws / server / RNAalifoldWS.java
index a6ed826..91081c4 100644 (file)
@@ -14,7 +14,6 @@ import compbio.metadata.JobSubmissionException;
 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
@@ -30,7 +29,37 @@ public class RNAalifoldWS extends SequenceAnnotationService<RNAalifold>
        public RNAalifoldWS() {\r
                super (new RNAalifold(), log);\r
        }\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
+       @Override\r
+       public String analize(List<FastaSequence> sequences)\r
+                       throws UnsupportedRuntimeException, LimitExceededException,\r
+                       JobSubmissionException {\r
+               WSUtil.validateFastaInput(sequences);\r
+               ConfiguredExecutable<RNAalifoldWS> confRNAalifold = init(sequences);\r
+               return WSUtil.fold(sequences, confRNAalifold, log, "analize",\r
+                               getLimit(""));\r
+       }\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
+       @Override\r
+       public String customAnalize(List<FastaSequence> sequences,\r
+                       List<Option<RNAalifold>> options) throws UnsupportedRuntimeException,\r
+                       LimitExceededException, JobSubmissionException,\r
+                       WrongParameterException {\r
+               WSUtil.validateFastaInput(sequences);\r
+               ConfiguredExecutable<RNAalifold> confRNAalifold = init(sequences);\r
+               \r
+               List<String> params = WSUtil.getCommands(options,\r
+                               AACon.KEY_VALUE_SEPARATOR);\r
+               confRNAalifold.addParameters(params);\r
+               return WSUtil.fold(sequences, confRNAalifold, log, "customAnalize",\r
+                               getLimit(""));\r
+       }\r
+       \r
+       \r
        /*\r
         * No presets are supported, thus the result of this call will be as simple\r
         * call to analize without parameters\r