Commit b049eb31 authored by Peter van 't Hof's avatar Peter van 't Hof Committed by GitHub

Merge pull request #157 from biopet/fix-BIOPET-736-peter

Adding mutect2 pipeline
parents b0ef88db cc5db58a
......@@ -28,7 +28,7 @@ class Bgzip(val parent: Configurable) extends BiopetCommandLineFunction {
var input: List[File] = Nil
@Output(doc = "Compressed output file", required = false)
var output: File = null
var output: File = _
var f: Boolean = config("f", default = false)
executable = config("exe", default = "bgzip", freeVar = false)
......@@ -39,7 +39,7 @@ class Bgzip(val parent: Configurable) extends BiopetCommandLineFunction {
if (output == null && !outputAsStdout) Logging.addError("Output is missing for Bgzip")
}
def cmdLine =
def cmdLine: String =
required(executable) +
conditional(f, "-f") +
" -c " + repeat(input) +
......
/**
* Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines.
*
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
*
* Contact us at: sasc@lumc.nl
*
* A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL
* license; For commercial users or users who do not want to follow the AGPL
* license, please contact us to obtain a separate license.
*/
package nl.lumc.sasc.biopet.extensions.bcftools
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Output, Input}
class BcftoolsReheader(val parent: Configurable) extends Bcftools {
@Input(doc = "Input vcf file", required = false)
var input: File = _
@Input(doc = "File specifying how sample names should be renamed", required = true)
var renameSamples: File = _
@Output(doc = "Output vcf file", required = false)
var output: File = _
def cmdLine: String =
required(executable) +
required("reheader") +
required("--samples", renameSamples) +
optional("--output", output) +
optional(input)
}
object BcftoolsReheader {
def apply(parent: Configurable, renameSamples: File): BcftoolsReheader = {
val reheader = new BcftoolsReheader(parent)
reheader.renameSamples = renameSamples
reheader
}
}
......@@ -418,3 +418,11 @@ trait CommandLineGATK extends BiopetJavaCommandLineFunction with Reference with
optional("-l", logging_level, spaceSeparated = true, escape = true, format = "%s") +
optional("-log", log_to_file, spaceSeparated = true, escape = true, format = "%s")
}
object CommandLineGATK {
def isFileWithTag(file: File, tag: String): Boolean = file match {
case f:TaggedFile => f.tag == tag
case _ => false
}
}
\ No newline at end of file
package nl.lumc.sasc.biopet.extensions.gatk
import java.io.File
import nl.lumc.sasc.biopet.extensions.gatk.CommandLineGATK.isFileWithTag
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.extensions.gatk.TaggedFile
import org.broadinstitute.gatk.utils.commandline.{Argument, Input, Output}
class ContEst(val parent: Configurable) extends CommandLineGATK {
def analysis_type: String = "ContEst"
/** Getter and setter for tumor sample bam file. */
def tumorSampleBam = input_file.find(file => isFileWithTag(file, "eval")).getOrElse(null)
def tumorSampleBam_= (value:File):Unit = {
input_file = input_file.filterNot(file => isFileWithTag(file, "eval"))
input_file :+= TaggedFile(value, "eval")
}
/** Getter and setter for normal sample bam file. */
def normalSampleBam = input_file.find(file => isFileWithTag(file, "genotype")).getOrElse(null)
def normalSampleBam_= (value:File):Unit = {
input_file = input_file.filterNot(file => isFileWithTag(file, "genotype"))
input_file :+= TaggedFile(value, "genotype")
}
/** Variant file containing information about the population allele frequencies. */
@Input(fullName = "popfile", shortName="pf", required = true)
var popFile: File = config("popfile")
/** Output file of the program. */
@Output(fullName = "out", shortName = "o", required = true)
var output: File = _
/** Where to write a full report about the loci we processed. */
@Output(fullName = "base_report", shortName = "br", required = false)
var baseReportFile: Option[File] = config("base_report")
@Argument(fullName = "beta_threshold", required = false)
var betaThreshold: Option[Double] = config("beta_threshold")
@Argument(fullName = "genotype_mode", shortName= "gm", required = false)
var genotypeMode: Option[String] = config("genotype_mode")
@Argument(fullName = "lane_level_contamination", shortName= "llc", required = false)
var laneLevelContamination: String = "SAMPLE"
@Output(fullName = "likelihood_file", shortName = "lf", required = false)
var likelihoodFile: Option[File] = config("likelihood_file")
/** Threshold for minimum mapping quality score.
* Default value: 20 */
@Argument(fullName = "min_mapq", required = false)
var minMapQ: Option[Int] = config("min_mapq")
/** Threshold for minimum base quality score.
* Default value: 20 */
@Argument(fullName = "min_qscore", required = false)
var minQScore: Option[Int] = config("min_qscore")
@Argument(fullName = "minimum_base_count", shortName = "mbc", required = false)
var minimumBaseCount: Option[Int] = config("minimum_base_count")
/** Evaluate contamination for just a single contamination population.
* Default value: CEU */
@Argument(fullName = "population", shortName = "population", required = false)
var population: Option[String] = config("population")
@Argument(fullName = "precision", shortName = "pc", required = false)
var precision: Option[Double] = config("precision")
@Argument(fullName = "trim_fraction", required = false)
var trimFraction: Option[Double] = config("trim_fraction")
override def cmdLine = super.cmdLine +
required("--popfile", popFile) +
required("--out", output) +
optional("--base_report", baseReportFile) +
optional("--beta_threshold", betaThreshold) +
optional("--genotype_mode", genotypeMode) +
optional("--lane_level_contamination", laneLevelContamination) +
optional("--likelihood_file", likelihoodFile) +
optional("--min_mapq", minMapQ) +
optional("--min_qscore", minQScore) +
optional("--minimum_base_count", minimumBaseCount) +
optional("--population", population) +
optional("--precision", precision) +
optional("--trim_fraction", trimFraction)
}
object ContEst {
def apply(parent: Configurable, tumorSampleBam: File, normalSampleBam: File, output: File): ContEst = {
val conest = new ContEst(parent)
conest.tumorSampleBam = tumorSampleBam
conest.normalSampleBam = normalSampleBam
conest.output = output
conest
}
}
\ No newline at end of file
......@@ -416,8 +416,9 @@ object ConfigUtils extends Logging {
Logging.addError(
"Value does not exist but is required, key: " + value.requestIndex.key +
" namespace: " + value.requestIndex.module,
if (value.requestIndex.path != Nil) " path: " + value.requestIndex.path.mkString("->")
else null
if (value.requestIndex.path != Nil)
Some(" path: " + value.requestIndex.path.mkString("->"))
else None
)
exist
}
......
......@@ -93,4 +93,10 @@ object IoUtils {
case e: IOException => false
}
}
def writeLinesToFile(output: File, lines: List[String]): Unit = {
val writer = new PrintWriter(output)
lines.foreach(writer.println(_))
writer.close()
}
}
......@@ -38,10 +38,19 @@ object Logging {
private[biopet] val errors: ListBuffer[Exception] = ListBuffer()
def addError(error: String, debug: String = null): Unit = {
val msg = error + (if (debug != null && logger.isDebugEnabled) "; " + debug else "")
logger.error(msg)
errors.append(new Exception(msg))
def addError(error: String,
debug: Option[String] = None,
cause: Option[Exception] = None): Unit = {
val msg = error + debug.map("; " + _).getOrElse("")
cause match {
case Some(e) =>
logger.error(msg, e)
errors.append(new Exception(msg, e))
case _ =>
logger.error(msg)
errors.append(new Exception(msg))
}
}
def checkErrors(debug: Boolean = false): Unit = {
......
......@@ -24,7 +24,9 @@ import nl.lumc.sasc.biopet.extensions.tools.ValidateVcf
import nl.lumc.sasc.biopet.pipelines.bammetrics.TargetRegions
import nl.lumc.sasc.biopet.pipelines.kopisu.Kopisu
import nl.lumc.sasc.biopet.pipelines.mapping.{Mapping, MultisampleMappingTrait}
import nl.lumc.sasc.biopet.pipelines.shiva.variantcallers.somatic.TumorNormalPair
import nl.lumc.sasc.biopet.pipelines.toucan.Toucan
import nl.lumc.sasc.biopet.utils.Logging
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.QScript
import org.broadinstitute.gatk.queue.function.QFunction
......@@ -59,7 +61,24 @@ class Shiva(val parent: Configurable)
override def namePrefix = "multisample"
override def configNamespace: String = "shivavariantcalling"
override def configPath: List[String] = super.configPath ::: "multisample" :: Nil
genders = samples.map { case (sampleName, sample) => sampleName -> sample.gender }
genders = samples.map { case (sampleName, s) => sampleName -> s.gender }
//TODO: this needs changed when the sample/library refactoring is beeing done
tumorSamples = samples
.filter(_._2.sampleTags.get("type").contains("tumor"))
.flatMap {
case (tumorName, tumorSample) =>
tumorSample.sampleTags.get("control") match {
case Some(normal: String) =>
if (!samples.contains(normal))
Logging.addError(s"Normal sample '$normal' does not exist")
Some(TumorNormalPair(tumorName, normal))
case _ =>
Logging.addError(s"Control is missing for tumor sample '$tumorName'")
None
}
}
.toList
} else
new ShivaVariantcalling(qscript) {
override def configNamespace = "shivavariantcalling"
......
......@@ -22,6 +22,11 @@ import nl.lumc.sasc.biopet.extensions.gatk.{CombineVariants, GenotypeConcordance
import nl.lumc.sasc.biopet.extensions.tools.VcfStats
import nl.lumc.sasc.biopet.extensions.vt.{VtDecompose, VtNormalize}
import nl.lumc.sasc.biopet.pipelines.bammetrics.TargetRegions
import nl.lumc.sasc.biopet.pipelines.shiva.variantcallers.somatic.{
MuTect2,
SomaticVariantCaller,
TumorNormalPair
}
import nl.lumc.sasc.biopet.pipelines.shiva.variantcallers.{VarscanCnsSingleSample, _}
import nl.lumc.sasc.biopet.utils.{BamUtils, Logging}
import nl.lumc.sasc.biopet.utils.config.Configurable
......@@ -51,20 +56,45 @@ class ShivaVariantcalling(val parent: Configurable)
var genders: Map[String, Gender.Value] = _
var tumorSamples: List[TumorNormalPair] = _
def isGermlineVariantCallingConfigured(): Boolean = {
callers.exists(!_.isInstanceOf[SomaticVariantCaller])
}
def isSomaticVariantCallingConfigured(): Boolean = {
callers.exists(_.isInstanceOf[SomaticVariantCaller])
}
/** Executed before script */
def init(): Unit = {
if (inputBamsArg.nonEmpty) inputBams = BamUtils.sampleBamMap(inputBamsArg)
//TODO: this needs changed when the sample/library refactoring is beeing done
if (Option(genders).isEmpty) genders = {
val samples: Map[String, Any] = config("genders", default = Map())
samples.map {
case (sampleName, gender) =>
sampleName -> (gender.toString.toLowerCase match {
case "male" => Gender.Male
case "female" => Gender.Female
case _ => Gender.Unknown
})
}
inputBams.keys.map { sampleName =>
val gender: Option[String] =
config("gender", path = "samples" :: sampleName :: "tags" :: Nil)
sampleName -> (gender match {
case Some("male") => Gender.Male
case Some("female") => Gender.Female
case _ => Gender.Unknown
})
}.toMap
}
//TODO: this needs changed when the sample/library refactoring is beeing done
if (Option(tumorSamples).isEmpty)
tumorSamples = inputBams.keys
.filter(name =>
config("type", path = "samples" :: name :: "tags" :: Nil, default = "normal").asString.toLowerCase == "tumor")
.map { tumorSample =>
val normal: String = config("normal", path = "samples" :: tumorSample :: "tags" :: Nil)
if (!inputBams.keySet.contains(normal))
Logging.addError(s"Normal sample '$normal' does not exist")
TumorNormalPair(tumorSample, normal)
}
.toList
}
var referenceVcf: Option[File] = config("reference_vcf")
......@@ -108,7 +138,10 @@ class ShivaVariantcalling(val parent: Configurable)
.callersList(this)
.map(_.name)
.mkString(", "))
if (!callers.exists(_.mergeVcfResults))
if (!isGermlineVariantCallingConfigured())
Logging.addError(
"For running the pipeline at least one germline variant caller has to be configured")
else if (!callers.exists(_.mergeVcfResults))
Logging.addError("must select at least 1 variantcaller where merge_vcf_results is true")
addAll(
......@@ -128,6 +161,11 @@ class ShivaVariantcalling(val parent: Configurable)
caller.namePrefix = namePrefix
caller.outputDir = new File(outputDir, caller.name)
caller.genders = genders
caller match {
case c: SomaticVariantCaller => c.tnPairs = tumorSamples
case _ =>
}
add(caller)
addStats(caller.outputFile, caller.name)
val normalize: Boolean =
......@@ -226,5 +264,7 @@ object ShivaVariantcalling extends PipelineCommand {
new RawVcf(root) ::
new Bcftools(root) ::
new BcftoolsSingleSample(root) ::
new VarscanCnsSingleSample(root) :: Nil
new VarscanCnsSingleSample(root) ::
new MuTect2(root) :: Nil
}
package nl.lumc.sasc.biopet.pipelines.shiva.variantcallers.somatic
import nl.lumc.sasc.biopet.extensions.bcftools.BcftoolsReheader
import nl.lumc.sasc.biopet.extensions.gatk.{BqsrGather, CombineVariants}
import nl.lumc.sasc.biopet.extensions._
import nl.lumc.sasc.biopet.utils.{IoUtils, Logging}
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.extensions.gatk.TaggedFile
class MuTect2(val parent: Configurable) extends SomaticVariantCaller {
def name = "mutect2"
override val mergeVcfResults: Boolean = false
def defaultPrio: Int = -1
lazy val runConEst: Boolean = config("run_contest", default = false)
def biopetScript(): Unit = {
if (tnPairs.isEmpty) Logging.addError("No tumor-normal found in config")
val outputFiles = for (pair <- tnPairs) yield {
val bqsrFile =
if (inputBqsrFiles.contains(pair.tumorSample) &&
inputBqsrFiles.contains(pair.normalSample)) {
val gather = new BqsrGather()
gather.inputBqsrFiles =
List(inputBqsrFiles(pair.tumorSample), inputBqsrFiles(pair.normalSample))
gather.outputBqsrFile =
new File(outputDir, s"${pair.tumorSample}-${pair.normalSample}.bqsr")
add(gather)
Some(gather.outputBqsrFile)
} else None
val outputFile =
new File(outputDir, s"${pair.tumorSample}-${pair.normalSample}.$name.vcf.gz")
val muTect2 = new gatk.MuTect2(this)
inputBams.get(pair.tumorSample).foreach(muTect2.input_file :+= TaggedFile(_, "tumor"))
inputBams.get(pair.normalSample).foreach(muTect2.input_file :+= TaggedFile(_, "normal"))
muTect2.BQSR = bqsrFile
if (runConEst) {
val namePrefix = outputFile.getAbsolutePath.stripSuffix(".vcf.gz")
val contEst = new gatk.ContEst(this)
inputBams.get(pair.tumorSample).foreach(contEst.input_file :+= _)
inputBams.get(pair.normalSample).foreach(contEst.input_file :+= _)
contEst.output = new File(s"$namePrefix.contamination.txt")
contEst.BQSR = bqsrFile
add(contEst)
val contaminationPerSample: File = new File(s"$namePrefix.contamination.short.txt")
val awk: Awk = Awk(this, "BEGIN{OFS=\"\\t\"}{if($1 != \"name\") print $1,$4;}")
awk.input = contEst.output
add(awk > contaminationPerSample)
muTect2.contaminationFile = Some(contaminationPerSample)
}
if (inputBqsrFiles.contains(pair.tumorSample) && inputBqsrFiles
.contains(pair.normalSample)) {
val gather = new BqsrGather()
gather.inputBqsrFiles =
List(inputBqsrFiles(pair.tumorSample), inputBqsrFiles(pair.normalSample))
gather.outputBqsrFile = new File(swapExt(outputFile, "vcf.gz", "bqsr.merge"))
add(gather)
muTect2.BQSR = Some(gather.outputBqsrFile)
}
outputDir.mkdirs()
val renameFile = new File(outputDir, s".rename.${pair.tumorSample}-${pair.normalSample}.txt")
IoUtils.writeLinesToFile(renameFile,
List(
s"TUMOR ${pair.tumorSample}",
s"NORMAL ${pair.normalSample}"
))
val pipe = muTect2 | BcftoolsReheader(this, renameFile) | new Bgzip(this) > outputFile
pipe.threadsCorrection = -2
add(pipe)
add(Tabix(this, outputFile))
outputFile
}
if (outputFiles.size > 1) {
add(CombineVariants(this, outputFiles, outputFile))
} else if (outputFiles.nonEmpty) {
add(Ln(this, outputFiles.head, outputFile))
add(Ln(this, outputFiles.head + ".tbi", outputFile + ".tbi"))
}
}
}
package nl.lumc.sasc.biopet.pipelines.shiva.variantcallers.somatic
import nl.lumc.sasc.biopet.pipelines.shiva.variantcallers.Variantcaller
trait SomaticVariantCaller extends Variantcaller {
var tnPairs: List[TumorNormalPair] = _
}
case class TumorNormalPair(tumorSample: String, normalSample: String)
\ No newline at end of file
......@@ -55,7 +55,7 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers {
private var dirs: List[File] = Nil
@DataProvider(name = "shivaSvCallingOptions")
def shivaSvCallingOptions = {
def shivaSvCallingOptions: Array[Array[AnyVal]] = {
val bool = Array(true, false)
(for (bams <- 0 to 3;
delly <- bool;
......@@ -69,7 +69,7 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers {
delly: Boolean,
clever: Boolean,
breakdancer: Boolean,
pindel: Boolean) = {
pindel: Boolean): Unit = {
val outputDir = ShivaSvCallingTest.outputDir
dirs :+= outputDir
val callers: ListBuffer[String] = ListBuffer()
......@@ -95,7 +95,7 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers {
pipeline.script()
val summaryCallers =
pipeline.summarySettings.get("sv_callers").get.asInstanceOf[List[String]]
pipeline.summarySettings("sv_callers").asInstanceOf[List[String]]
if (delly) assert(summaryCallers.contains("delly"))
else assert(!summaryCallers.contains("delly"))
if (clever) assert(summaryCallers.contains("clever"))
......@@ -124,7 +124,7 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers {
}
@DataProvider(name = "dellyOptions")
def dellyOptions = {
def dellyOptions: Array[Array[AnyVal]] = {
val bool = Array(true, false)
for (del <- bool;
dup <- bool;
......@@ -196,21 +196,21 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers {
pipeline.script()
val summaryCallers: List[String] =
pipeline.summarySettings.get("sv_callers").get.asInstanceOf[List[String]]
pipeline.summarySettings("sv_callers").asInstanceOf[List[String]]
assert(summaryCallers.contains("delly"))
assert(summaryCallers.contains("clever"))
assert(summaryCallers.contains("breakdancer"))
}
// remove temporary run directory all tests in the class have been run
@AfterClass def removeTempOutputDir() = {
@AfterClass def removeTempOutputDir(): Unit = {
dirs.foreach(FileUtils.deleteDirectory)
}
}
object ShivaSvCallingTest {
def outputDir = Files.createTempDir()
val inputDir = Files.createTempDir()
def outputDir: File = Files.createTempDir()
val inputDir: File = Files.createTempDir()
private def inputTouch(name: String): File = {
val file = new File(outputDir, name).getAbsoluteFile
......
......@@ -49,7 +49,7 @@ trait ShivaTestTrait extends TestNGSuite with Matchers {
}
@DataProvider(name = "shivaOptions")
def shivaOptions = {
def shivaOptions: Array[Array[Any]] = {
for (s1 <- sample1; s2 <- sample2;
realign <- realignProvider; baseRecalibration <- baseRecalibrationProvider)
yield Array("", s1, s2, realign, baseRecalibration)
......@@ -121,7 +121,7 @@ trait ShivaTestTrait extends TestNGSuite with Matchers {
numberSamples
else 0)
pipeline.functions.count(_.isInstanceOf[BaseRecalibrator]) shouldBe (if (dbsnp && baseRecalibration)
(numberLibs * 2)
numberLibs * 2
else 0)
pipeline.functions.count(_.isInstanceOf[PrintReads]) shouldBe (if (dbsnp && baseRecalibration && usePrintReads)
numberLibs
......@@ -212,9 +212,9 @@ class ShivaWithAnnotationTest extends ShivaTestTrait {
}
object ShivaTest {
def outputDir = Files.createTempDir()
def outputDir: File = Files.createTempDir()
val inputDir = Files.createTempDir()
val inputDir: File = Files.createTempDir()
def inputTouch(name: String): String = {
val file = new File(inputDir, name)
......
......@@ -25,16 +25,12 @@ import com.google.common.io.Files
import nl.lumc.sasc.biopet.core.BiopetPipe
import nl.lumc.sasc.biopet.extensions.Freebayes
import nl.lumc.sasc.biopet.extensions.bcftools.{BcftoolsCall, BcftoolsMerge}
import nl.lumc.sasc.biopet.extensions.gatk.{
CombineVariants,
GenotypeConcordance,
HaplotypeCaller,
UnifiedGenotyper
}
import nl.lumc.sasc.biopet.extensions.gatk._
import nl.lumc.sasc.biopet.utils.config.Config
import nl.lumc.sasc.biopet.extensions.tools.{MpileupToVcf, VcfFilter, VcfStats}
import nl.lumc.sasc.biopet.extensions.vt.{VtDecompose, VtNormalize}
import nl.lumc.sasc.biopet.utils.ConfigUtils
import nl.lumc.sasc.biopet.pipelines.shiva.variantcallers.somatic.TumorNormalPair
import nl.lumc.sasc.biopet.utils.{ConfigUtils, Logging}
import org.apache.commons.io.FileUtils
import org.broadinstitute.gatk.queue.QSettings
import org.scalatest.Matchers
......@@ -60,6 +56,7 @@ trait ShivaVariantcallingTestTrait extends TestNGSuite with Matchers {
}
def raw: Boolean = false
def mutect2: Boolean = false
def bcftools: Boolean = false
def bcftools_singlesample: Boolean = false
def haplotypeCallerGvcf: Boolean = false
......@@ -72,17 +69,23 @@ trait ShivaVariantcallingTestTrait extends TestNGSuite with Matchers {
def referenceVcf: Option[File] = None
def roiBedFiles: List[File] = Nil
def ampliconBedFile: Option[File] = None
def runContest: Option[Boolean] = None
def normalize = false
def decompose = false
def bamRange: List[Int] = (0 to 2).toList
def tumorNormalPairs: List[TumorNormalPair] = Nil
@DataProvider(name = "shivaVariantcallingOptions")
def shivaVariantcallingOptions = {
(for (bams <- 0 to 2)
def shivaVariantcallingOptions: Array[Array[Any]] = {
(for (bams <- bamRange)
yield
Array[Any](
bams,
raw,
mutect2,
bcftools,
bcftools_singlesample,
unifiedGenotyper,
......@@ -91,7 +94,8 @@ trait ShivaVariantcallingTestTrait extends TestNGSuite with Matchers {
haplotypeCallerAllele,
unifiedGenotyperAllele,
freebayes,
varscanCnsSinglesample
varscanCnsSinglesample,
tumorNormalPairs
)).toArray
}
......@@ -100,6 +104,7 @@ trait ShivaVariantcallingTestTrait extends TestNGSuite with Matchers {
@Test(dataProvider = "shivaVariantcallingOptions")
def testShivaVariantcalling(bams: Int,
raw: Boolean,
mutect2: Boolean,
bcftools: Boolean,
bcftoolsSinglesample: Boolean,
unifiedGenotyper: Boolean,
......@@ -108,10 +113,13 @@ trait ShivaVariantcallingTestTrait extends TestNGSuite with Matchers {
haplotypeCallerAllele: Boolean,
unifiedGenotyperAllele: Boolean,
freebayes: Boolean,
varscanCnsSinglesample: Boolean) = {
varscanCnsSinglesample: Boolean,
tumorNormalPairs: List[TumorNormalPair]): Unit = {
val outputDir = ShivaVariantcallingTest.outputDir
dirs :+= outputDir
val callers: ListBuffer[String] = ListBuffer()
if (raw) callers.append("raw")
if (mutect2) callers.append("mutect2")
if (bcftools) callers.append("bcftools")
if (bcftoolsSinglesample) callers.append("bcftools_singlesample")
if (unifiedGenotyper) callers.append("unifiedgenotyper")
......@@ -121,25 +129,34 @@ trait ShivaVariantcallingTestTrait extends TestNGSuite with Matchers {
if (haplotypeCaller) callers.append("haplotypecaller")
if (freebayes) callers.append("freebayes")
if (varscanCnsSinglesample) callers.append("varscan_cns_singlesample")
val map = Map(
val sampleTags: Map[String, Any] = tumorNormalPairs.foldLeft(Map[String, Any]()) {