Commit c6980164 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Moved code

parent beef0cec
......@@ -71,11 +71,18 @@ trait BiopetCommandLineFunction extends CommandLineFunction with Configurable {
/** Can override this method. This is executed after the script is done en queue starts to generate the graph */
def beforeGraph() {}
/** Set default output file, threads and vmem for current job */
override def freezeFieldValues() {
preProcessExecutable()
beforeGraph()
if (jobOutputFile == null) jobOutputFile = new File(firstOutput.getAbsoluteFile.getParent, "." + firstOutput.getName + "." + configName + ".out")
internalBeforeGraph()
super.freezeFieldValues()
}
/** Set default output file, threads and vmem for current job */
private[core] def internalBeforeGraph(): Unit = {
if (jobOutputFile == null && firstOutput != null)
jobOutputFile = new File(firstOutput.getAbsoluteFile.getParent, "." + firstOutput.getName + "." + configName + ".out")
if (threads == 0) threads = getThreads(defaultThreads)
if (threads > 1) nCoresRequest = Option(threads)
......@@ -91,8 +98,6 @@ trait BiopetCommandLineFunction extends CommandLineFunction with Configurable {
if (!config.contains("vmem")) vmem = Some((_coreMemory * (vmemFactor + (0.5 * retry))) + "G")
if (vmem.isDefined) jobResourceRequests :+= "h_vmem=" + vmem.get
jobName = configName + ":" + (if (firstOutput != null) firstOutput.getName else jobOutputFile)
super.freezeFieldValues()
}
var retry = 0
......
......@@ -29,6 +29,7 @@ class BiopetPipe(val commands: List[BiopetCommandLineFunction]) extends BiopetCo
override def beforeGraph() {
super.beforeGraph()
commands.foreach(_.beforeGraph())
commands.foreach(_.internalBeforeGraph())
stdoutFile = stdoutFile.map(_.getAbsoluteFile)
stdinFile = stdinFile.map(_.getAbsoluteFile)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment