Commit 48781f54 authored by Sander Bollen's avatar Sander Bollen

give toucan outputvcf var for programmatic access.

parent cf39c3b8
......@@ -40,6 +40,8 @@ class Toucan(val root: Configurable) extends QScript with BiopetQScript with Sum
@Input(doc = "Input GVCF file", shortName = "gvcf", required = false)
var inputGvcf: Option[File] = None
var outputVcf: Option[File] = None
def sampleInfo: Map[String, Map[String, Any]] = root match {
case m: MultiSampleQScript => m.samples.map { case (sampleId, sample) => sampleId -> sample.sampleTags }
case null => VcfUtils.getSampleIds(inputVCF).map(x => x -> Map[String, Any]()).toMap
......@@ -79,29 +81,29 @@ class Toucan(val root: Configurable) extends QScript with BiopetQScript with Sum
val gonlVcfFile: Option[File] = config("gonl_vcf")
val exacVcfFile: Option[File] = config("exac_vcf")
var outputFile = normalizer.outputVcf
outputVcf = Some(normalizer.outputVcf)
gonlVcfFile match {
case Some(gonlFile) =>
val vcfWithVcf = new VcfWithVcf(this)
vcfWithVcf.input = outputFile
vcfWithVcf.input = outputVcf.getOrElse(new File(""))
vcfWithVcf.secondaryVcf = gonlFile
vcfWithVcf.output = swapExt(outputDir, normalizer.outputVcf, ".vcf.gz", ".gonl.vcf.gz")
vcfWithVcf.fields ::= ("AF", "AF_gonl", None)
add(vcfWithVcf)
outputFile = vcfWithVcf.output
outputVcf = Some(vcfWithVcf.output)
case _ =>
}
exacVcfFile match {
case Some(exacFile) =>
val vcfWithVcf = new VcfWithVcf(this)
vcfWithVcf.input = outputFile
vcfWithVcf.input = outputVcf.getOrElse(new File(""))
vcfWithVcf.secondaryVcf = exacFile
vcfWithVcf.output = swapExt(outputDir, outputFile, ".vcf.gz", ".exac.vcf.gz")
vcfWithVcf.output = swapExt(outputDir, outputVcf.getOrElse(new File("")), ".vcf.gz", ".exac.vcf.gz")
vcfWithVcf.fields ::= ("AF", "AF_exac", None)
add(vcfWithVcf)
outputFile = vcfWithVcf.output
outputVcf = Some(vcfWithVcf.output)
case _ =>
}
......
package nl.lumc.sasc.biopet.pipelines.toucan
import java.io.File
import java.nio.file.{Files, Paths}
import java.nio.file.{ Files, Paths }
import nl.lumc.sasc.biopet.utils.config.Config
import org.broadinstitute.gatk.queue.QSettings
......@@ -10,8 +10,8 @@ import org.scalatest.testng.TestNGSuite
import org.testng.annotations.Test
/**
* Created by ahbbollen on 21-4-16.
*/
* Created by ahbbollen on 21-4-16.
*/
class ToucanTest extends TestNGSuite with Matchers {
val faultyToucan = new Toucan(null) {
......@@ -36,10 +36,9 @@ class ToucanTest extends TestNGSuite with Matchers {
@Test
def testIncompletePipeline() = {
an [IllegalStateException] should be thrownBy faultyToucan.script()
an[IllegalStateException] should be thrownBy faultyToucan.script()
}
val correctToucan = new Toucan(null) {
override def sampleInfo: Map[String, Map[String, Any]] = Map(
"sample1" -> Map("varda_groups" -> List("group1", "group2"))
......
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