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

Code improvement

parent 96efe61e
......@@ -36,10 +36,10 @@ trait ShivaTrait extends MultisampleMappingTrait with Reference with TargetRegio
}
/** Method to make the variantcalling submodule of shiva */
def makeVariantcalling(multisample: Boolean = false): ShivaVariantcallingTrait = {
def makeVariantcalling(multisample: Boolean = false) = {
if (multisample) new ShivaVariantcalling(qscript) {
override def namePrefix = "multisample"
override def configName = "shivavariantcalling"
override def configName: String = "shivavariantcalling"
override def configPath: List[String] = super.configPath ::: "multisample" :: Nil
}
else new ShivaVariantcalling(qscript) {
......@@ -69,7 +69,7 @@ trait ShivaTrait extends MultisampleMappingTrait with Reference with TargetRegio
} else None
/** This will add jobs for this library */
override def addJobs = {
override def addJobs() = {
super.addJobs()
variantcalling.foreach(vc => {
......@@ -78,10 +78,7 @@ trait ShivaTrait extends MultisampleMappingTrait with Reference with TargetRegio
vc.outputDir = new File(libDir, "variantcalling")
if (preProcessBam.isDefined) vc.inputBams = Map(sampleId -> preProcessBam.get)
else vc.inputBams = Map(sampleId -> bamFile.get)
vc.init()
vc.biopetScript()
addAll(vc.functions)
addSummaryQScript(vc)
add(vc)
})
}
}
......@@ -99,10 +96,7 @@ trait ShivaTrait extends MultisampleMappingTrait with Reference with TargetRegio
vc.sampleId = Some(sampleId)
vc.outputDir = new File(sampleDir, "variantcalling")
vc.inputBams = Map(sampleId -> bam)
vc.init()
vc.biopetScript()
addAll(vc.functions)
addSummaryQScript(vc)
add(vc)
})
}
}
......@@ -122,34 +116,25 @@ trait ShivaTrait extends MultisampleMappingTrait with Reference with TargetRegio
} else None
/** This will add the mutisample variantcalling */
override def addMultiSampleJobs = {
override def addMultiSampleJobs() = {
super.addMultiSampleJobs()
multisampleVariantCalling.foreach(vc => {
vc.outputDir = new File(outputDir, "variantcalling")
vc.inputBams = samples.flatMap { case (sampleId, sample) => sample.preProcessBam.map(sampleId -> _) }
vc.init()
vc.biopetScript()
addAll(vc.functions)
addSummaryQScript(vc)
add(vc)
annotation.foreach { toucan =>
toucan.outputDir = new File(outputDir, "annotation")
toucan.inputVCF = vc.finalFile
toucan.init()
toucan.biopetScript()
addAll(toucan.functions)
addSummaryQScript(toucan)
add(toucan)
}
})
svCalling.foreach(sv => {
sv.outputDir = new File(outputDir, "sv_calling")
sv.inputBams = samples.flatMap { case (sampleId, sample) => sample.preProcessBam.map(sampleId -> _) }
sv.init()
sv.biopetScript()
addAll(sv.functions)
addSummaryQScript(sv)
add(sv)
})
}
......
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