X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webservices%2Fcompbio%2Fws%2Fserver%2FRNAalifoldWS.java;h=ed94c23cdc071f3617cf1910dd5f87bdc8a0b3e5;hb=184bf3dce9500c599b5257140ec49edd80f8cea1;hp=34f0aaf4f6dcc2c323ab4db522180cb2a11df80b;hpb=42d82f347c559914cc57499c43daa49aed0573b8;p=jabaws.git diff --git a/webservices/compbio/ws/server/RNAalifoldWS.java b/webservices/compbio/ws/server/RNAalifoldWS.java index 34f0aaf..ed94c23 100644 --- a/webservices/compbio/ws/server/RNAalifoldWS.java +++ b/webservices/compbio/ws/server/RNAalifoldWS.java @@ -1,66 +1,70 @@ -package compbio.ws.server; - -import java.io.File; -import java.util.List; - -import javax.jws.WebParam; -import javax.jws.WebService; - -import org.apache.log4j.Logger; - -import compbio.data.msa.FoldWS; -import compbio.data.msa.JABAService; -import compbio.data.msa.JManagement; -import compbio.data.msa.Metadata; -import compbio.data.msa.SequenceAnnotation; -import compbio.data.sequence.Alignment; -import compbio.data.sequence.RNAStruct; -import compbio.data.sequence.FastaSequence; -import compbio.engine.AsyncExecutor; -import compbio.engine.Configurator; -import compbio.engine.client.ConfiguredExecutable; -import compbio.engine.client.SkeletalExecutable; -import compbio.metadata.ChunkHolder; -import compbio.metadata.JobStatus; -import compbio.metadata.JobSubmissionException; -import compbio.metadata.Limit; -import compbio.metadata.LimitExceededException; -import compbio.metadata.LimitsManager; -import compbio.metadata.Option; -import compbio.metadata.Preset; -import compbio.metadata.PresetManager; -import compbio.metadata.ResultNotAvailableException; -import compbio.metadata.RunnerConfig; -import compbio.metadata.UnsupportedRuntimeException; -import compbio.metadata.WrongParameterException; -import compbio.runner.Util; -import compbio.runner.disorder.GlobPlot; -import compbio.runner.structure.RNAalifold; - -@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = JABAService.V2_SERVICE_NAMESPACE, serviceName = "RNAalifoldWS") -public class RNAalifoldWS extends SequenceAnnotationService - implements - SequenceAnnotation { - - private static Logger log = Logger.getLogger(ClustalWS.class); - - public RNAalifoldWS() { - super (new RNAalifold(), log); - } - - - /* - * No presets are supported, thus the result of this call will be as simple - * call to analize without parameters - */ - @Override - public String presetAnalize(List sequences, - Preset preset) throws UnsupportedRuntimeException, - LimitExceededException, JobSubmissionException, - WrongParameterException { - - return analize(sequences); - } -} - - +package compbio.ws.server; + +import java.util.List; + +import javax.jws.WebService; + +import org.apache.log4j.Logger; + +import compbio.data.msa.JABAService; +import compbio.data.msa.SequenceAnnotation; +import compbio.data.sequence.FastaSequence; +import compbio.engine.client.ConfiguredExecutable; +import compbio.metadata.JobSubmissionException; +import compbio.metadata.LimitExceededException; +import compbio.metadata.Option; +import compbio.metadata.Preset; +import compbio.metadata.UnsupportedRuntimeException; +import compbio.metadata.WrongParameterException; +import compbio.runner.conservation.AACon; +import compbio.runner.structure.RNAalifold; + +@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = JABAService.V2_SERVICE_NAMESPACE, serviceName = "RNAalifoldWS") +public class RNAalifoldWS extends SequenceAnnotationService implements SequenceAnnotation { + + private static Logger log = Logger.getLogger(RNAalifoldWS.class); + + public RNAalifoldWS() { + super (new RNAalifold(), log); + } + + // Only purpose is to replace "analize" with "fold" method + // so that a clustal input file and not fasta will be generated + @SuppressWarnings("unchecked") + @Override + public String analize(List sequences) + throws UnsupportedRuntimeException, LimitExceededException, + JobSubmissionException { + WSUtil.validateFastaInput(sequences); + ConfiguredExecutable confRNAalifold = init(sequences); + return WSUtil.fold(sequences, confRNAalifold, log, "analize", getLimit("")); + } + + // Only purpose is to replace "analize" with "fold" method + // so that a clustal input file and not fasta will be generated + @SuppressWarnings("unchecked") + @Override + public String customAnalize(List sequences, + List> options) throws UnsupportedRuntimeException, + LimitExceededException, JobSubmissionException, + WrongParameterException { + WSUtil.validateFastaInput(sequences); + ConfiguredExecutable confRNAalifold = init(sequences); + List params = WSUtil.getCommands(options, RNAalifold.KEY_VALUE_SEPARATOR); + confRNAalifold.addParameters(params); + return WSUtil.fold(sequences, confRNAalifold, log, "customAnalize", getLimit("")); + } + + + /* + * No presets are supported, thus the result of this call will be as simple + * call to analize without parameters + */ + @Override + public String presetAnalize(List sequences, + Preset preset) throws UnsupportedRuntimeException, + LimitExceededException, JobSubmissionException, + WrongParameterException { + return analize(sequences); + } +}