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

Add variantcalling to summary

parent 5d9d3661
......@@ -28,6 +28,7 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript {
def makeVariantcalling(multisample: Boolean = false) = {
if (multisample) new ShivaVariantcalling(qscript) {
override def namePrefix = "multisample."
override def configName = "shivavariantcalling"
override def configPath: List[String] = super.configPath ::: "multisample" :: Nil
}
......@@ -132,13 +133,15 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript {
if (config("library_variantcalling", default = false).asBoolean && (bamFile.isDefined || preProcessBam.isDefined)) {
val vc = makeVariantcalling(multisample = false)
vc.namePrefix = sampleId + "-" + libId
vc.sampleId = Some(libId)
vc.libId = Some(sampleId)
vc.outputDir = new File(libDir, "variantcalling")
if (preProcessBam.isDefined) vc.inputBams = preProcessBam.get :: Nil
else vc.inputBams = bamFile.get :: Nil
vc.init
vc.biopetScript
addAll(vc.functions)
addSummaryQScript(vc)
}
}
}
......@@ -181,12 +184,13 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript {
if (config("single_sample_variantcalling", default = false).asBoolean && preProcessBam.isDefined) {
val vc = makeVariantcalling(multisample = false)
vc.namePrefix = sampleId
vc.sampleId = Some(sampleId)
vc.outputDir = new File(sampleDir, "variantcalling")
vc.inputBams = preProcessBam.get :: Nil
vc.init
vc.biopetScript
addAll(vc.functions)
addSummaryQScript(vc)
}
}
}
......@@ -194,12 +198,12 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript {
def addMultiSampleJobs(): Unit = {
if (config("multisample_sample_variantcalling", default = true).asBoolean) {
val vc = makeVariantcalling(multisample = true)
vc.namePrefix = "multisample"
vc.outputDir = new File(outputDir, "variantcalling")
vc.inputBams = samples.map(_._2.preProcessBam).flatten.toList
vc.init
vc.biopetScript
addAll(vc.functions)
addSummaryQScript(vc)
}
}
......
......@@ -20,7 +20,13 @@ trait ShivaVariantcallingTrait extends SummaryQScript with SampleLibraryTag {
@Input(doc = "Bam files (should be deduped bams)", shortName = "BAM", required = true)
var inputBams: List[File] = Nil
var namePrefix: String = ""
def namePrefix: String = {
(sampleId, libId) match {
case (Some(sampleId), Some(libId)) => sampleId + "-" + libId + "."
case (Some(sampleId), _) => sampleId + "."
case _ => ""
}
}
def init: Unit = {
if (!namePrefix.isEmpty && !namePrefix.endsWith(".")) namePrefix += "."
......
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