More work to disorder prediction client & services.
[jabaws.git] / webservices / compbio / ws / server / AAConWS.java
index 8637af1..1625ded 100644 (file)
@@ -2,7 +2,6 @@ package compbio.ws.server;
 \r
 import java.io.File;\r
 import java.util.Arrays;\r
-import java.util.HashSet;\r
 import java.util.List;\r
 \r
 import javax.annotation.Resource;\r
@@ -13,11 +12,11 @@ import org.apache.log4j.Logger;
 \r
 import compbio.data.msa.SequenceAnnotation;\r
 import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.Score;\r
 import compbio.data.sequence.ScoreManager;\r
 import compbio.engine.AsyncExecutor;\r
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
+import compbio.engine.client.SkeletalExecutable;\r
 import compbio.metadata.ChunkHolder;\r
 import compbio.metadata.JobStatus;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -51,13 +50,14 @@ public class AAConWS implements SequenceAnnotation<AACon> {
        private static final PresetManager<AACon> aaconPresets = Util\r
                        .getPresets(AACon.class);\r
 \r
-       private static final LimitsManager<AACon> limitMan = compbio.runner.Util\r
+       private static final LimitsManager<AACon> limitMan = compbio.engine.client.Util\r
                        .getLimits(new AACon().getType());\r
 \r
        ConfiguredExecutable<AACon> init(List<FastaSequence> sequences)\r
                        throws JobSubmissionException {\r
                AACon aacon = new AACon();\r
-               aacon.setInput("fasta.in").setOutput("aacon.out");\r
+               aacon.setInput(SkeletalExecutable.INPUT).setOutput(\r
+                               SkeletalExecutable.OUTPUT);\r
                return Configurator.configureExecutable(aacon, sequences);\r
        }\r
 \r
@@ -68,12 +68,9 @@ public class AAConWS implements SequenceAnnotation<AACon> {
                AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
                ConfiguredExecutable<AACon> aacon = (ConfiguredExecutable<AACon>) asyncEngine\r
                                .getResults(jobId);\r
-               HashSet<Score> mas = aacon.getResults();\r
-               // ScoreManager result = new HashMap<String, HashSet<Score>>();\r
-               // result.put("Alignment", mas);\r
+               ScoreManager mas = aacon.getResults();\r
                log.trace(jobId + " getConservation : " + mas);\r
-               // FIXME\r
-               return null;\r
+               return mas;\r
        }\r
        /*\r
         * @SuppressWarnings("unchecked") public JalviewAnnotation\r
@@ -126,7 +123,7 @@ public class AAConWS implements SequenceAnnotation<AACon> {
                return aaconOptions;\r
        }\r
 \r
-       String analize(List<FastaSequence> sequences,\r
+       private String analize(List<FastaSequence> sequences,\r
                        ConfiguredExecutable<AACon> confExec, Logger log, String method,\r
                        Limit<AACon> limit) throws JobSubmissionException {\r
                if (limit != null && limit.isExceeded(sequences)) {\r
@@ -143,7 +140,8 @@ public class AAConWS implements SequenceAnnotation<AACon> {
        public String analize(List<FastaSequence> sequences)\r
                        throws UnsupportedRuntimeException, LimitExceededException,\r
                        JobSubmissionException {\r
-               WSUtil.validateFastaInput(sequences);\r
+\r
+               WSUtil.validateAAConInput(sequences);\r
                ConfiguredExecutable<AACon> confAAcon = init(sequences);\r
 \r
                // set default conservation method to fastest - SHENKIN\r
@@ -158,7 +156,7 @@ public class AAConWS implements SequenceAnnotation<AACon> {
                        List<Option<AACon>> options) throws UnsupportedRuntimeException,\r
                        LimitExceededException, JobSubmissionException,\r
                        WrongParameterException {\r
-               WSUtil.validateFastaInput(sequences);\r
+               WSUtil.validateAAConInput(sequences);\r
                ConfiguredExecutable<AACon> confAACon = init(sequences);\r
                // Could not do that! Space separated values\r
                // will all be treated as keys! thus duplicates removed\r
@@ -175,7 +173,7 @@ public class AAConWS implements SequenceAnnotation<AACon> {
                        Preset<AACon> preset) throws UnsupportedRuntimeException,\r
                        LimitExceededException, JobSubmissionException,\r
                        WrongParameterException {\r
-               WSUtil.validateFastaInput(sequences);\r
+               WSUtil.validateAAConInput(sequences);\r
                if (preset == null) {\r
                        throw new WrongParameterException("Preset must be provided!");\r
                }\r