Jronn tester
[jabaws.git] / runner / compbio / runner / disorder / Jronn.java
index 0c4245a..1b9037e 100644 (file)
@@ -48,117 +48,117 @@ import compbio.runner.Util;
  */\r
 public class Jronn extends SkeletalExecutable<Jronn> {\r
 \r
-    private static Logger log = Logger.getLogger(Jronn.class);\r
-\r
-    // Cache for Limits information\r
-    private static LimitsManager<Jronn> limits;\r
-\r
-    public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
-    public static final String STAT_FILE = "stat.txt";\r
-\r
-    public Jronn() {\r
-       addParameters(Arrays.asList("-jar", getLibPath(), "-n=1", "-s="\r
-               + STAT_FILE, "-f=H"));\r
-    }\r
-\r
-    @SuppressWarnings("unchecked")\r
-    @Override\r
-    public List<AnnotatedSequence> getResults(String workDirectory)\r
-           throws ResultNotAvailableException {\r
-       List<AnnotatedSequence> sequences = null;\r
-       try {\r
-           InputStream inStream = new FileInputStream(new File(workDirectory,\r
-                   getOutput()));\r
-           sequences = SequenceUtil.readJRonn(inStream);\r
-           inStream.close();\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
+       private static Logger log = Logger.getLogger(Jronn.class);\r
+\r
+       // Cache for Limits information\r
+       private static LimitsManager<Jronn> limits;\r
+\r
+       public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
+       public static final String STAT_FILE = "stat.txt";\r
+\r
+       public Jronn() {\r
+               addParameters(Arrays.asList("-jar", getLibPath(), "-n=1", "-s="\r
+                               + STAT_FILE, "-f=H"));\r
        }\r
-       return sequences;\r
-    }\r
 \r
-    private static String getLibPath() {\r
+       @SuppressWarnings("unchecked")\r
+       @Override\r
+       public List<AnnotatedSequence> getResults(String workDirectory)\r
+       throws ResultNotAvailableException {\r
+               List<AnnotatedSequence> sequences = null;\r
+               try {\r
+                       InputStream inStream = new FileInputStream(new File(workDirectory,\r
+                                       getOutput()));\r
+                       sequences = SequenceUtil.readJRonn(inStream);\r
+                       inStream.close();\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
+               return sequences;\r
+       }\r
 \r
-       String settings = ph.getProperty("jronn.jar.file");\r
-       if (compbio.util.Util.isEmpty(settings)) {\r
-           throw new NullPointerException(\r
-                   "Please define jronn.jar.file property in Executable.properties file"\r
-                           + "and initialize it with the location of jronn jar file");\r
+       private static String getLibPath() {\r
+\r
+               String settings = ph.getProperty("jronn.jar.file");\r
+               if (compbio.util.Util.isEmpty(settings)) {\r
+                       throw new NullPointerException(\r
+                                       "Please define jronn.jar.file property in Executable.properties file"\r
+                                       + "and initialize it with the location of jronn jar file");\r
+               }\r
+               if (new File(settings).isAbsolute()) {\r
+                       // Jronn jar can be found so no actions necessary\r
+                       // no further actions is necessary\r
+                       return settings;\r
+               }\r
+               return compbio.engine.client.Util.convertToAbsolute(settings);\r
        }\r
-       if (new File(settings).isAbsolute()) {\r
-           // Jronn jar can be found so no actions necessary\r
-           // no further actions is necessary\r
-           return settings;\r
+\r
+       @Override\r
+       public List<String> getCreatedFiles() {\r
+               return Arrays.asList(getOutput(), getError());\r
        }\r
-       return compbio.engine.client.Util.convertToAbsolute(settings);\r
-    }\r
-\r
-    @Override\r
-    public List<String> getCreatedFiles() {\r
-       return Arrays.asList(getOutput(), getError());\r
-    }\r
-\r
-    @Override\r
-    public Jronn setInput(String inFile) {\r
-       super.setInput(inFile);\r
-       cbuilder.setParam("-i=" + inFile);\r
-       return this;\r
-    }\r
-\r
-    @Override\r
-    public Jronn setOutput(String outFile) {\r
-       super.setOutput(outFile);\r
-       cbuilder.setParam("-o=" + outFile);\r
-       return this;\r
-    }\r
-\r
-    @Override\r
-    public Limit<Jronn> getLimit(String presetName) {\r
-       if (limits == null) {\r
-           limits = getLimits();\r
+\r
+       @Override\r
+       public Jronn setInput(String inFile) {\r
+               super.setInput(inFile);\r
+               cbuilder.setParam("-i=" + inFile);\r
+               return this;\r
        }\r
-       Limit<Jronn> limit = null;\r
-       if (limits != null) {\r
-           // this returns default limit if preset is undefined!\r
-           limit = limits.getLimitByName(presetName);\r
+\r
+       @Override\r
+       public Jronn setOutput(String outFile) {\r
+               super.setOutput(outFile);\r
+               cbuilder.setParam("-o=" + outFile);\r
+               return this;\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 Limit<Jronn> getLimit(String presetName) {\r
+               if (limits == null) {\r
+                       limits = getLimits();\r
+               }\r
+               Limit<Jronn> 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
-       return limit;\r
-    }\r
-\r
-    @Override\r
-    public LimitsManager<Jronn> getLimits() {\r
-       // synchronise on static field\r
-       synchronized (log) {\r
-           if (limits == null) {\r
-               limits = Util.getLimits(this.getClass());\r
-           }\r
+\r
+       @Override\r
+       public LimitsManager<Jronn> 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
-       return limits;\r
-    }\r
 \r
-    @Override\r
-    public Class<? extends Executable<?>> getType() {\r
-       return this.getClass();\r
-    }\r
+       @Override\r
+       public Class<? extends Executable<?>> getType() {\r
+               return this.getClass();\r
+       }\r
 \r
-    public static String getStatFile() {\r
-       return STAT_FILE;\r
-    }\r
+       public static String getStatFile() {\r
+               return STAT_FILE;\r
+       }\r
 }\r