Commit 531c04b7 authored by Sander Bollen's avatar Sander Bollen
Browse files

Merge branch 'fix-delly' into 'develop'

Sortvcf on the end



See merge request !468
parents 7ccf5ce0 85da3de4
...@@ -17,6 +17,7 @@ package nl.lumc.sasc.biopet.pipelines.shiva.svcallers ...@@ -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.delly.DellyCaller
import nl.lumc.sasc.biopet.extensions.gatk.CatVariants import nl.lumc.sasc.biopet.extensions.gatk.CatVariants
import nl.lumc.sasc.biopet.extensions.picard.SortVcf import nl.lumc.sasc.biopet.extensions.picard.SortVcf
import nl.lumc.sasc.biopet.utils.Logging
import nl.lumc.sasc.biopet.utils.config.Configurable import nl.lumc.sasc.biopet.utils.config.Configurable
/** Script for sv caller delly */ /** Script for sv caller delly */
...@@ -33,69 +34,60 @@ class Delly(val root: Configurable) extends SvCaller { ...@@ -33,69 +34,60 @@ class Delly(val root: Configurable) extends SvCaller {
val dellyDir = new File(outputDir, sample) val dellyDir = new File(outputDir, sample)
val catVariants = new CatVariants(this) 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) { if (del) {
val delly = new DellyCaller(this) val delly = new DellyCaller(this)
delly.input = bamFile delly.input = bamFile
delly.analysistype = "DEL" delly.analysistype = "DEL"
delly.isIntermediate = true
delly.outputvcf = new File(dellyDir, sample + ".delly.del.vcf") delly.outputvcf = new File(dellyDir, sample + ".delly.del.vcf")
add(delly) add(delly)
val compressedVCF = new SortVcf(this) catVariants.variant :+= delly.outputvcf
compressedVCF.input = delly.outputvcf
compressedVCF.output = new File(dellyDir, s"${sample}.delly.del.vcf.gz")
add(compressedVCF)
catVariants.variant :+= compressedVCF.output
} }
if (dup) { if (dup) {
val delly = new DellyCaller(this) val delly = new DellyCaller(this)
delly.input = bamFile delly.input = bamFile
delly.analysistype = "DUP" delly.analysistype = "DUP"
delly.isIntermediate = true
delly.outputvcf = new File(dellyDir, sample + ".delly.dup.vcf") delly.outputvcf = new File(dellyDir, sample + ".delly.dup.vcf")
add(delly) add(delly)
val compressedVCF = new SortVcf(this) catVariants.variant :+= delly.outputvcf
compressedVCF.input = delly.outputvcf
compressedVCF.output = new File(dellyDir, s"${sample}.delly.dup.vcf.gz")
add(compressedVCF)
catVariants.variant :+= compressedVCF.output
} }
if (inv) { if (inv) {
val delly = new DellyCaller(this) val delly = new DellyCaller(this)
delly.input = bamFile delly.input = bamFile
delly.analysistype = "INV" delly.analysistype = "INV"
delly.isIntermediate = true
delly.outputvcf = new File(dellyDir, sample + ".delly.inv.vcf") delly.outputvcf = new File(dellyDir, sample + ".delly.inv.vcf")
add(delly) add(delly)
val compressedVCF = new SortVcf(this) catVariants.variant :+= delly.outputvcf
compressedVCF.input = delly.outputvcf
compressedVCF.output = new File(dellyDir, s"${sample}.delly.inv.vcf.gz")
add(compressedVCF)
catVariants.variant :+= compressedVCF.output
} }
if (tra) { if (tra) {
val delly = new DellyCaller(this) val delly = new DellyCaller(this)
delly.input = bamFile delly.input = bamFile
delly.analysistype = "TRA" delly.analysistype = "TRA"
delly.isIntermediate = true
delly.outputvcf = new File(dellyDir, sample + ".delly.tra.vcf") delly.outputvcf = new File(dellyDir, sample + ".delly.tra.vcf")
add(delly) add(delly)
val compressedVCF = new SortVcf(this) catVariants.variant :+= delly.outputvcf
compressedVCF.input = delly.outputvcf
compressedVCF.output = new File(dellyDir, s"${sample}.delly.tra.vcf.gz")
add(compressedVCF)
catVariants.variant :+= compressedVCF.output
} }
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) 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)
} }
} }
} }
...@@ -130,7 +130,7 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers { ...@@ -130,7 +130,7 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers {
pipeline.inputBams = Map("bam" -> ShivaSvCallingTest.inputTouch("bam" + ".bam")) 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.init()
pipeline.script() pipeline.script()
} }
......
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