Commit 9d86b1ed authored by Sander Bollen's avatar Sander Bollen
Browse files

Fix BamMetrics to use file in stead of directory

Fix markduplicates to not overwrite bam file with metrics file
parent 0267b656
......@@ -88,8 +88,9 @@ class BamMetrics(val root: Configurable) extends QScript with SummaryQScript wit
for (bedFile <- bedFiles) {
//TODO: Add target jobs to summary
val targetDir = new File(outputDir, bedFile.getName.stripSuffix(".bed"))
val targetInterval = BedToInterval(this, bedFile, inputBam, targetDir)
val targetDir = bedFile.getParentFile
val targetFile = new File(outputDir, bedFile.getName.stripSuffix(".bed") + ".interval")
val targetInterval = BedToInterval(this, bedFile, inputBam, targetFile)
add(targetInterval, true)
add(CalculateHsMetrics(this, inputBam, if (baitIntervalFile != null) baitIntervalFile
else targetInterval.output, targetInterval.output, targetDir))
......
......@@ -43,14 +43,6 @@ class BedToInterval(val root: Configurable) extends BiopetJavaCommandLineFunctio
}
object BedToInterval extends ToolCommand {
def apply(root: Configurable, inputBed: File, inputBam: File, outputDir: String): BedToInterval = {
val bedToInterval = new BedToInterval(root)
bedToInterval.input = inputBed
bedToInterval.bamFile = inputBam
bedToInterval.output = new File(outputDir, inputBed.getName.stripSuffix(".bed") + ".interval")
return bedToInterval
}
def apply(root: Configurable, inputBed: File, inputBam: File, output: File): BedToInterval = {
val bedToInterval = new BedToInterval(root)
bedToInterval.input = inputBed
......
......@@ -219,7 +219,7 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript {
val md = new MarkDuplicates(qscript)
md.input = input
md.output = new File(sampleDir, sampleId + ".dedup.bam")
md.outputMetrics = new File(sampleDir, sampleId + ".dedup.bam")
md.outputMetrics = new File(sampleDir, sampleId + ".dedup.metrics")
md.isIntermediate = isIntermediate
add(md)
addSummarizable(md, "mark_duplicates")
......
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