Fix probem with metadata
authorSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Tue, 17 Sep 2013 14:20:15 +0000 (15:20 +0100)
committerSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Tue, 17 Sep 2013 14:20:15 +0000 (15:20 +0100)
datamodel/compbio/data/sequence/Program.java
webservices/compbio/ws/server/ClustalOWS.java
webservices/compbio/ws/server/ClustalWS.java
webservices/compbio/ws/server/JpredWS.java
webservices/compbio/ws/server/MafftWS.java
webservices/compbio/ws/server/MuscleWS.java
webservices/compbio/ws/server/ProbconsWS.java
webservices/compbio/ws/server/TcoffeeWS.java

index e5f4e76..0a234a3 100644 (file)
@@ -32,14 +32,18 @@ public enum Program {
        CLUSTAL,\r
 \r
        /**\r
+        * ClustalO\r
+        */\r
+       ClustalO,\r
+       /**\r
         * Mafft\r
         */\r
-       MAFFT,\r
+       Mafft,\r
 \r
        /**\r
         * Muscle\r
         */\r
-       MUSCLE,\r
+       Muscle,\r
 \r
        /**\r
         * Tcoffee\r
index 898b3ad..2681364 100644 (file)
@@ -29,6 +29,7 @@ import compbio.data.msa.JABAService;
 import compbio.data.msa.MsaWS;\r
 import compbio.data.sequence.Alignment;\r
 import compbio.data.sequence.FastaSequence;\r
+import compbio.data.sequence.Program;\r
 import compbio.engine.AsyncExecutor;\r
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
@@ -53,19 +54,15 @@ public class ClustalOWS implements MsaWS<ClustalO> {
 \r
        private static Logger log = Logger.getLogger(ClustalOWS.class);\r
 \r
-       private static final RunnerConfig<ClustalO> clustalOptions = Util\r
-                       .getSupportedOptions(ClustalO.class);\r
+       private static final RunnerConfig<ClustalO> clustalOptions = Util.getSupportedOptions(ClustalO.class);\r
 \r
-       private static final PresetManager<ClustalO> clustalPresets = Util\r
-                       .getPresets(ClustalO.class);\r
+       private static final PresetManager<ClustalO> clustalPresets = Util.getPresets(ClustalO.class);\r
 \r
-       private static final LimitsManager<ClustalO> limitMan = compbio.engine.client.Util\r
-                       .getLimits(new ClustalO().getType());\r
+       private static final LimitsManager<ClustalO> limitMan = compbio.engine.client.Util.getLimits(new ClustalO().getType());\r
 \r
        @Override\r
        public String align(List<FastaSequence> sequences)\r
                        throws JobSubmissionException {\r
-\r
                WSUtil.validateFastaInput(sequences);\r
                ConfiguredExecutable<ClustalO> confClust = init(sequences);\r
                return WSUtil.align(sequences, confClust, log, "align", getLimit(""));\r
@@ -74,20 +71,17 @@ public class ClustalOWS implements MsaWS<ClustalO> {
        ConfiguredExecutable<ClustalO> init(List<FastaSequence> dataSet)\r
                        throws JobSubmissionException {\r
                ClustalO clustal = new ClustalO();\r
-               clustal.setInput(SkeletalExecutable.INPUT)\r
-                               .setOutput(SkeletalExecutable.OUTPUT)\r
-                               .setError(SkeletalExecutable.ERROR);\r
-               ConfiguredExecutable<ClustalO> confClust = Configurator\r
-                               .configureExecutable(clustal, dataSet);\r
+               clustal.setInput(SkeletalExecutable.INPUT);\r
+               clustal.setOutput(SkeletalExecutable.OUTPUT);\r
+               clustal.setError(SkeletalExecutable.ERROR);\r
+               ConfiguredExecutable<ClustalO> confClust = Configurator.configureExecutable(clustal, dataSet);\r
                // Set the number of threads for the cluster execution from conf file\r
                if (confClust.getExecProvider() == Executable.ExecProvider.Cluster) {\r
-                       int clusterCpuNum = SkeletalExecutable.getClusterCpuNum(clustal\r
-                                       .getType());\r
+                       int clusterCpuNum = SkeletalExecutable.getClusterCpuNum(clustal.getType());\r
                        if (clusterCpuNum != 0) {\r
                                clustal.setNCore(clusterCpuNum);\r
                        }\r
                }\r
-\r
                return confClust;\r
        }\r
 \r
@@ -111,12 +105,10 @@ public class ClustalOWS implements MsaWS<ClustalO> {
                        WrongParameterException {\r
                WSUtil.validateFastaInput(sequences);\r
                ConfiguredExecutable<ClustalO> confClust = init(sequences);\r
-               List<String> params = WSUtil.getCommands(options,\r
-                               ClustalO.KEY_VALUE_SEPARATOR);\r
+               List<String> params = WSUtil.getCommands(options, ClustalO.KEY_VALUE_SEPARATOR);\r
                confClust.addParameters(params);\r
                log.info("Setting parameters: " + params);\r
-               return WSUtil.align(sequences, confClust, log, "customAlign",\r
-                               getLimit(""));\r
+               return WSUtil.align(sequences, confClust, log, "customAlign", getLimit(""));\r
        }\r
 \r
        @Override\r
@@ -127,14 +119,11 @@ public class ClustalOWS implements MsaWS<ClustalO> {
        @SuppressWarnings("unchecked")\r
        @Override\r
        public Alignment getResult(String jobId) throws ResultNotAvailableException {\r
-\r
                WSUtil.validateJobId(jobId);\r
                AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
-               ConfiguredExecutable<ClustalO> clustal = (ConfiguredExecutable<ClustalO>) asyncEngine\r
-                               .getResults(jobId);\r
+               ConfiguredExecutable<ClustalO> clustal = (ConfiguredExecutable<ClustalO>) asyncEngine.getResults(jobId);\r
                Alignment al = clustal.getResults();\r
-\r
-               return al;\r
+               return new Alignment (al.getSequences(),Program.ClustalO, '-');\r
        }\r
 \r
        @Override\r
@@ -173,10 +162,8 @@ public class ClustalOWS implements MsaWS<ClustalO> {
 \r
        @Override\r
        public ChunkHolder pullExecStatistics(String jobId, long position) {\r
-\r
                WSUtil.validateJobId(jobId);\r
-               String file = Configurator.getWorkDirectory(jobId) + File.separator\r
-                               + ClustalO.getStatFile();\r
+               String file = Configurator.getWorkDirectory(jobId) + File.separator + ClustalO.getStatFile();\r
                ChunkHolder cholder = WSUtil.pullFile(file, position);\r
                return cholder;\r
        }\r
index 3ba7d62..ce12c6a 100644 (file)
@@ -29,6 +29,7 @@ import compbio.data.msa.JABAService;
 import compbio.data.msa.MsaWS;\r
 import compbio.data.sequence.Alignment;\r
 import compbio.data.sequence.FastaSequence;\r
+import compbio.data.sequence.Program;\r
 import compbio.engine.AsyncExecutor;\r
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
@@ -52,14 +53,11 @@ public class ClustalWS implements MsaWS<ClustalW> {
 \r
        private static Logger log = Logger.getLogger(ClustalWS.class);\r
 \r
-       private static final RunnerConfig<ClustalW> clustalOptions = Util\r
-                       .getSupportedOptions(ClustalW.class);\r
+       private static final RunnerConfig<ClustalW> clustalOptions = Util.getSupportedOptions(ClustalW.class);\r
 \r
-       private static final PresetManager<ClustalW> clustalPresets = Util\r
-                       .getPresets(ClustalW.class);\r
+       private static final PresetManager<ClustalW> clustalPresets = Util.getPresets(ClustalW.class);\r
 \r
-       private static final LimitsManager<ClustalW> limitMan = compbio.engine.client.Util\r
-                       .getLimits(new ClustalW().getType());\r
+       private static final LimitsManager<ClustalW> limitMan = compbio.engine.client.Util.getLimits(new ClustalW().getType());\r
 \r
        @Override\r
        public String align(List<FastaSequence> sequences)\r
@@ -73,11 +71,10 @@ public class ClustalWS implements MsaWS<ClustalW> {
        ConfiguredExecutable<ClustalW> init(List<FastaSequence> dataSet)\r
                        throws JobSubmissionException {\r
                ClustalW clustal = new ClustalW();\r
-               clustal.setInput(SkeletalExecutable.INPUT)\r
-                               .setOutput(SkeletalExecutable.OUTPUT)\r
-                               .setError(SkeletalExecutable.ERROR);\r
-               ConfiguredExecutable<ClustalW> confClust = Configurator\r
-                               .configureExecutable(clustal, dataSet);\r
+               clustal.setInput(SkeletalExecutable.INPUT);\r
+               clustal.setOutput(SkeletalExecutable.OUTPUT);\r
+               clustal.setError(SkeletalExecutable.ERROR);\r
+               ConfiguredExecutable<ClustalW> confClust = Configurator.configureExecutable(clustal, dataSet);\r
                return confClust;\r
        }\r
 \r
@@ -101,12 +98,10 @@ public class ClustalWS implements MsaWS<ClustalW> {
                        WrongParameterException {\r
                WSUtil.validateFastaInput(sequences);\r
                ConfiguredExecutable<ClustalW> confClust = init(sequences);\r
-               List<String> params = WSUtil.getCommands(options,\r
-                               ClustalW.KEY_VALUE_SEPARATOR);\r
+               List<String> params = WSUtil.getCommands(options, ClustalW.KEY_VALUE_SEPARATOR);\r
                confClust.addParameters(params);\r
                log.info("Setting parameters: " + params);\r
-               return WSUtil.align(sequences, confClust, log, "customAlign",\r
-                               getLimit(""));\r
+               return WSUtil.align(sequences, confClust, log, "customAlign", getLimit(""));\r
        }\r
 \r
        @Override\r
@@ -117,14 +112,11 @@ public class ClustalWS implements MsaWS<ClustalW> {
        @SuppressWarnings("unchecked")\r
        @Override\r
        public Alignment getResult(String jobId) throws ResultNotAvailableException {\r
-\r
                WSUtil.validateJobId(jobId);\r
                AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
-               ConfiguredExecutable<ClustalW> clustal = (ConfiguredExecutable<ClustalW>) asyncEngine\r
-                               .getResults(jobId);\r
+               ConfiguredExecutable<ClustalW> clustal = (ConfiguredExecutable<ClustalW>) asyncEngine.getResults(jobId);\r
                Alignment al = clustal.getResults();\r
-\r
-               return al;\r
+               return new Alignment (al.getSequences(), Program.CLUSTAL, '-');\r
        }\r
 \r
        @Override\r
@@ -163,10 +155,8 @@ public class ClustalWS implements MsaWS<ClustalW> {
 \r
        @Override\r
        public ChunkHolder pullExecStatistics(String jobId, long position) {\r
-\r
                WSUtil.validateJobId(jobId);\r
-               String file = Configurator.getWorkDirectory(jobId) + File.separator\r
-                               + ClustalW.getStatFile();\r
+               String file = Configurator.getWorkDirectory(jobId) + File.separator + ClustalW.getStatFile();\r
                ChunkHolder cholder = WSUtil.pullFile(file, position);\r
                return cholder;\r
        }\r
index b23a64b..18be1b8 100644 (file)
@@ -61,7 +61,6 @@ public class JpredWS implements MsaWS<Jpred> {
        @Override\r
        public String align(List<FastaSequence> sequences)\r
                        throws JobSubmissionException {\r
-\r
                WSUtil.validateFastaInput(sequences);\r
                ConfiguredExecutable<Jpred> confClust = init(sequences);\r
                return WSUtil.align(sequences, confClust, log, "align", getLimit(""));\r
index f293ae7..5ee6872 100644 (file)
@@ -29,6 +29,7 @@ import compbio.data.msa.JABAService;
 import compbio.data.msa.MsaWS;\r
 import compbio.data.sequence.Alignment;\r
 import compbio.data.sequence.FastaSequence;\r
+import compbio.data.sequence.Program;\r
 import compbio.engine.AsyncExecutor;\r
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
@@ -72,9 +73,9 @@ public class MafftWS implements MsaWS<Mafft> {
        ConfiguredExecutable<Mafft> init(List<FastaSequence> dataSet)\r
                        throws JobSubmissionException {\r
                Mafft mafft = new Mafft();\r
-               mafft.setInput(SkeletalExecutable.INPUT)\r
-                               .setOutput(SkeletalExecutable.OUTPUT)\r
-                               .setError(SkeletalExecutable.ERROR);\r
+               mafft.setInput(SkeletalExecutable.INPUT);\r
+               mafft.setOutput(SkeletalExecutable.OUTPUT);\r
+               mafft.setError(SkeletalExecutable.ERROR);\r
                return Configurator.configureExecutable(mafft, dataSet);\r
        }\r
 \r
@@ -84,12 +85,10 @@ public class MafftWS implements MsaWS<Mafft> {
                        WrongParameterException {\r
                WSUtil.validateFastaInput(sequences);\r
                ConfiguredExecutable<Mafft> confMafft = init(sequences);\r
-               List<String> params = WSUtil.getCommands(options,\r
-                               Mafft.KEY_VALUE_SEPARATOR);\r
+               List<String> params = WSUtil.getCommands(options, Mafft.KEY_VALUE_SEPARATOR);\r
                log.info("Setting parameters: " + params);\r
                confMafft.addParameters(params);\r
-               return WSUtil.align(sequences, confMafft, log, "customAlign",\r
-                               getLimit(""));\r
+               return WSUtil.align(sequences, confMafft, log, "customAlign", getLimit(""));\r
        }\r
 \r
        @Override\r
@@ -117,8 +116,7 @@ public class MafftWS implements MsaWS<Mafft> {
                ConfiguredExecutable<Mafft> mafft = (ConfiguredExecutable<Mafft>) asyncEngine\r
                                .getResults(jobId);\r
                Alignment al = mafft.getResults();\r
-               // log(jobId, "getResults");\r
-               return al;\r
+               return new Alignment (al.getSequences(), Program.Mafft, '-');\r
        }\r
 \r
        @Override\r
index a9d6c52..1937a68 100644 (file)
@@ -29,6 +29,7 @@ import compbio.data.msa.JABAService;
 import compbio.data.msa.MsaWS;\r
 import compbio.data.sequence.Alignment;\r
 import compbio.data.sequence.FastaSequence;\r
+import compbio.data.sequence.Program;\r
 import compbio.engine.AsyncExecutor;\r
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
@@ -116,8 +117,7 @@ public class MuscleWS implements MsaWS<Muscle> {
                ConfiguredExecutable<Muscle> muscle = (ConfiguredExecutable<Muscle>) asyncEngine\r
                                .getResults(jobId);\r
                Alignment al = muscle.getResults();\r
-               // log(jobId, "getResults");\r
-               return al;\r
+               return new Alignment (al.getSequences(),Program.Muscle, '-');\r
        }\r
 \r
        @Override\r
index d4fa3df..087afc6 100644 (file)
@@ -29,6 +29,7 @@ import compbio.data.msa.JABAService;
 import compbio.data.msa.MsaWS;\r
 import compbio.data.sequence.Alignment;\r
 import compbio.data.sequence.FastaSequence;\r
+import compbio.data.sequence.Program;\r
 import compbio.engine.AsyncExecutor;\r
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
@@ -105,8 +106,7 @@ public class ProbconsWS implements MsaWS<Probcons> {
                AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
                ConfiguredExecutable<Probcons> probcons = (ConfiguredExecutable<Probcons>) asyncEngine.getResults(jobId);\r
                Alignment al = probcons.getResults();\r
-               // log(jobId, "getResults");\r
-               return al;\r
+               return new Alignment (al.getSequences(), Program.Probcons, '-');\r
        }\r
 \r
        @Override\r
index 086d870..72291dc 100644 (file)
@@ -29,6 +29,7 @@ import compbio.data.msa.JABAService;
 import compbio.data.msa.MsaWS;\r
 import compbio.data.sequence.Alignment;\r
 import compbio.data.sequence.FastaSequence;\r
+import compbio.data.sequence.Program;\r
 import compbio.engine.AsyncExecutor;\r
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
@@ -53,14 +54,11 @@ public class TcoffeeWS implements MsaWS<Tcoffee> {
 \r
        private static Logger log = Logger.getLogger(TcoffeeWS.class);\r
 \r
-       private static final RunnerConfig<Tcoffee> tcoffeeOptions = Util\r
-                       .getSupportedOptions(Tcoffee.class);\r
+       private static final RunnerConfig<Tcoffee> tcoffeeOptions = Util.getSupportedOptions(Tcoffee.class);\r
 \r
-       private static final PresetManager<Tcoffee> tcoffeePresets = Util\r
-                       .getPresets(Tcoffee.class);\r
+       private static final PresetManager<Tcoffee> tcoffeePresets = Util.getPresets(Tcoffee.class);\r
 \r
-       private static final LimitsManager<Tcoffee> limitMan = compbio.engine.client.Util\r
-                       .getLimits(new Tcoffee().getType());\r
+       private static final LimitsManager<Tcoffee> limitMan = compbio.engine.client.Util.getLimits(new Tcoffee().getType());\r
 \r
        @Override\r
        public String align(List<FastaSequence> sequences)\r
@@ -96,12 +94,10 @@ public class TcoffeeWS implements MsaWS<Tcoffee> {
 \r
                WSUtil.validateFastaInput(sequences);\r
                ConfiguredExecutable<Tcoffee> confTcoffee = init(sequences);\r
-               List<String> params = WSUtil.getCommands(options,\r
-                               Tcoffee.KEY_VALUE_SEPARATOR);\r
+               List<String> params = WSUtil.getCommands(options, Tcoffee.KEY_VALUE_SEPARATOR);\r
                log.info("Setting parameters:" + params);\r
                confTcoffee.addParameters(params);\r
-               return WSUtil.align(sequences, confTcoffee, log, "customAlign",\r
-                               getLimit(""));\r
+               return WSUtil.align(sequences, confTcoffee, log, "customAlign", getLimit(""));\r
        }\r
 \r
        @Override\r
@@ -126,8 +122,7 @@ public class TcoffeeWS implements MsaWS<Tcoffee> {
                ConfiguredExecutable<Tcoffee> tcoffee = (ConfiguredExecutable<Tcoffee>) asyncEngine\r
                                .getResults(jobId);\r
                Alignment al = tcoffee.getResults();\r
-               // log(jobId, "getResults");\r
-               return al;\r
+               return new Alignment (al.getSequences(), Program.Tcoffee, '-');\r
        }\r
 \r
        @Override\r