Clustal Omega web service wrapper and tester
[jabaws.git] / runner / compbio / runner / disorder / GlobPlot.java
index 6decede..6530f5f 100644 (file)
@@ -19,19 +19,14 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;\r
 import java.io.IOException;\r
 import java.io.InputStream;\r
-import java.util.Map;\r
-import java.util.Set;\r
 \r
 import org.apache.log4j.Logger;\r
 \r
-import compbio.data.sequence.Score;\r
+import compbio.data.sequence.ScoreManager;\r
 import compbio.data.sequence.SequenceUtil;\r
 import compbio.data.sequence.UnknownFileFormatException;\r
-import compbio.engine.client.Executable;\r
 import compbio.engine.client.PipedExecutable;\r
 import compbio.engine.client.SkeletalExecutable;\r
-import compbio.metadata.Limit;\r
-import compbio.metadata.LimitsManager;\r
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.runner.Util;\r
 \r
@@ -57,9 +52,6 @@ public class GlobPlot extends SkeletalExecutable<GlobPlot>
 \r
        private static Logger log = Logger.getLogger(GlobPlot.class);\r
 \r
-       // Cache for Limits information\r
-       private static LimitsManager<GlobPlot> limits;\r
-\r
        public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
 \r
        /* The parameter list there must not contain same values! */\r
@@ -69,17 +61,18 @@ public class GlobPlot extends SkeletalExecutable<GlobPlot>
                // super.setInput("");\r
        }\r
 \r
+       @Override\r
        @SuppressWarnings("unchecked")\r
-       public Map<String, Set<Score>> getResults(String workDirectory)\r
+       public ScoreManager getResults(String workDirectory)\r
                        throws ResultNotAvailableException {\r
 \r
                InputStream inStream = null;\r
-               Map<String, Set<Score>> results = null;\r
+               ScoreManager results = null;\r
                // How about getting ranges?\r
                try {\r
                        inStream = new FileInputStream(new File(workDirectory, getOutput()));\r
-                       results = SequenceUtil.removeSequences(SequenceUtil\r
-                                       .readDisembl(inStream));\r
+                       results = ScoreManager.newInstance(SequenceUtil\r
+                                       .readGlobPlot(inStream));\r
                        inStream.close();\r
                } catch (FileNotFoundException e) {\r
                        log.error(e.getMessage(), e.getCause());\r
@@ -105,41 +98,10 @@ public class GlobPlot extends SkeletalExecutable<GlobPlot>
                return this;\r
        }\r
 \r
+       @SuppressWarnings("unchecked")\r
        @Override\r
-       public Limit<GlobPlot> getLimit(String presetName) {\r
-               if (limits == null) {\r
-                       limits = getLimits();\r
-               }\r
-\r
-               Limit<GlobPlot> limit = null;\r
-               if (limits != null) {\r
-                       // this returns default limit if preset is undefined!\r
-                       limit = limits.getLimitByName(presetName);\r
-               }\r
-               // If limit is not defined for a particular preset, then return default\r
-               // limit\r
-               if (limit == null) {\r
-                       log.debug("Limit for the preset " + presetName\r
-                                       + " is not found. Using default");\r
-                       limit = limits.getDefaultLimit();\r
-               }\r
-               return limit;\r
-       }\r
-\r
-       @Override\r
-       public LimitsManager<GlobPlot> getLimits() {\r
-               // synchronise on static field\r
-               synchronized (log) {\r
-                       if (limits == null) {\r
-                               limits = Util.getLimits(this.getClass());\r
-                       }\r
-               }\r
-               return limits;\r
-       }\r
-\r
-       @Override\r
-       public Class<? extends Executable<?>> getType() {\r
-               return this.getClass();\r
+       public Class<GlobPlot> getType() {\r
+               return (Class<GlobPlot>) this.getClass();\r
        }\r
 \r
 }\r