diff --git a/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/svcallers/Delly.scala b/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/svcallers/Delly.scala index b0a7c5c713ad4132015899ec341f784bdacb8647..0eccb89d19bb746f826c8d73e99da7da2bbd6859 100644 --- a/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/svcallers/Delly.scala +++ b/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/svcallers/Delly.scala @@ -17,6 +17,7 @@ package nl.lumc.sasc.biopet.pipelines.shiva.svcallers import nl.lumc.sasc.biopet.extensions.delly.DellyCaller import nl.lumc.sasc.biopet.extensions.gatk.CatVariants import nl.lumc.sasc.biopet.extensions.picard.SortVcf +import nl.lumc.sasc.biopet.utils.Logging import nl.lumc.sasc.biopet.utils.config.Configurable /** Script for sv caller delly */ @@ -33,69 +34,60 @@ class Delly(val root: Configurable) extends SvCaller { val dellyDir = new File(outputDir, sample) val catVariants = new CatVariants(this) - catVariants.outputFile = new File(dellyDir, sample + ".delly.vcf.gz") + catVariants.outputFile = new File(dellyDir, sample + ".delly.vcf") + catVariants.isIntermediate = true if (del) { val delly = new DellyCaller(this) delly.input = bamFile delly.analysistype = "DEL" + delly.isIntermediate = true delly.outputvcf = new File(dellyDir, sample + ".delly.del.vcf") add(delly) - val compressedVCF = new SortVcf(this) - compressedVCF.input = delly.outputvcf - compressedVCF.output = new File(dellyDir, s"${sample}.delly.del.vcf.gz") - add(compressedVCF) - - catVariants.variant :+= compressedVCF.output + catVariants.variant :+= delly.outputvcf } if (dup) { val delly = new DellyCaller(this) delly.input = bamFile delly.analysistype = "DUP" + delly.isIntermediate = true delly.outputvcf = new File(dellyDir, sample + ".delly.dup.vcf") add(delly) - val compressedVCF = new SortVcf(this) - compressedVCF.input = delly.outputvcf - compressedVCF.output = new File(dellyDir, s"${sample}.delly.dup.vcf.gz") - add(compressedVCF) - - catVariants.variant :+= compressedVCF.output + catVariants.variant :+= delly.outputvcf } if (inv) { val delly = new DellyCaller(this) delly.input = bamFile delly.analysistype = "INV" + delly.isIntermediate = true delly.outputvcf = new File(dellyDir, sample + ".delly.inv.vcf") add(delly) - val compressedVCF = new SortVcf(this) - compressedVCF.input = delly.outputvcf - compressedVCF.output = new File(dellyDir, s"${sample}.delly.inv.vcf.gz") - add(compressedVCF) - - catVariants.variant :+= compressedVCF.output + catVariants.variant :+= delly.outputvcf } if (tra) { val delly = new DellyCaller(this) delly.input = bamFile delly.analysistype = "TRA" + delly.isIntermediate = true delly.outputvcf = new File(dellyDir, sample + ".delly.tra.vcf") add(delly) - val compressedVCF = new SortVcf(this) - compressedVCF.input = delly.outputvcf - compressedVCF.output = new File(dellyDir, s"${sample}.delly.tra.vcf.gz") - add(compressedVCF) - - catVariants.variant :+= compressedVCF.output + catVariants.variant :+= delly.outputvcf } - require(catVariants.variant.nonEmpty, "At least 1 SV-type should be selected for Delly") + if (catVariants.variant.isEmpty) Logging.addError("At least 1 SV-type should be selected for Delly") add(catVariants) - addVCF(sample, catVariants.outputFile) + + val compressedVCF = new SortVcf(this) + compressedVCF.input = catVariants.outputFile + compressedVCF.output = catVariants.outputFile + ".gz" + add(compressedVCF) + + addVCF(sample, compressedVCF.output) } } } diff --git a/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaSvCallingTest.scala b/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaSvCallingTest.scala index c4c4143ec2623ababd73de39522ee7b4aa35cd1f..bad063d923c39eb543bbb7d2aec845d69ba145cc 100644 --- a/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaSvCallingTest.scala +++ b/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaSvCallingTest.scala @@ -130,7 +130,7 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers { pipeline.inputBams = Map("bam" -> ShivaSvCallingTest.inputTouch("bam" + ".bam")) - if (!del && !dup && !inv && !tra) intercept[IllegalArgumentException] { + if (!del && !dup && !inv && !tra) intercept[IllegalStateException] { pipeline.init() pipeline.script() }