Commit 98b792b5 authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Less errorprone approach of storing the path to outputfiles for the svcallers.

parent 3babdbc3
......@@ -67,15 +67,20 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript
for ((sample, bamFile) <- inputBams) {
var sampleVcfs: List[File] = List()
callers.foreach { caller =>
sampleVcfs :+= caller.outputFiles(sample)
sampleVcfs :+= caller.outputVCF(sample).get
}
val mergeSVcalls = new Pysvtools(this)
mergeSVcalls.input = sampleVcfs
mergeSVcalls.output = new File(outputDir, sample + ".merged.vcf")
add(mergeSVcalls)
outputFiles += (sample -> mergeSVcalls.output)
// outputFiles += (sample -> mergeSVcalls.output)
}
// merging the VCF calls by project
// basicly this will do all samples from this pipeline run
// group by "tags"
// sample tagging is however not available within this pipeline
addSummaryJobs()
}
......
......@@ -19,7 +19,7 @@ class Breakdancer(val root: Configurable) extends SvCaller {
val bdvcf = BreakdancerVCF(this, breakdancer.output, new File(breakdancerSampleDir, sample + ".breakdancer.vcf"))
add(bdcfg, breakdancer, bdvcf)
outputFiles += (sample -> bdvcf.output)
addVCF(sample, bdvcf.output)
}
}
}
......@@ -14,7 +14,7 @@ class Clever(val root: Configurable) extends SvCaller {
val clever = CleverCaller(this, bamFile, cleverDir)
add(clever)
outputFiles += (sample -> clever.outputvcf)
addVCF(sample, clever.outputvcf)
}
}
}
......@@ -4,7 +4,7 @@ import nl.lumc.sasc.biopet.extensions.delly.DellyCaller
import nl.lumc.sasc.biopet.extensions.gatk.CatVariants
import nl.lumc.sasc.biopet.utils.config.Configurable
/** Script for sv caler delly */
/** Script for sv caller delly */
class Delly(val root: Configurable) extends SvCaller {
def name = "delly"
......@@ -54,8 +54,7 @@ class Delly(val root: Configurable) extends SvCaller {
}
add(catVariants)
outputFiles += (sample -> catVariants.outputFile)
addVCF(sample, catVariants.outputFile)
}
}
}
......@@ -15,5 +15,15 @@ trait SvCaller extends QScript with BiopetQScript with Reference {
var inputBams: Map[String, File] = _
def outputVCF(sample: String): Option[File] = {
outputVcfs.get(sample)
}
protected var outputVcfs: Map[String, File] = _
protected def addVCF(sampleId: String, outputVCF: File) = {
outputVcfs += (sampleId -> outputVCF)
}
def init() = {}
}
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