JWS-86 made few changes to text, plus couple of links were faulty so changed ClustalW...
[jabaws.git] / runner / compbio / runner / disorder / Jronn.java
index 3f668e3..b123996 100644 (file)
@@ -1,6 +1,6 @@
-/* Copyright (c) 2009 Peter Troshin\r
+/* Copyright (c) 2011 Peter Troshin\r
  *  \r
- *  JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0     \r
+ *  JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0     \r
  * \r
  *  This library is free software; you can redistribute it and/or modify it under the terms of the\r
  *  Apache License version 2 as published by the Apache Software Foundation\r
@@ -35,7 +35,7 @@ import compbio.engine.client.CommandBuilder;
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.engine.client.EngineUtil;\r
 \r
 /**\r
  * Command line\r
@@ -49,20 +49,18 @@ public class Jronn extends SkeletalExecutable<Jronn> {
 \r
        private static Logger log = Logger.getLogger(Jronn.class);\r
 \r
-       /**\r
-        * Number of cores to use, defaults to 1 for local execution or the value of\r
-        * "jronn.cluster.cpunum" property for cluster execution\r
-        */\r
+/*\r
+ * Number of cores to use, defaults to 1 for local execution or the value of\r
+ * "jronn.cluster.cpunum" property for cluster execution\r
+ */\r
        private int ncoreNumber = 0;\r
 \r
        private final String ncorePrm = "-n=";\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(), "-s=" + STAT_FILE,\r
-                               "-f=H"));\r
+               addParameters(Arrays.asList("-jar", getLibPath(), "-s=" + STAT_FILE, "-f=H"));\r
        }\r
 \r
        @SuppressWarnings("unchecked")\r
@@ -71,10 +69,8 @@ public class Jronn extends SkeletalExecutable<Jronn> {
                        throws ResultNotAvailableException {\r
                ScoreManager sequences = null;\r
                try {\r
-                       InputStream inStream = new FileInputStream(new File(workDirectory,\r
-                                       getOutput()));\r
-                       sequences = ScoreManager.newInstanceSingleScore(SequenceUtil\r
-                                       .readJRonn(inStream));\r
+                       InputStream inStream = new FileInputStream(new File(workDirectory, getOutput()));\r
+                       sequences = ScoreManager.newInstanceSingleScore(SequenceUtil.readJRonn(inStream));\r
                        inStream.close();\r
                } catch (FileNotFoundException e) {\r
                        log.error(e.getMessage(), e.getCause());\r
@@ -93,19 +89,17 @@ public class Jronn extends SkeletalExecutable<Jronn> {
        }\r
 \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
+                       "Please define jronn.jar.file property in Executable.properties file 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
+               return EngineUtil.convertToAbsolute(settings);\r
        }\r
 \r
        @Override\r
@@ -129,8 +123,8 @@ public class Jronn extends SkeletalExecutable<Jronn> {
 \r
        @SuppressWarnings("unchecked")\r
        @Override\r
-       public Class<Executable<Jronn>> getType() {\r
-               return (Class<Executable<Jronn>>) this.getClass();\r
+       public Class<Jronn> getType() {\r
+               return (Class<Jronn>) this.getClass();\r
        }\r
 \r
        public static String getStatFile() {\r
@@ -152,8 +146,7 @@ public class Jronn extends SkeletalExecutable<Jronn> {
 \r
        @Override\r
        public CommandBuilder<Jronn> getParameters(ExecProvider provider) {\r
-               // If number of cores is provided, set it for the cluster execution\r
-               // only!\r
+               // If number of cores is provided, set it for the cluster execution only!\r
                if (provider == Executable.ExecProvider.Cluster) {\r
                        int cpunum = SkeletalExecutable.getClusterCpuNum(getType());\r
                        cpunum = (cpunum == 0) ? 1 : cpunum;\r