mafft.presets.file=conf/settings/MafftPresets.xml\r
mafft.parameters.file=conf/settings/MafftParameters.xml\r
mafft.limits.file=conf/settings/MafftLimits.xml\r
-mafft.cluster.settings=-l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M\r
+mafft.cluster.cpunum=4\r
+mafft.cluster.settings=-q 64bit-pri.q -pe smp 4 -l h_cpu=24:00:00 -l h_vmem=1700M -l ram=1700M\r
+\r
\r
### Tcoffee configuration ###\r
local.tcoffee.bin=binaries/src/tcoffee/t_coffee_source/t_coffee\r
+++ /dev/null
-/* Copyright (c) 2009 Peter Troshin\r
- * \r
- * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.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
- * \r
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\r
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache \r
- * License for more details.\r
- * \r
- * A copy of the license is in apache_license.txt. It is also available here:\r
- * @see: http://www.apache.org/licenses/LICENSE-2.0.txt\r
- * \r
- * Any republication or derived work distributed in source code form\r
- * must include this copyright and license notice.\r
- */\r
-\r
-package compbio.engine.client;\r
-\r
-public interface ClusterNativeSpecExecutable<T> extends Executable<T> {\r
-\r
- // void setNativeSpecs(String nativeSpecs);\r
-\r
- String getNativeSpecs();\r
-}\r
value += exec.toString();\r
return value;\r
}\r
+\r
+ @Override\r
+ public String getClusterJobSettings() {\r
+ return exec.getClusterJobSettings();\r
+ }\r
}\r
\r
LimitsManager<T> getLimits();\r
\r
+ String getClusterJobSettings();\r
+\r
}\r
return code;\r
}\r
\r
- public String getClusterSettings() {\r
+ @Override\r
+ public String getClusterJobSettings() {\r
String settings = ph.getProperty(getType().getSimpleName()\r
.toLowerCase() + ".cluster.settings");\r
return settings == null ? "" : settings;\r
import compbio.engine.ClusterJobId;\r
import compbio.engine.Configurator;\r
import compbio.engine.SyncExecutor;\r
-import compbio.engine.client.ClusterNativeSpecExecutable;\r
+\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.PathValidator;\r
* If executable require special cluster configuration parameters to\r
* be set e.g. queue, ram, time etc\r
*/\r
- if (confExec.getExecutable() instanceof ClusterNativeSpecExecutable<?>) {\r
- setNativeSpecs(confExec.getExecutable());\r
- }\r
+ setNativeSpecs(confExec.getExecutable());\r
+\r
\r
log.trace("using arguments: " + jobtempl.getArgs());\r
this.confExecutable = confExec;\r
}\r
\r
void setNativeSpecs(Executable<?> executable) throws DrmaaException {\r
- jobtempl\r
- .setNativeSpecification(((ClusterNativeSpecExecutable<?>) executable)\r
- .getNativeSpecs());\r
+ String nativeSpecs = executable.getClusterJobSettings(); \r
+ if(!compbio.util.Util.isEmpty(nativeSpecs)) {\r
+ log.debug("Using cluster job settings: " + nativeSpecs);\r
+ jobtempl.setNativeSpecification(nativeSpecs);\r
+ }\r
}\r
\r
void setEmail(String email) {\r
// TODO Auto-generated method stub\r
return null;\r
}\r
+ \r
+ @Override\r
+ public String getClusterJobSettings() {\r
+ // TODO Auto-generated method stub\r
+ return null; \r
+ }\r
\r
}\r
// TODO Auto-generated method stub\r
return null;\r
}\r
+ @Override\r
+ public String getClusterJobSettings() {\r
+ // TODO Auto-generated method stub\r
+ return null; \r
+ }\r
}\r
\r
import compbio.data.sequence.Alignment;\r
import compbio.data.sequence.UnknownFileFormatException;\r
+\r
import compbio.engine.client.PipedExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.runner.Util;\r
\r
+/**\r
+ * \r
+ * @author pvtroshin\r
+ *\r
+ */\r
public class Mafft extends SkeletalExecutable<Mafft>\r
implements\r
PipedExecutable<Mafft> {\r
-\r
+ /*\r
+ * TODO get rid of piping: Mafft now supports --out option for output file. \r
+ * TODO enable multithreading support\r
+ */\r
+ \r
+ /**\r
+ * Number of cores to use, not used if "mafft.cluster.cpunum" property \r
+ * is not defined and in case of local execution \r
+ */\r
+ private int ncoreNumber = 0;\r
+ \r
+ /*\r
+ * Number of cores parameter name\r
+ */\r
+ private final static String ncorePrm = "--thread";\r
+ \r
private static Logger log = Logger.getLogger(Mafft.class);\r
\r
private static String autoOption = "--auto";\r
return this;\r
}\r
\r
+\r
+ public void setNCore(int ncoreNumber) {\r
+ if (ncoreNumber < 1 || ncoreNumber > 100) {\r
+ throw new IndexOutOfBoundsException(\r
+ "Number of cores must be within 1 and 100 ");\r
+ }\r
+ this.ncoreNumber = ncoreNumber;\r
+ cbuilder.setParam(ncorePrm, Integer.toString(getNCore()));\r
+ }\r
+\r
+ int getNCore() {\r
+ return ncoreNumber;\r
+ }\r
+ \r
+ \r
@SuppressWarnings("unchecked")\r
@Override\r
public Class<Mafft> getType() {\r
\r
import compbio.data.sequence.Alignment;\r
import compbio.data.sequence.UnknownFileFormatException;\r
-import compbio.engine.client.ClusterNativeSpecExecutable;\r
import compbio.engine.client.CommandBuilder;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.PipedExecutable;\r
import compbio.util.PropertyHelper;\r
\r
public class Tcoffee extends SkeletalExecutable<Tcoffee>\r
- implements\r
- PipedExecutable<Tcoffee>,\r
- ClusterNativeSpecExecutable<Tcoffee> {\r
+ implements PipedExecutable<Tcoffee> {\r
\r
private static Logger log = Logger.getLogger(Tcoffee.class);\r
\r
int cpunum = SkeletalExecutable.getClusterCpuNum(getType());\r
if (cpunum != 0) {\r
setNCore(cpunum);\r
- }\r
+ } \r
}\r
return super.getParameters(provider);\r
}\r
\r
- @Override\r
- public String getNativeSpecs() {\r
- return getClusterSettings();\r
- }\r
\r
@SuppressWarnings("unchecked")\r
@Override\r