Google analytics receives message with actual Jabaws version
[jabaws.git] / webservices / compbio / ws / server / RNAalifoldWS.java
index a6ed826..ed94c23 100644 (file)
@@ -14,23 +14,48 @@ 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
 import compbio.runner.structure.RNAalifold;\r
 \r
 @WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = JABAService.V2_SERVICE_NAMESPACE, serviceName = "RNAalifoldWS")\r
-public class RNAalifoldWS extends SequenceAnnotationService<RNAalifold> \r
-               implements\r
-                       SequenceAnnotation<RNAalifold> {\r
+public class RNAalifoldWS extends SequenceAnnotationService<RNAalifold> implements SequenceAnnotation<RNAalifold> {\r
 \r
        private static Logger log = Logger.getLogger(RNAalifoldWS.class);\r
        \r
        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
+       @SuppressWarnings("unchecked")\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", 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
+       @SuppressWarnings("unchecked")\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
+               List<String> params = WSUtil.getCommands(options, RNAalifold.KEY_VALUE_SEPARATOR);\r
+               confRNAalifold.addParameters(params);\r
+               return WSUtil.fold(sequences, confRNAalifold, log, "customAnalize", 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
@@ -40,9 +65,6 @@ public class RNAalifoldWS extends SequenceAnnotationService<RNAalifold>
                        Preset<RNAalifold> preset) throws UnsupportedRuntimeException,\r
                        LimitExceededException, JobSubmissionException,\r
                        WrongParameterException {\r
-\r
                return analize(sequences);\r
        }\r
 }\r
-       \r
-       \r