Comments
[jabaws.git] / runner / compbio / runner / msa / Muscle.java
index d220d16..1d3b827 100644 (file)
@@ -29,127 +29,90 @@ import org.apache.log4j.Logger;
 \r
 import compbio.data.sequence.Alignment;\r
 import compbio.data.sequence.UnknownFileFormatException;\r
-import compbio.engine.client.Executable;\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
 public class Muscle extends SkeletalExecutable<Muscle> {\r
 \r
-    /*\r
-     * Tell JAXB to ignore this while marshalling\r
-     */\r
-    @XmlTransient\r
-    private static Logger log = Logger.getLogger(Muscle.class);\r
-\r
-    // Cache for Limits information\r
-    private static LimitsManager<Muscle> limits;\r
+       /*\r
+        * Tell JAXB to ignore this while marshalling\r
+        */\r
+       @XmlTransient\r
+       private static Logger log = Logger.getLogger(Muscle.class);\r
 \r
-    private static final String EXEC_STAT_FILE = "stat.log";\r
+       private static final String EXEC_STAT_FILE = "stat.log";\r
 \r
-    public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
+       public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
 \r
-    /**\r
-     * Default options are\r
-     * \r
-     * -clwstrict - write output in clustal format\r
-     * \r
-     * @param workDirectory\r
-     */\r
-    public Muscle() {\r
-       /*\r
-        * The –quiet command-line option disables writing progress messages to\r
-        * standard error. If the –verbose command-line option is specified, a\r
-        * progress message will be written to the log file when each iteration\r
-        * completes. So –quiet and –verbose are not contradictory."-quiet",\r
-        * "-verbose"\r
+       /**\r
+        * Default options are\r
+        * \r
+        * -clwstrict - write output in clustal format\r
+        * \r
+        * @param workDirectory\r
         */\r
-       addParameters(Arrays.asList("-clwstrict", "-quiet", "-verbose"));\r
-       cbuilder.setParam("-log", EXEC_STAT_FILE);\r
-    }\r
-\r
-    @Override\r
-    public Muscle setOutput(String outFile) {\r
-       super.setOutput(outFile);\r
-       cbuilder.setParam("-out", outFile);\r
-       return this;\r
-    }\r
-\r
-    @Override\r
-    public Muscle setInput(String inFile) {\r
-       super.setInput(inFile);\r
-       cbuilder.setParam("-in", inFile);\r
-       return this;\r
-    }\r
-\r
-    @SuppressWarnings("unchecked")\r
-    @Override\r
-    public Alignment getResults(String workDirectory)\r
-           throws ResultNotAvailableException {\r
-       try {\r
-           return Util.readClustalFile(workDirectory, getOutput());\r
-       } catch (FileNotFoundException e) {\r
-           log.error(e.getMessage(), e.getCause());\r
-           throw new ResultNotAvailableException(e);\r
-       } catch (IOException e) {\r
-           log.error(e.getMessage(), e.getCause());\r
-           throw new ResultNotAvailableException(e);\r
-       } catch (UnknownFileFormatException e) {\r
-           log.error(e.getMessage(), e.getCause());\r
-           throw new ResultNotAvailableException(e);\r
-       } catch (NullPointerException e) {\r
-           log.error(e.getMessage(), e.getCause());\r
-           throw new ResultNotAvailableException(e);\r
+       public Muscle() {\r
+               /*\r
+                * The –quiet command-line option disables writing progress messages to\r
+                * standard error. If the –verbose command-line option is specified, a\r
+                * progress message will be written to the log file when each iteration\r
+                * completes. So –quiet and –verbose are not contradictory."-quiet",\r
+                * "-verbose"\r
+                */\r
+               addParameters(Arrays.asList("-clwstrict", "-quiet", "-verbose",\r
+                               "-nocore"));\r
+               cbuilder.setParam("-log", EXEC_STAT_FILE);\r
        }\r
-    }\r
-\r
-    @Override\r
-    public List<String> getCreatedFiles() {\r
-       return Arrays.asList(getOutput(), EXEC_STAT_FILE);\r
-    }\r
 \r
-    public static String getStatFile() {\r
-       return EXEC_STAT_FILE;\r
-    }\r
-\r
-    @Override\r
-    public Limit<Muscle> getLimit(String presetName) {\r
+       @Override\r
+       public Muscle setOutput(String outFile) {\r
+               super.setOutput(outFile);\r
+               cbuilder.setParam("-out", outFile);\r
+               return this;\r
+       }\r
 \r
-       if (limits == null) {\r
-           limits = getLimits();\r
+       @Override\r
+       public Muscle setInput(String inFile) {\r
+               super.setInput(inFile);\r
+               cbuilder.setParam("-in", inFile);\r
+               return this;\r
        }\r
 \r
-       Limit<Muscle> limit = null;\r
-       if (limits != null) {\r
-           // this returns default limit if preset is undefined!\r
-           limit = limits.getLimitByName(presetName);\r
+       @SuppressWarnings("unchecked")\r
+       @Override\r
+       public Alignment getResults(String workDirectory)\r
+                       throws ResultNotAvailableException {\r
+               try {\r
+                       return Util.readClustalFile(workDirectory, getOutput());\r
+               } catch (FileNotFoundException e) {\r
+                       log.error(e.getMessage(), e.getCause());\r
+                       throw new ResultNotAvailableException(e);\r
+               } catch (IOException e) {\r
+                       log.error(e.getMessage(), e.getCause());\r
+                       throw new ResultNotAvailableException(e);\r
+               } catch (UnknownFileFormatException e) {\r
+                       log.error(e.getMessage(), e.getCause());\r
+                       throw new ResultNotAvailableException(e);\r
+               } catch (NullPointerException e) {\r
+                       log.error(e.getMessage(), e.getCause());\r
+                       throw new ResultNotAvailableException(e);\r
+               }\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
+       @Override\r
+       public List<String> getCreatedFiles() {\r
+               return Arrays.asList(getOutput(), EXEC_STAT_FILE);\r
        }\r
-       return limit;\r
-    }\r
-\r
-    @Override\r
-    public LimitsManager<Muscle> getLimits() {\r
-       // synchronise on static field\r
-       synchronized (log) {\r
-           if (limits == null) {\r
-               limits = Util.getLimits(this.getClass());\r
-           }\r
+\r
+       public static String getStatFile() {\r
+               return EXEC_STAT_FILE;\r
        }\r
-       return limits;\r
-    }\r
 \r
-    @Override\r
-    public Class<? extends Executable<?>> getType() {\r
-       return this.getClass();\r
-    }\r
+       @SuppressWarnings("unchecked")\r
+       @Override\r
+       public Class<Muscle> getType() {\r
+               return (Class<Muscle>) this.getClass();\r
+       }\r
 \r
 }\r