Commit 7e973ac3 authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Change tests to accept pindel

Add testcode to accept merged VCFs
parent c82bbe9f
......@@ -19,7 +19,7 @@ class Pysvtools(val root: Configurable) extends BiopetCommandLineFunction {
var flanking: Option[Int] = config("flanking")
var exclusionRegions: List[File] = config("exclusion_regions")
var translocationsOnly: Boolean = config("translocations_only")
var translocationsOnly: Boolean = config("translocations_only", default = false)
@Output(doc = "Unzipped file", required = true)
var output: File = _
......
......@@ -3,11 +3,11 @@ package nl.lumc.sasc.biopet.utils
import java.io.File
import htsjdk.samtools._
import org.mockito.Mockito.{ inOrder => inOrd }
import org.mockito.Mockito.{inOrder => inOrd}
import org.scalatest.Matchers
import org.scalatest.mock.MockitoSugar
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.{ BeforeClass, Test }
import org.testng.annotations.{BeforeClass, Test}
/**
* Created by wyleung on 22-2-16.
......
......@@ -18,9 +18,7 @@ package nl.lumc.sasc.biopet.pipelines.shiva
import nl.lumc.sasc.biopet.core.summary.SummaryQScript
import nl.lumc.sasc.biopet.core.{ PipelineCommand, Reference, SampleLibraryTag }
import nl.lumc.sasc.biopet.extensions.Pysvtools
import nl.lumc.sasc.biopet.pipelines.shiva.svcallers.{ Breakdancer, Clever, Delly, SvCaller }
import nl.lumc.sasc.biopet.pipelines.shiva.svcallers._
import nl.lumc.sasc.biopet.utils.{ BamUtils, Logging }
import nl.lumc.sasc.biopet.pipelines.shiva.svcallers.{ Breakdancer, Clever, Delly, SvCaller, _ }
import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.utils.{ BamUtils, Logging }
import org.broadinstitute.gatk.queue.QScript
......@@ -68,12 +66,12 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript
// merge VCF by sample
for ((sample, bamFile) <- inputBams) {
var sampleVcfs: List[File] = List()
var sampleVCFS: List[Option[File]] = List.empty
callers.foreach { caller =>
sampleVcfs :+= caller.outputVCF(sample).get
sampleVCFS ::= caller.outputVCF(sample)
}
val mergeSVcalls = new Pysvtools(this)
mergeSVcalls.input = sampleVcfs
mergeSVcalls.input = sampleVCFS.flatten
mergeSVcalls.output = new File(outputDir, sample + ".merged.vcf")
add(mergeSVcalls)
// outputFiles += (sample -> mergeSVcalls.output)
......
......@@ -57,6 +57,8 @@ class Pindel(val root: Configurable) extends SvCaller {
pindelVcf.rDate = todayformat.format(today) // officially, we should enter the date of the genome here
pindelVcf.outputVCF = new File(pindelDir, s"${sample}.pindel.vcf")
add(pindelVcf)
addVCF(sample, pindelVcf.outputVCF)
}
}
......
......@@ -13,16 +13,19 @@ trait SvCaller extends QScript with BiopetQScript with Reference {
var namePrefix: String = _
var inputBams: Map[String, File] = _
var inputBams: Map[String, File] = Map.empty
def outputVCF(sample: String): Option[File] = {
outputVcfs.get(sample)
outputVCFs.get(sample) match {
case Some(file) => Some(file)
case _ => None
}
}
protected var outputVcfs: Map[String, File] = _
protected var outputVCFs: Map[String, File] = Map.empty
protected def addVCF(sampleId: String, outputVCF: File) = {
outputVcfs += (sampleId -> outputVCF)
outputVCFs += (sampleId -> outputVCF)
}
def init() = {}
......
......@@ -221,6 +221,10 @@ object ShivaSvCallingTest {
"pindelvcf" -> Map("exe" -> "test"),
"clever" -> Map("exe" -> "test"),
"delly" -> Map("exe" -> "test"),
"varscan_jar" -> "test"
"varscan_jar" -> "test",
"pysvtools" -> Map(
"exe" -> "test",
"exclusion_regions" -> "test",
"translocations_only" -> false)
)
}
\ No newline at end of file
Supports Markdown
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