\r
public abstract class SkeletalExecutable<T> implements Executable<T> {\r
\r
- protected static final PropertyHelper ph = PropertyHelperManager\r
- .getPropertyHelper();\r
+ protected static final PropertyHelper ph = PropertyHelperManager.getPropertyHelper();\r
\r
private static Logger log = Logger.getLogger(SkeletalExecutable.class);\r
\r
}\r
\r
public SkeletalExecutable<T> setOutput(String outFile) {\r
- if (compbio.util.Util.isEmpty(outFile)\r
- || PathValidator.isAbsolutePath(outFile)) {\r
- throw new IllegalArgumentException(\r
- "Output file must not be NULL and Absolute path could not be used! Please provide the filename only. Value provided: "\r
- + outFile);\r
+ if (compbio.util.Util.isEmpty(outFile) || PathValidator.isAbsolutePath(outFile)) {\r
+ throw new IllegalArgumentException("Output file must not be NULL and Absolute path could not be used! Please provide the filename only. Value provided: " + outFile);\r
}\r
this.outputFile = outFile;\r
this.isOutputSet = true;\r
}\r
\r
public SkeletalExecutable<T> setError(String errFile) {\r
- if (compbio.util.Util.isEmpty(errFile)\r
- || PathValidator.isAbsolutePath(errFile)) {\r
- throw new IllegalArgumentException(\r
- "Error file must not be NULL and Absolute path could not be used! Please provide the filename only. Value provided: "\r
- + errFile);\r
+ if (compbio.util.Util.isEmpty(errFile) || PathValidator.isAbsolutePath(errFile)) {\r
+ throw new IllegalArgumentException("Error file must not be NULL and Absolute path could not be used! Please provide the filename only. Value provided: " + errFile);\r
}\r
this.errorFile = errFile;\r
this.isErrorSet = true;\r
// necessary\r
continue;\r
}\r
- String absMatrixPath = compbio.engine.client.Util\r
- .convertToAbsolute(propertyPath);\r
+ String absMatrixPath = compbio.engine.client.Util.convertToAbsolute(propertyPath);\r
command.value = absMatrixPath + File.separator + command.value;\r
cbuilder.setParam(command);\r
}\r
\r
@Override\r
public String getClusterJobSettings() {\r
- String settings = ph.getProperty(getType().getSimpleName()\r
- .toLowerCase() + ".cluster.settings");\r
+ String settings = ph.getProperty(getType().getSimpleName().toLowerCase() + ".cluster.settings");\r
return settings == null ? "" : settings;\r
}\r
\r
/**\r
- * \r
- * @return number of cpus to use on the cluster or 0 if the value is\r
- * undefined\r
+ * @return number of cpus to use on the cluster or 0 if the value is undefined\r
*/\r
public static int getClusterCpuNum(Class<? extends Executable<?>> type) {\r
int cpus = 0;\r
- String cpuNum = ph.getProperty(type.getSimpleName().toLowerCase()\r
- + ".cluster.cpunum");\r
+ String cpuNum = ph.getProperty(type.getSimpleName().toLowerCase() + ".cluster.cpunum");\r
if (compbio.util.Util.isEmpty(cpuNum)) {\r
return 0;\r
}\r
cpus = Integer.parseInt(cpuNum);\r
} catch (NumberFormatException e) {\r
// safe to ignore\r
- log.debug("Number of cpus to use for cluster execution is defined but could not be parsed as integer! Given value is: "\r
- + cpuNum);\r
+ log.debug("Number of cpus to use for cluster execution is defined but could not be parsed as integer! Given value is: " + cpuNum);\r
return 0;\r
}\r
if (cpus < 1 || cpus > 100) {\r
- throw new InvalidParameterException(\r
- "Number of cpu for cluster execution must be within 1 and 100! "\r
- + "Look at the value of 'tcoffee.cluster.cpunum' property. Given value is "\r
- + cpus);\r
+ throw new InvalidParameterException("Number of cpu for cluster execution must be within 1 and 100! "\r
+ + "Look at the value of 'tcoffee.cluster.cpunum' property. Given value is " + cpus);\r
}\r
return cpus;\r
}\r
}\r
\r
/**\r
- * \r
* @return subclasses must return their type\r
*/\r
public abstract Class<T> getType();\r
-\r
}\r
f = f.getParentFile();\r
}\r
} catch (URISyntaxException e) {\r
- String message = "Could not find resources path! Problems locating PropertyHelperManager class! " + e.getLocalizedMessage();\r
- log.error(message, e.getCause());\r
- throw new RuntimeException(message, e.getCause());\r
+ String mes = "Could not find resources path! Problems locating PropertyHelperManager class! ";\r
+ log.error(mes + e.getLocalizedMessage(), e.getCause());\r
+ throw new RuntimeException(mes + e.getLocalizedMessage(), e.getCause());\r
} catch (IllegalArgumentException e) {\r
// Classes are in the jar file, using different method to determine\r
// the path new File(INCORRECT URL) throws it\r
- log.debug(\r
- "It looks like classes are in the jar file. "\r
- + "Attempting a different method to determinine the path to the resources "\r
- + e.getLocalizedMessage(), e.getCause());\r
+ String mes = "It looks like classes are in the jar file. " \r
+ + "Attempting a different method to determinine the path to the resources";\r
+ log.debug(mes + e.getLocalizedMessage(), e.getCause());\r
try {\r
- f = new File(PropertyHelperManager.class.getProtectionDomain()\r
- .getCodeSource().getLocation().toURI().getPath());\r
+ f = new File(PropertyHelperManager.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());\r
\r
// Iterate up the hierarchy to find a root project directory\r
// This time there is not need to walk up all class packages\r
\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
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
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
\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
* @author pvtroshin\r
*\r
*/\r
-public class Mafft extends SkeletalExecutable<Mafft>\r
- implements\r
- PipedExecutable<Mafft> {\r
- /*\r
- * TODO get rid of piping: Mafft now supports --out option for output file. \r
- * Multi-threading supported with e.g. "thread 4" only for Linux, so JABAWS \r
- * will not support it for now, it also need editing of mafft makefile \r
- */\r
- \r
- \r
+public class Mafft extends SkeletalExecutable<Mafft> implements PipedExecutable<Mafft> {\r
+/*\r
+ * TODO get rid of piping: Mafft now supports --out option for output file. \r
+ * Multi-threading supported with e.g. "thread 4" only for Linux, so JABAWS \r
+ * will not support it for now, it also need editing of mafft makefile \r
+ */\r
+\r
private static Logger log = Logger.getLogger(Mafft.class);\r
\r
private static String autoOption = "--auto";\r
public Class<Mafft> getType() {\r
return (Class<Mafft>) this.getClass();\r
}\r
-\r
- /*\r
- * @Override public List<String> getParameters(\r
- * compbio.runner.Executable.ExecProvider provider) { for (int i = 0; i <\r
- * param.size(); i++) { String par = param.get(i); if\r
- * (isMatrixParameter(par)) { String matrixName = getValue(i); if (new\r
- * File(matrixName).isAbsolute()) { // Matrix can be found so no actions\r
- * necessary // This method has been called already and the matrix name //\r
- * is modified to contain full path // no further actions is necessary\r
- * break; } String matrixPath = Util.getExecProperty("matrix.path", this);\r
- * String absMatrixPath = Util.convertToAbsolute(matrixPath); param.remove(i\r
- * + 1); param.remove(i); super.addParameter(MATRIX_PAR_NAME);\r
- * super.addParameter(absMatrixPath + File.separator + matrixName); break; }\r
- * } return super.getParameters(provider); }\r
- * \r
- * boolean isMatrixParameter(String parameter) { assert\r
- * !compbio.util.Util.isEmpty(parameter); if\r
- * (parameter.toUpperCase().startsWith(MATRIX_PAR_NAME)) { return true; }\r
- * return false; }\r
- * \r
- * String getValue(int i) { return param.get(i + 1); }\r
- */\r
}\r