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

Added sv calling to shiva

parent 9ca827e9
...@@ -179,7 +179,7 @@ trait BastyTrait extends MultiSampleQScript { ...@@ -179,7 +179,7 @@ trait BastyTrait extends MultiSampleQScript {
snpsOnly: Boolean = false): FastaOutput = { snpsOnly: Boolean = false): FastaOutput = {
val bastyGenerateFasta = new BastyGenerateFasta(this) val bastyGenerateFasta = new BastyGenerateFasta(this)
bastyGenerateFasta.outputName = if (outputName != null) outputName else sampleName bastyGenerateFasta.outputName = if (outputName != null) outputName else sampleName
bastyGenerateFasta.inputVcf = shiva.variantcalling.get.finalFile bastyGenerateFasta.inputVcf = shiva.variantCalling.get.finalFile
if (shiva.samples.contains(sampleName)) { if (shiva.samples.contains(sampleName)) {
bastyGenerateFasta.bamFile = shiva.samples(sampleName).preProcessBam.get bastyGenerateFasta.bamFile = shiva.samples(sampleName).preProcessBam.get
} }
......
...@@ -44,7 +44,7 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript ...@@ -44,7 +44,7 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript
protected var inputBams: Map[String, File] = Map() protected var inputBams: Map[String, File] = Map()
protected def addBamFile(file: File, sampleId: Option[String] = None): Unit = { def addBamFile(file: File, sampleId: Option[String] = None): Unit = {
sampleId match { sampleId match {
case Some(sample) => inputBams += sample -> file case Some(sample) => inputBams += sample -> file
case _ if !file.exists() => throw new IllegalArgumentException("Bam file does not exits: " + file) case _ if !file.exists() => throw new IllegalArgumentException("Bam file does not exits: " + file)
......
...@@ -270,13 +270,19 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference { ...@@ -270,13 +270,19 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
} }
} }
lazy val variantcalling = if (config("multisample_variantcalling", default = true).asBoolean) { lazy val variantCalling = if (config("multisample_variantcalling", default = true).asBoolean) {
Some(makeVariantcalling(multisample = true)) Some(makeVariantcalling(multisample = true))
} else None } else None
lazy val svCalling = if (config("sv_calling", default = false).asBoolean) {
val svCalling = new ShivaSvCalling(this)
samples.foreach(x => x._2.preProcessBam.foreach(bam => svCalling.addBamFile(bam, Some(x._1))))
Some(svCalling)
} else None
/** This will add the mutisample variantcalling */ /** This will add the mutisample variantcalling */
def addMultiSampleJobs(): Unit = { def addMultiSampleJobs(): Unit = {
variantcalling.foreach(vc => { variantCalling.foreach(vc => {
vc.outputDir = new File(outputDir, "variantcalling") vc.outputDir = new File(outputDir, "variantcalling")
vc.inputBams = samples.flatMap(_._2.preProcessBam).toList vc.inputBams = samples.flatMap(_._2.preProcessBam).toList
vc.init() vc.init()
......
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