Commit 492b52f0 authored by Peter van 't Hof's avatar Peter van 't Hof Committed by GitHub

Merge pull request #50 from biopet/fix-BIOPET-583

Fixing clever execution
parents 3bc12fa1 ad810026
......@@ -54,7 +54,7 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
}
writer.println("set -eubf")
writer.println("set -o pipefail")
lines.foreach(writer.println)
writer.println(this.commandLine)
jobDelayTime.foreach(x => writer.println(s"sleep $x"))
writer.close()
}
......@@ -99,6 +99,8 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
beforeGraph()
internalBeforeGraph()
this.commandDirectory = this.jobOutputFile.getParentFile
super.freezeFieldValues()
}
......
......@@ -38,17 +38,16 @@ class CleverCaller(val parent: Configurable) extends BiopetCommandLineFunction w
@Input(doc = "Reference")
var reference: File = _
protected def cleverOutputDir: File = new File(cleverWorkDir, "work")
var cleverWorkDir: File = _
@Output(doc = "Clever VCF output")
lazy val outputvcf: File = {
new File(cleverOutputDir, "predictions.vcf")
new File(cleverWorkDir, "predictions.vcf")
}
@Output(doc = "Clever raw output")
lazy val outputraw: File = {
new File(cleverOutputDir, "predictions.raw.txt")
new File(cleverWorkDir, "predictions.raw.txt")
}
// var T: Option[Int] = config("T", default = defaultThreads)
......@@ -60,13 +59,13 @@ class CleverCaller(val parent: Configurable) extends BiopetCommandLineFunction w
override def beforeGraph() {
super.beforeGraph()
if (cleverOutputDir == null) throw new Exception("Clever :: Workdirectory is not defined")
if (cleverWorkDir == null) throw new Exception("Clever :: Workdirectory is not defined")
if (reference == null) reference = referenceFasta()
}
def cmdLine = required(executable) +
" --sorted " +
" --use_xa " +
required("--sorted") +
required("--use_xa") +
optional("-T", threads) +
conditional(f, "-f") +
conditional(a, "-a") +
......@@ -74,7 +73,7 @@ class CleverCaller(val parent: Configurable) extends BiopetCommandLineFunction w
conditional(r, "-r") +
required(input) +
required(reference) +
required(cleverOutputDir)
required(cleverWorkDir)
}
object CleverCaller {
......
......@@ -23,10 +23,10 @@ class Clever(val parent: Configurable) extends SvCaller {
def name = "clever"
def biopetScript() {
//TODO: check double directories
for ((sample, bamFile) <- inputBams) {
val cleverDir = new File(outputDir, sample)
val clever = CleverCaller(this, bamFile, cleverDir)
val clever = CleverCaller(this, bamFile, new File(cleverDir, "clever_output"))
clever.jobOutputFile = new File(cleverDir, ".CleverCaller.out")
add(clever)
val cleverVCF = new CleverFixVCF(this)
......
Markdown is supported
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