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

Fix outputDirs for samtools flagstat

parent e86f6183
......@@ -69,12 +69,12 @@ class BamMetrics(val root: Configurable) extends QScript with BiopetQScript {
val strictOutputBam = new File(targetDir, inputBam.getName.stripSuffix(".bam") + ".overlap.strict.bam")
add(BedtoolsIntersect(this, inputBam, bedFile, strictOutputBam, minOverlap = config("strictintersectoverlap", default = 1.0)), true)
add(SamtoolsFlagstat(this, strictOutputBam))
add(SamtoolsFlagstat(this, strictOutputBam, targetDir))
add(BiopetFlagstat(this, strictOutputBam, targetDir))
val looseOutputBam = new File(targetDir, inputBam.getName.stripSuffix(".bam") + ".overlap.loose.bam")
add(BedtoolsIntersect(this, inputBam, bedFile, looseOutputBam, minOverlap = config("looseintersectoverlap", default = 0.01)), true)
add(SamtoolsFlagstat(this, looseOutputBam))
add(SamtoolsFlagstat(this, looseOutputBam, targetDir))
add(BiopetFlagstat(this, looseOutputBam, targetDir))
val coverageFile = new File(targetDir, inputBam.getName.stripSuffix(".bam") + ".coverage")
......
......@@ -33,13 +33,7 @@ object SamtoolsFlagstat {
def apply(root: Configurable, input: File, outputDir: File): SamtoolsFlagstat = {
val flagstat = new SamtoolsFlagstat(root)
flagstat.input = input
flagstat.output = new File(outputDir + swapExtension(input.getName))
flagstat.output = new File(outputDir, input.getName.stripSuffix(".bam") + ".flagstat")
flagstat
}
def apply(root: Configurable, input: File): SamtoolsFlagstat = {
return apply(root, input, new File(swapExtension(input.getAbsolutePath)))
}
private def swapExtension(inputFile: String) = inputFile.stripSuffix(".bam") + ".flagstat"
}
\ No newline at end of file
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