diff --git a/bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala b/bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala index 881302e8a49304464ac1fab579c7460a758647ea..cde4ba97f41465c9d040b28fed6bcfa9d0cd95e4 100644 --- a/bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala +++ b/bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala @@ -284,6 +284,9 @@ object BammetricsReport extends ReportBuilder { .getOrElse(throw new IllegalStateException("Sample must be there")) val libraryName = library.flatMap(l => Await.result(summary.getLibraryName(l), Duration.Inf)) + if (yKeyList.find(x => map.contains(x) && map(x).isDefined).isEmpty) { + "" + } val yKey = yKeyList.find(x => map.contains(x) && map(x).isDefined).get val xKey = xKeyList.find(x => map.contains(x) && map(x).isDefined).get Map( diff --git a/biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/FastqSync.scala b/biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/FastqSync.scala index b8561eab6981ccd2aaf45b414a6897ca4ab6b7e1..3ccdb11c212d294536ab4e3f338b801a22707d5c 100644 --- a/biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/FastqSync.scala +++ b/biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/FastqSync.scala @@ -16,7 +16,7 @@ package nl.lumc.sasc.biopet.extensions.tools import java.io.File -import nl.lumc.sasc.biopet.core.{BiopetCommandLineFunction, ToolCommandFunction} +import nl.lumc.sasc.biopet.core.ToolCommandFunction import nl.lumc.sasc.biopet.core.summary.Summarizable import nl.lumc.sasc.biopet.utils.config.Configurable import org.broadinstitute.gatk.utils.commandline.{Input, Output} @@ -35,7 +35,11 @@ class FastqSync(val parent: Configurable) extends ToolCommandFunction with Summa /** Original FASTQ file (read 1 or 2) */ @Input(required = true) - var refFastq: File = _ + var refFastq1: File = _ + + /** Original FASTQ file (read 1 or 2) */ + @Input(required = true) + var refFastq2: File = _ /** "Input read 1 FASTQ file" */ @Input(required = true) @@ -61,7 +65,8 @@ class FastqSync(val parent: Configurable) extends ToolCommandFunction with Summa override def cmdLine: String = super.cmdLine + - required("-r", refFastq) + + required("-r", refFastq1) + + required("--ref2", refFastq2) + required("-i", inputFastq1) + required("-j", inputFastq2) + required("-o", outputFastq1) + diff --git a/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/CommandLineGATK.scala b/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/CommandLineGATK.scala index 0b1c8e840095d613b145d01d3689e2c95e40a4e6..0862e6f9639db2b71917b5809740edb432cea17b 100644 --- a/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/CommandLineGATK.scala +++ b/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/CommandLineGATK.scala @@ -420,11 +420,3 @@ trait CommandLineGATK extends BiopetJavaCommandLineFunction with Reference with optional("-l", logging_level) + optional("-log", log_to_file) } - -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 diff --git a/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/ContEst.scala b/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/ContEst.scala index 02b7f6fd34754476f44e5eb11591937b7d146d3a..82f7385ca662b20b6f41106bec9b2712f622aad7 100644 --- a/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/ContEst.scala +++ b/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/ContEst.scala @@ -2,29 +2,13 @@ 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: File = input_file.find(file => isFileWithTag(file, "eval")).orNull - 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: File = input_file.find(file => isFileWithTag(file, "genotype")).orNull - 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") @@ -89,13 +73,3 @@ class ContEst(val parent: Configurable) extends CommandLineGATK { 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 diff --git a/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/FastqSync.scala b/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/FastqSync.scala index 7c088c8eafa642f6cf613c0e987759563640fce1..8b1897ea715d18d10a005db067ffd7c9ef34bf34 100644 --- a/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/FastqSync.scala +++ b/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/FastqSync.scala @@ -24,12 +24,13 @@ import scala.collection.JavaConverters._ object FastqSync extends ToolCommand { - /** Regex for capturing read ID ~ taking into account its read pair mark (if present) */ - private val idRegex = """[_/][12]$""".r - /** Implicit class to allow for lazy retrieval of FastqRecord ID without any read pair mark */ private implicit class FastqPair(fq: FastqRecord) { - lazy val fragId: String = idRegex.split(fq.getReadHeader.split(" ")(0))(0) + lazy val fragId: String = fq.getReadHeader.split(" ").head match { + case x if x.endsWith(idSufixes._1) => x.stripSuffix(idSufixes._1) + case x if x.endsWith(idSufixes._2) => x.stripSuffix(idSufixes._2) + case x => x + } } /** @@ -106,11 +107,12 @@ object FastqSync extends ToolCommand { (numDiscA, numDiscB, numKept) } - case class Args(refFastq: File = new File(""), - inputFastq1: File = new File(""), - inputFastq2: File = new File(""), - outputFastq1: File = new File(""), - outputFastq2: File = new File("")) + case class Args(refFastq1: File = null, + refFastq2: File = null, + inputFastq1: File = null, + inputFastq2: File = null, + outputFastq1: File = null, + outputFastq2: File = null) extends AbstractArgs class OptParser extends AbstractOptParser { @@ -122,29 +124,35 @@ object FastqSync extends ToolCommand { |file will be gzipped when the input is also gzipped. """.stripMargin) - opt[File]('r', "ref") required () valueName "" action { (x, c) => - c.copy(refFastq = x) + opt[File]('r', "ref1") unbounded () required () valueName "" action { (x, c) => + c.copy(refFastq1 = x) } validate { x => if (x.exists) success else failure("Reference FASTQ file not found") - } text "Reference FASTQ file" + } text "Reference R1 FASTQ file" - opt[File]('i', "in1") required () valueName "" action { (x, c) => + opt[File]("ref2") unbounded () required () valueName "" action { (x, c) => + c.copy(refFastq2 = x) + } validate { x => + if (x.exists) success else failure("Reference FASTQ file not found") + } text "Reference R2 FASTQ file" + + opt[File]('i', "in1") unbounded () required () valueName "" action { (x, c) => c.copy(inputFastq1 = x) } validate { x => if (x.exists) success else failure("Input FASTQ file 1 not found") } text "Input FASTQ file 1" - opt[File]('j', "in2") required () valueName "" action { (x, c) => + opt[File]('j', "in2") unbounded () required () valueName "" action { (x, c) => c.copy(inputFastq2 = x) } validate { x => if (x.exists) success else failure("Input FASTQ file 2 not found") } text "Input FASTQ file 2" - opt[File]('o', "out1") required () valueName "" action { (x, c) => + opt[File]('o', "out1") unbounded () required () valueName "" action { (x, c) => c.copy(outputFastq1 = x) } text "Output FASTQ file 1" - opt[File]('p', "out2") required () valueName "" action { (x, c) => + opt[File]('p', "out2") unbounded () required () valueName "" action { (x, c) => c.copy(outputFastq2 = x) } text "Output FASTQ file 2" } @@ -164,7 +172,9 @@ object FastqSync extends ToolCommand { val commandArgs: Args = parseArgs(args) - val refReader = new FastqReader(commandArgs.refFastq) + idSufixes = findR1R2Suffixes(commandArgs.refFastq1, commandArgs.refFastq2) + + val refReader = new FastqReader(commandArgs.refFastq1) val AReader = new FastqReader(commandArgs.inputFastq1) val BReader = new FastqReader(commandArgs.inputFastq2) val AWriter = new AsyncFastqWriter(new BasicFastqWriter(commandArgs.outputFastq1), 3000) @@ -183,4 +193,28 @@ object FastqSync extends ToolCommand { BWriter.close() } } + + /** + * This method will look up the unique suffix for R1 and R2 + * + * @param fastqR1 input R1 file + * @param fastqR2 Input R2 file + * @return suffix for (R1, R2) + */ + def findR1R2Suffixes(fastqR1: File, fastqR2: File): (String, String) = { + val refReader1 = new FastqReader(fastqR1) + val refReader2 = new FastqReader(fastqR2) + val r1Name = refReader1.next().getReadHeader.split(" ").head + val r2Name = refReader2.next().getReadHeader.split(" ").head + refReader1.close() + refReader2.close() + + val genericName = new String(r1Name.zip(r2Name).takeWhile(x => x._1 == x._2).map(_._1).toArray) + + (r1Name.stripPrefix(genericName), r2Name.stripPrefix(genericName)) + } + + /** Regex for capturing read ID ~ taking into account its read pair mark (if present) */ + private[tools] var idSufixes: (String, String) = _ + } diff --git a/biopet-tools/src/test/scala/nl/lumc/sasc/biopet/tools/FastqSyncTest.scala b/biopet-tools/src/test/scala/nl/lumc/sasc/biopet/tools/FastqSyncTest.scala index cf998ec905f6a6d4f7894bc217e717be4bd27679..56b1a32150689d7b25cbe776b8c7473584f40aa0 100644 --- a/biopet-tools/src/test/scala/nl/lumc/sasc/biopet/tools/FastqSyncTest.scala +++ b/biopet-tools/src/test/scala/nl/lumc/sasc/biopet/tools/FastqSyncTest.scala @@ -59,6 +59,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { bMock: FastqReader, aOutMock: AsyncFastqWriter, bOutMock: AsyncFastqWriter): Unit = { + FastqSync.idSufixes = ("/1", "/2") when(refMock.iterator) thenReturn recordsOver("1", "2", "3") when(aMock.iterator) thenReturn recordsOver("1", "2", "3") @@ -105,6 +106,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { bMock: FastqReader, aOutMock: AsyncFastqWriter, bOutMock: AsyncFastqWriter): Unit = { + FastqSync.idSufixes = ("/1", "/2") when(refMock.iterator) thenReturn recordsOver("1", "2", "3") when(aMock.iterator) thenReturn recordsOver() @@ -123,6 +125,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { bMock: FastqReader, aOutMock: AsyncFastqWriter, bOutMock: AsyncFastqWriter): Unit = { + FastqSync.idSufixes = ("/1", "/2") when(refMock.iterator) thenReturn recordsOver("1", "2", "3") when(aMock.iterator) thenReturn recordsOver("1", "2", "3") @@ -141,6 +144,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { bMock: FastqReader, aOutMock: AsyncFastqWriter, bOutMock: AsyncFastqWriter): Unit = { + FastqSync.idSufixes = ("/1", "/2") when(refMock.iterator) thenReturn recordsOver("1", "2", "3") when(aMock.iterator) thenReturn recordsOver("2", "3") @@ -168,6 +172,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { bMock: FastqReader, aOutMock: AsyncFastqWriter, bOutMock: AsyncFastqWriter): Unit = { + FastqSync.idSufixes = ("/1", "/2") when(refMock.iterator) thenReturn recordsOver("1", "2", "3") when(aMock.iterator) thenReturn recordsOver("1", "2", "3") @@ -195,6 +200,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { bMock: FastqReader, aOutMock: AsyncFastqWriter, bOutMock: AsyncFastqWriter): Unit = { + FastqSync.idSufixes = ("/1", "/2") when(refMock.iterator) thenReturn recordsOver("1", "2", "3") when(aMock.iterator) thenReturn recordsOver("2", "3") @@ -245,6 +251,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { bMock: FastqReader, aOutMock: AsyncFastqWriter, bOutMock: AsyncFastqWriter): Unit = { + FastqSync.idSufixes = ("/1", "/2") when(refMock.iterator) thenReturn recordsOver("1/1", "2/1", "3/1") when(aMock.iterator) thenReturn recordsOver("2/1", "3/1") @@ -267,6 +274,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { bMock: FastqReader, aOutMock: AsyncFastqWriter, bOutMock: AsyncFastqWriter): Unit = { + FastqSync.idSufixes = ("_1", "_2") when(refMock.iterator) thenReturn recordsOver("1_1", "2_1", "3_1") when(aMock.iterator) thenReturn recordsOver("2_1", "3_1") @@ -289,6 +297,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { bMock: FastqReader, aOutMock: AsyncFastqWriter, bOutMock: AsyncFastqWriter): Unit = { + FastqSync.idSufixes = ("/1", "/2") when(refMock.iterator) thenReturn recordsOver("1 desc1b", "2 desc2b", "3 desc3b") when(aMock.iterator) thenReturn recordsOver("2 desc2a", "3 desc3a") @@ -311,6 +320,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { bMock: FastqReader, aOutMock: AsyncFastqWriter, bOutMock: AsyncFastqWriter): Unit = { + FastqSync.idSufixes = ("/1", "/2") when(refMock.iterator) thenReturn recordsOver("1/2 yep", "2/2 yep", @@ -338,6 +348,8 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { val args = Array( "-r", resourcePath("/paired01a.fq"), + "--ref2", + resourcePath("/paired01b.fq"), "-i", resourcePath("/paired01a.fq"), "-j", @@ -348,10 +360,34 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { "/tmp/mockout2.fq" ) val parsed = parseArgs(args) - parsed.refFastq shouldBe resourceFile("/paired01a.fq") + parsed.refFastq1 shouldBe resourceFile("/paired01a.fq") parsed.inputFastq1 shouldBe resourceFile("/paired01a.fq") parsed.inputFastq2 shouldBe resourceFile("/paired01b.fq") parsed.outputFastq1 shouldBe new File("/tmp/mockout1.fq") parsed.outputFastq2 shouldBe new File("/tmp/mockout2.fq") } + + @Test + def testMain: Unit = { + val r1Output = File.createTempFile("temp.", ".fq") + r1Output.deleteOnExit() + val r2Output = File.createTempFile("temp.", ".fq") + r2Output.deleteOnExit() + val args = Array( + "-r", + resourcePath("/paired01a.fq"), + "--ref2", + resourcePath("/paired01b.fq"), + "-i", + resourcePath("/paired01a.fq"), + "-j", + resourcePath("/paired01b.fq"), + "-o", + r1Output.getAbsolutePath, + "-p", + r2Output.getAbsolutePath + ) + + FastqSync.main(args) + } } diff --git a/docs/pipelines/multisample/shiva.md b/docs/pipelines/multisample/shiva.md index ae13bf30fe631e72562cc271ebf8e20c13fa84b1..c070de80e526c6460071853a2436f4e3dff6518a 100644 --- a/docs/pipelines/multisample/shiva.md +++ b/docs/pipelines/multisample/shiva.md @@ -82,6 +82,10 @@ unifiedgenotyper: ## Supported variant callers At this moment the following variant callers can be used +##### Germline + +When doing variant calling most often germline is used. This will detect variants based on the assumption that there is a fixed number of alleles. Mostly the default used is a ploidy of 2. When this assumption does not hold for your data, somatic variant calling can be a better solution. + | ConfigName | Tool | Description | | ---------- | ---- | ----------- | | haplotypecaller_gvcf | haplotypecaller | Running HaplotypeCaller in gvcf mode | @@ -95,6 +99,31 @@ At this moment the following variant callers can be used | bcftools_singlesample | bcftools | | | varscan_cns_singlesample | varscan | | +##### Somatic + +In contrast to germline variant calling, somatic variant calling does not have a direct assumption about the number of alleles. Some can also take a control into account, like MuTect2. Having a control is useful when analysing tumor samples. + +| ConfigName | Tool | Description | +| ---------- | ---- | ----------- | +| mutect2 | MuTect2 | Running mutect2, requires tumor normal pairs | +| varscan_cns_singlesample | varscan | | +| raw | [Naive variant caller](../../tools/MpileupToVcf) | | + +###### Config for tumor-normal pairs + +To define the tumor-normal pairs, the config can look like this: + +```yaml +samples: + sample1: + tags: + type: tumor + normal: sample2 + sample2: + tags: + type: normal +``` + ## Config options ### Required settings diff --git a/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala b/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala index 4a896b93d525245b4888555ca12c2a89259b0bfa..397d8f480787a2fa49af679acb501f26d7fbb6fe 100644 --- a/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala +++ b/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala @@ -208,7 +208,8 @@ class Flexiprep(val parent: Configurable) qcCmdR2.compress = false val fqSync = new FastqSync(this) - fqSync.refFastq = R1_in + fqSync.refFastq1 = R1_in + fqSync.refFastq2 = R2_in.get fqSync.inputFastq1 = qcCmdR1.output fqSync.inputFastq2 = qcCmdR2.output fqSync.outputFastq1 = new File(outDir, fastqR1Qc.getName) diff --git a/mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/MultisampleMapping.scala b/mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/MultisampleMapping.scala index 9bcb1462055e9e84aa9a7d259afc2af42ca52583..c7eb17649747efdc2416c7a5593a9ababec082fb 100644 --- a/mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/MultisampleMapping.scala +++ b/mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/MultisampleMapping.scala @@ -120,8 +120,8 @@ trait MultisampleMappingTrait extends MultiSampleQScript with Reference { qscrip lazy val inputR1: Option[File] = MultisampleMapping.fileMustBeAbsolute(config("R1")) lazy val inputR2: Option[File] = MultisampleMapping.fileMustBeAbsolute(config("R2")) - lazy val qcFastqR1 = mapping.map(_.flexiprep.fastqR1Qc) - lazy val qcFastqR2 = mapping.flatMap(_.flexiprep.fastqR2Qc) + lazy val qcFastqR1: Option[File] = mapping.map(_.flexiprep.fastqR1Qc) + lazy val qcFastqR2: Option[File] = mapping.flatMap(_.flexiprep.fastqR2Qc) lazy val inputBam: Option[File] = MultisampleMapping.fileMustBeAbsolute(if (inputR1.isEmpty) config("bam") else None) lazy val bamToFastq: Boolean = config("bam_to_fastq", default = false) @@ -229,17 +229,19 @@ trait MultisampleMappingTrait extends MultiSampleQScript with Reference { qscrip qscript.add(aorrg) } } else add(Ln.linkBamFile(qscript, inputBam.get, bamFile.get): _*) + } + if (!bamToFastq) { val bamMetrics = new BamMetrics(qscript) bamMetrics.sampleId = Some(sampleId) bamMetrics.libId = Some(libId) bamMetrics.inputBam = bamFile.get bamMetrics.outputDir = new File(libDir, "metrics") - bamMetrics.paired = inputR2.isDefined + bamMetrics.paired = inputR2.isDefined || inputBam.isDefined add(bamMetrics) - - if (config("execute_bam2wig", default = true)) add(Bam2Wig(qscript, bamFile.get)) } + if (config("execute_bam2wig", default = true)) add(Bam2Wig(qscript, bamFile.get)) + } else logger.warn(s"Sample '$sampleId' does not have any input files") } } @@ -340,7 +342,8 @@ trait MultisampleMappingTrait extends MultiSampleQScript with Reference { qscrip bamMetrics.sampleId = Some(sampleId) bamMetrics.inputBam = if (metricsPreprogressBam) preProcessBam.get else bamFile.get bamMetrics.outputDir = new File(sampleDir, "metrics") - bamMetrics.paired = libraries.exists(_._2.inputR1.isDefined) + bamMetrics.paired = + libraries.exists(x => x._2.inputR1.isDefined || x._2.inputBam.isDefined) add(bamMetrics) if (config("execute_bam2wig", default = true)) add(Bam2Wig(qscript, preProcessBam.get)) diff --git a/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcalling.scala b/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcalling.scala index 658b298234570b6b2c0377befacd8ab73321413b..a2c62ebe19b524ed90e8b10018ecc6ee93ef62ad 100644 --- a/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcalling.scala +++ b/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcalling.scala @@ -242,7 +242,9 @@ class ShivaVariantcalling(val parent: Configurable) def summarySettings = Map( "variantcallers" -> configCallers.toList, "regions_of_interest" -> roiBedFiles.map(_.getName), - "amplicon_bed" -> ampliconBedFile.map(_.getAbsolutePath) + "amplicon_bed" -> ampliconBedFile.map(_.getAbsolutePath), + "somatic_variant_calling" -> isSomaticVariantCallingConfigured, + "germline_variant_calling" -> isGermlineVariantCallingConfigured ) /** Files for the summary */ diff --git a/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/variantcallers/somatic/MuTect2.scala b/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/variantcallers/somatic/MuTect2.scala index 75e6f4553c1e2abaf108ae905986d312ae06b6d2..c3d4f3bda6b0adc0709db3f144651c47b8b40a15 100644 --- a/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/variantcallers/somatic/MuTect2.scala +++ b/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/variantcallers/somatic/MuTect2.scala @@ -47,8 +47,8 @@ class MuTect2(val parent: Configurable) extends SomaticVariantCaller { 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 :+= _) + inputBams.get(pair.tumorSample).foreach(contEst.input_file :+= TaggedFile(_, "eval")) + inputBams.get(pair.normalSample).foreach(contEst.input_file :+= TaggedFile(_, "genotype")) contEst.output = new File(s"$namePrefix.contamination.txt") contEst.BQSR = bqsrFile add(contEst) diff --git a/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala b/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala index c103224bda5422e5dfc892c4294e9233a47fd2ee..d19708186344d9ccd0e19750d4fc42be1cd5c874 100644 --- a/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala +++ b/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala @@ -19,7 +19,7 @@ */ package nl.lumc.sasc.biopet.pipelines.shiva -import java.io.{File, FileOutputStream} +import java.io.{File, FileOutputStream, IOException} import com.google.common.io.Files import nl.lumc.sasc.biopet.core.BiopetPipe @@ -208,8 +208,15 @@ trait ShivaVariantcallingTestTrait extends TestNGSuite with Matchers { } // remove temporary run directory all tests in the class have been run - @AfterClass def removeTempOutputDir(): Unit = { - dirs.foreach(FileUtils.deleteDirectory) + @AfterClass def removeTempOutputDir() = { + dirs.filter(_.exists()).foreach { dir => + try { + FileUtils.deleteDirectory(dir) + } catch { + case e: IOException if e.getMessage.startsWith("Unable to delete directory") => + Logging.logger.error(e.getMessage) + } + } } }