X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webservices%2Fcompbio%2Fws%2Fserver%2FMuscleWS.java;h=943b3c2a8c6b3b5b0e03986cb11f0f4b59fbb96e;hb=184bf3dce9500c599b5257140ec49edd80f8cea1;hp=80f67b2b4a89f20b03dbf9225b9be7aa58e70a38;hpb=021b24f125d8b1e8390e99b4a835469dabdd7be1;p=jabaws.git diff --git a/webservices/compbio/ws/server/MuscleWS.java b/webservices/compbio/ws/server/MuscleWS.java index 80f67b2..943b3c2 100644 --- a/webservices/compbio/ws/server/MuscleWS.java +++ b/webservices/compbio/ws/server/MuscleWS.java @@ -1,6 +1,6 @@ -/* Copyright (c) 2009 Peter Troshin +/* Copyright (c) 2011 Peter Troshin * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 + * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 * * This library is free software; you can redistribute it and/or modify it under the terms of the * Apache License version 2 as published by the Apache Software Foundation @@ -21,18 +21,20 @@ package compbio.ws.server; import java.io.File; import java.util.List; -import javax.annotation.Resource; import javax.jws.WebService; -import javax.xml.ws.WebServiceContext; import org.apache.log4j.Logger; +import compbio.data.msa.JABAService; import compbio.data.msa.MsaWS; import compbio.data.sequence.Alignment; import compbio.data.sequence.FastaSequence; +import compbio.data.sequence.Program; import compbio.engine.AsyncExecutor; import compbio.engine.Configurator; import compbio.engine.client.ConfiguredExecutable; +import compbio.engine.client.SkeletalExecutable; +import compbio.engine.client.EngineUtil; import compbio.metadata.ChunkHolder; import compbio.metadata.JobStatus; import compbio.metadata.JobSubmissionException; @@ -44,40 +46,31 @@ import compbio.metadata.PresetManager; import compbio.metadata.ResultNotAvailableException; import compbio.metadata.RunnerConfig; import compbio.metadata.WrongParameterException; -import compbio.runner.Util; +import compbio.runner.RunnerUtil; import compbio.runner.msa.Muscle; -@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = "http://msa.data.compbio/01/01/2010/", serviceName = "MuscleWS") +@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "MuscleWS") public class MuscleWS implements MsaWS { - // Ask for resource injection - @Resource - WebServiceContext wsContext; - - private static Logger statLog = Logger.getLogger("MuscleWS-stats"); - private static Logger log = Logger.getLogger(MuscleWS.class); - - private static final RunnerConfig muscleOptions = Util - .getSupportedOptions(Muscle.class); - - private static final PresetManager musclePresets = Util - .getPresets(Muscle.class); - - private static final LimitsManager limitMan = compbio.engine.client.Util - .getLimits(new Muscle().getType()); + private static final RunnerConfig muscleOptions = RunnerUtil.getSupportedOptions(Muscle.class); + private static final PresetManager musclePresets = RunnerUtil.getPresets(Muscle.class); + private static final LimitsManager limitMan = EngineUtil.getLimits(new Muscle().getType()); @Override public String align(List sequences) throws JobSubmissionException { WSUtil.validateFastaInput(sequences); ConfiguredExecutable confMuscle = init(sequences); - return WSUtil.align(sequences, confMuscle, null, "align", getLimit("")); + return WSUtil.align(sequences, confMuscle, log, "align", getLimit("")); } ConfiguredExecutable init(List sequences) throws JobSubmissionException { Muscle muscle = new Muscle(); + muscle.setInput(SkeletalExecutable.INPUT) + .setOutput(SkeletalExecutable.OUTPUT) + .setError(SkeletalExecutable.ERROR); return Configurator.configureExecutable(muscle, sequences); } @@ -93,8 +86,7 @@ public class MuscleWS implements MsaWS { List params = WSUtil.getCommands(options, Muscle.KEY_VALUE_SEPARATOR); confMuscle.addParameters(params); - return WSUtil.align(sequences, confMuscle, null, "customAlign", - getLimit("")); + return WSUtil.align(sequences, confMuscle, log, "customAlign", getLimit("")); } @Override @@ -108,7 +100,7 @@ public class MuscleWS implements MsaWS { ConfiguredExecutable confMuscle = init(sequences); confMuscle.addParameters(preset.getOptions()); Limit limit = getLimit(preset.getName()); - return WSUtil.align(sequences, confMuscle, null, "presetAlign", limit); + return WSUtil.align(sequences, confMuscle, log, "presetAlign", limit); } @SuppressWarnings("unchecked") @@ -119,8 +111,7 @@ public class MuscleWS implements MsaWS { ConfiguredExecutable muscle = (ConfiguredExecutable) asyncEngine .getResults(jobId); Alignment al = muscle.getResults(); - // log(jobId, "getResults"); - return al; + return new Alignment (al.getSequences(),Program.Muscle, '-'); } @Override