Commit 03beb3f1 authored by Peter van 't Hof's avatar Peter van 't Hof

Merge remote-tracking branch 'remotes/origin/develop' into fix-BIOPET-753

parents afa1608d 5d3b5448
...@@ -284,6 +284,9 @@ object BammetricsReport extends ReportBuilder { ...@@ -284,6 +284,9 @@ object BammetricsReport extends ReportBuilder {
.getOrElse(throw new IllegalStateException("Sample must be there")) .getOrElse(throw new IllegalStateException("Sample must be there"))
val libraryName = val libraryName =
library.flatMap(l => Await.result(summary.getLibraryName(l), Duration.Inf)) 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 yKey = yKeyList.find(x => map.contains(x) && map(x).isDefined).get
val xKey = xKeyList.find(x => map.contains(x) && map(x).isDefined).get val xKey = xKeyList.find(x => map.contains(x) && map(x).isDefined).get
Map( Map(
......
...@@ -16,7 +16,7 @@ package nl.lumc.sasc.biopet.extensions.tools ...@@ -16,7 +16,7 @@ package nl.lumc.sasc.biopet.extensions.tools
import java.io.File 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.core.summary.Summarizable
import nl.lumc.sasc.biopet.utils.config.Configurable import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Input, Output} import org.broadinstitute.gatk.utils.commandline.{Input, Output}
...@@ -35,7 +35,11 @@ class FastqSync(val parent: Configurable) extends ToolCommandFunction with Summa ...@@ -35,7 +35,11 @@ class FastqSync(val parent: Configurable) extends ToolCommandFunction with Summa
/** Original FASTQ file (read 1 or 2) */ /** Original FASTQ file (read 1 or 2) */
@Input(required = true) @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 read 1 FASTQ file" */
@Input(required = true) @Input(required = true)
...@@ -61,7 +65,8 @@ class FastqSync(val parent: Configurable) extends ToolCommandFunction with Summa ...@@ -61,7 +65,8 @@ class FastqSync(val parent: Configurable) extends ToolCommandFunction with Summa
override def cmdLine: String = override def cmdLine: String =
super.cmdLine + super.cmdLine +
required("-r", refFastq) + required("-r", refFastq1) +
required("--ref2", refFastq2) +
required("-i", inputFastq1) + required("-i", inputFastq1) +
required("-j", inputFastq2) + required("-j", inputFastq2) +
required("-o", outputFastq1) + required("-o", outputFastq1) +
......
...@@ -420,11 +420,3 @@ trait CommandLineGATK extends BiopetJavaCommandLineFunction with Reference with ...@@ -420,11 +420,3 @@ trait CommandLineGATK extends BiopetJavaCommandLineFunction with Reference with
optional("-l", logging_level) + optional("-l", logging_level) +
optional("-log", log_to_file) 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
...@@ -2,29 +2,13 @@ package nl.lumc.sasc.biopet.extensions.gatk ...@@ -2,29 +2,13 @@ package nl.lumc.sasc.biopet.extensions.gatk
import java.io.File import java.io.File
import nl.lumc.sasc.biopet.extensions.gatk.CommandLineGATK.isFileWithTag
import nl.lumc.sasc.biopet.utils.config.Configurable 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} import org.broadinstitute.gatk.utils.commandline.{Argument, Input, Output}
class ContEst(val parent: Configurable) extends CommandLineGATK { class ContEst(val parent: Configurable) extends CommandLineGATK {
def analysis_type: String = "ContEst" 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. */ /** Variant file containing information about the population allele frequencies. */
@Input(fullName = "popfile", shortName="pf", required = true) @Input(fullName = "popfile", shortName="pf", required = true)
var popFile: File = config("popfile") var popFile: File = config("popfile")
...@@ -89,13 +73,3 @@ class ContEst(val parent: Configurable) extends CommandLineGATK { ...@@ -89,13 +73,3 @@ class ContEst(val parent: Configurable) extends CommandLineGATK {
optional("--trim_fraction", trimFraction) 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
...@@ -24,12 +24,13 @@ import scala.collection.JavaConverters._ ...@@ -24,12 +24,13 @@ import scala.collection.JavaConverters._
object FastqSync extends ToolCommand { 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 */ /** Implicit class to allow for lazy retrieval of FastqRecord ID without any read pair mark */
private implicit class FastqPair(fq: FastqRecord) { 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 { ...@@ -106,11 +107,12 @@ object FastqSync extends ToolCommand {
(numDiscA, numDiscB, numKept) (numDiscA, numDiscB, numKept)
} }
case class Args(refFastq: File = new File(""), case class Args(refFastq1: File = null,
inputFastq1: File = new File(""), refFastq2: File = null,
inputFastq2: File = new File(""), inputFastq1: File = null,
outputFastq1: File = new File(""), inputFastq2: File = null,
outputFastq2: File = new File("")) outputFastq1: File = null,
outputFastq2: File = null)
extends AbstractArgs extends AbstractArgs
class OptParser extends AbstractOptParser { class OptParser extends AbstractOptParser {
...@@ -122,29 +124,35 @@ object FastqSync extends ToolCommand { ...@@ -122,29 +124,35 @@ object FastqSync extends ToolCommand {
|file will be gzipped when the input is also gzipped. |file will be gzipped when the input is also gzipped.
""".stripMargin) """.stripMargin)
opt[File]('r', "ref") required () valueName "<fastq>" action { (x, c) => opt[File]('r', "ref1") unbounded () required () valueName "<fastq>" action { (x, c) =>
c.copy(refFastq = x) c.copy(refFastq1 = x)
} validate { x => } validate { x =>
if (x.exists) success else failure("Reference FASTQ file not found") 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 "<fastq>" action { (x, c) => opt[File]("ref2") unbounded () required () valueName "<fastq>" 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 "<fastq>" action { (x, c) =>
c.copy(inputFastq1 = x) c.copy(inputFastq1 = x)
} validate { x => } validate { x =>
if (x.exists) success else failure("Input FASTQ file 1 not found") if (x.exists) success else failure("Input FASTQ file 1 not found")
} text "Input FASTQ file 1" } text "Input FASTQ file 1"
opt[File]('j', "in2") required () valueName "<fastq[.gz]>" action { (x, c) => opt[File]('j', "in2") unbounded () required () valueName "<fastq[.gz]>" action { (x, c) =>
c.copy(inputFastq2 = x) c.copy(inputFastq2 = x)
} validate { x => } validate { x =>
if (x.exists) success else failure("Input FASTQ file 2 not found") if (x.exists) success else failure("Input FASTQ file 2 not found")
} text "Input FASTQ file 2" } text "Input FASTQ file 2"
opt[File]('o', "out1") required () valueName "<fastq[.gz]>" action { (x, c) => opt[File]('o', "out1") unbounded () required () valueName "<fastq[.gz]>" action { (x, c) =>
c.copy(outputFastq1 = x) c.copy(outputFastq1 = x)
} text "Output FASTQ file 1" } text "Output FASTQ file 1"
opt[File]('p', "out2") required () valueName "<fastq>" action { (x, c) => opt[File]('p', "out2") unbounded () required () valueName "<fastq>" action { (x, c) =>
c.copy(outputFastq2 = x) c.copy(outputFastq2 = x)
} text "Output FASTQ file 2" } text "Output FASTQ file 2"
} }
...@@ -164,7 +172,9 @@ object FastqSync extends ToolCommand { ...@@ -164,7 +172,9 @@ object FastqSync extends ToolCommand {
val commandArgs: Args = parseArgs(args) 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 AReader = new FastqReader(commandArgs.inputFastq1)
val BReader = new FastqReader(commandArgs.inputFastq2) val BReader = new FastqReader(commandArgs.inputFastq2)
val AWriter = new AsyncFastqWriter(new BasicFastqWriter(commandArgs.outputFastq1), 3000) val AWriter = new AsyncFastqWriter(new BasicFastqWriter(commandArgs.outputFastq1), 3000)
...@@ -183,4 +193,28 @@ object FastqSync extends ToolCommand { ...@@ -183,4 +193,28 @@ object FastqSync extends ToolCommand {
BWriter.close() 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) = _
} }
...@@ -59,6 +59,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -59,6 +59,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers {
bMock: FastqReader, bMock: FastqReader,
aOutMock: AsyncFastqWriter, aOutMock: AsyncFastqWriter,
bOutMock: AsyncFastqWriter): Unit = { bOutMock: AsyncFastqWriter): Unit = {
FastqSync.idSufixes = ("/1", "/2")
when(refMock.iterator) thenReturn recordsOver("1", "2", "3") when(refMock.iterator) thenReturn recordsOver("1", "2", "3")
when(aMock.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 { ...@@ -105,6 +106,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers {
bMock: FastqReader, bMock: FastqReader,
aOutMock: AsyncFastqWriter, aOutMock: AsyncFastqWriter,
bOutMock: AsyncFastqWriter): Unit = { bOutMock: AsyncFastqWriter): Unit = {
FastqSync.idSufixes = ("/1", "/2")
when(refMock.iterator) thenReturn recordsOver("1", "2", "3") when(refMock.iterator) thenReturn recordsOver("1", "2", "3")
when(aMock.iterator) thenReturn recordsOver() when(aMock.iterator) thenReturn recordsOver()
...@@ -123,6 +125,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -123,6 +125,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers {
bMock: FastqReader, bMock: FastqReader,
aOutMock: AsyncFastqWriter, aOutMock: AsyncFastqWriter,
bOutMock: AsyncFastqWriter): Unit = { bOutMock: AsyncFastqWriter): Unit = {
FastqSync.idSufixes = ("/1", "/2")
when(refMock.iterator) thenReturn recordsOver("1", "2", "3") when(refMock.iterator) thenReturn recordsOver("1", "2", "3")
when(aMock.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 { ...@@ -141,6 +144,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers {
bMock: FastqReader, bMock: FastqReader,
aOutMock: AsyncFastqWriter, aOutMock: AsyncFastqWriter,
bOutMock: AsyncFastqWriter): Unit = { bOutMock: AsyncFastqWriter): Unit = {
FastqSync.idSufixes = ("/1", "/2")
when(refMock.iterator) thenReturn recordsOver("1", "2", "3") when(refMock.iterator) thenReturn recordsOver("1", "2", "3")
when(aMock.iterator) thenReturn recordsOver("2", "3") when(aMock.iterator) thenReturn recordsOver("2", "3")
...@@ -168,6 +172,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -168,6 +172,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers {
bMock: FastqReader, bMock: FastqReader,
aOutMock: AsyncFastqWriter, aOutMock: AsyncFastqWriter,
bOutMock: AsyncFastqWriter): Unit = { bOutMock: AsyncFastqWriter): Unit = {
FastqSync.idSufixes = ("/1", "/2")
when(refMock.iterator) thenReturn recordsOver("1", "2", "3") when(refMock.iterator) thenReturn recordsOver("1", "2", "3")
when(aMock.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 { ...@@ -195,6 +200,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers {
bMock: FastqReader, bMock: FastqReader,
aOutMock: AsyncFastqWriter, aOutMock: AsyncFastqWriter,
bOutMock: AsyncFastqWriter): Unit = { bOutMock: AsyncFastqWriter): Unit = {
FastqSync.idSufixes = ("/1", "/2")
when(refMock.iterator) thenReturn recordsOver("1", "2", "3") when(refMock.iterator) thenReturn recordsOver("1", "2", "3")
when(aMock.iterator) thenReturn recordsOver("2", "3") when(aMock.iterator) thenReturn recordsOver("2", "3")
...@@ -245,6 +251,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -245,6 +251,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers {
bMock: FastqReader, bMock: FastqReader,
aOutMock: AsyncFastqWriter, aOutMock: AsyncFastqWriter,
bOutMock: AsyncFastqWriter): Unit = { bOutMock: AsyncFastqWriter): Unit = {
FastqSync.idSufixes = ("/1", "/2")
when(refMock.iterator) thenReturn recordsOver("1/1", "2/1", "3/1") when(refMock.iterator) thenReturn recordsOver("1/1", "2/1", "3/1")
when(aMock.iterator) thenReturn recordsOver("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 { ...@@ -267,6 +274,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers {
bMock: FastqReader, bMock: FastqReader,
aOutMock: AsyncFastqWriter, aOutMock: AsyncFastqWriter,
bOutMock: AsyncFastqWriter): Unit = { bOutMock: AsyncFastqWriter): Unit = {
FastqSync.idSufixes = ("_1", "_2")
when(refMock.iterator) thenReturn recordsOver("1_1", "2_1", "3_1") when(refMock.iterator) thenReturn recordsOver("1_1", "2_1", "3_1")
when(aMock.iterator) thenReturn recordsOver("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 { ...@@ -289,6 +297,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers {
bMock: FastqReader, bMock: FastqReader,
aOutMock: AsyncFastqWriter, aOutMock: AsyncFastqWriter,
bOutMock: AsyncFastqWriter): Unit = { bOutMock: AsyncFastqWriter): Unit = {
FastqSync.idSufixes = ("/1", "/2")
when(refMock.iterator) thenReturn recordsOver("1 desc1b", "2 desc2b", "3 desc3b") when(refMock.iterator) thenReturn recordsOver("1 desc1b", "2 desc2b", "3 desc3b")
when(aMock.iterator) thenReturn recordsOver("2 desc2a", "3 desc3a") when(aMock.iterator) thenReturn recordsOver("2 desc2a", "3 desc3a")
...@@ -311,6 +320,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -311,6 +320,7 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers {
bMock: FastqReader, bMock: FastqReader,
aOutMock: AsyncFastqWriter, aOutMock: AsyncFastqWriter,
bOutMock: AsyncFastqWriter): Unit = { bOutMock: AsyncFastqWriter): Unit = {
FastqSync.idSufixes = ("/1", "/2")
when(refMock.iterator) thenReturn recordsOver("1/2 yep", when(refMock.iterator) thenReturn recordsOver("1/2 yep",
"2/2 yep", "2/2 yep",
...@@ -338,6 +348,8 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -338,6 +348,8 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers {
val args = Array( val args = Array(
"-r", "-r",
resourcePath("/paired01a.fq"), resourcePath("/paired01a.fq"),
"--ref2",
resourcePath("/paired01b.fq"),
"-i", "-i",
resourcePath("/paired01a.fq"), resourcePath("/paired01a.fq"),
"-j", "-j",
...@@ -348,10 +360,34 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -348,10 +360,34 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers {
"/tmp/mockout2.fq" "/tmp/mockout2.fq"
) )
val parsed = parseArgs(args) val parsed = parseArgs(args)
parsed.refFastq shouldBe resourceFile("/paired01a.fq") parsed.refFastq1 shouldBe resourceFile("/paired01a.fq")
parsed.inputFastq1 shouldBe resourceFile("/paired01a.fq") parsed.inputFastq1 shouldBe resourceFile("/paired01a.fq")
parsed.inputFastq2 shouldBe resourceFile("/paired01b.fq") parsed.inputFastq2 shouldBe resourceFile("/paired01b.fq")
parsed.outputFastq1 shouldBe new File("/tmp/mockout1.fq") parsed.outputFastq1 shouldBe new File("/tmp/mockout1.fq")
parsed.outputFastq2 shouldBe new File("/tmp/mockout2.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)
}
} }
...@@ -82,6 +82,10 @@ unifiedgenotyper: ...@@ -82,6 +82,10 @@ unifiedgenotyper:
## Supported variant callers ## Supported variant callers
At this moment the following variant callers can be used 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 | | ConfigName | Tool | Description |
| ---------- | ---- | ----------- | | ---------- | ---- | ----------- |
| haplotypecaller_gvcf | <a href="https://www.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_gatk_tools_walkers_haplotypecaller_HaplotypeCaller.php">haplotypecaller</a> | Running HaplotypeCaller in gvcf mode | | haplotypecaller_gvcf | <a href="https://www.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_gatk_tools_walkers_haplotypecaller_HaplotypeCaller.php">haplotypecaller</a> | Running HaplotypeCaller in gvcf mode |
...@@ -95,6 +99,31 @@ At this moment the following variant callers can be used ...@@ -95,6 +99,31 @@ At this moment the following variant callers can be used
| bcftools_singlesample | <a href="https://samtools.github.io/bcftools/bcftools.html">bcftools</a> | | | bcftools_singlesample | <a href="https://samtools.github.io/bcftools/bcftools.html">bcftools</a> | |
| varscan_cns_singlesample | <a href="http://varscan.sourceforge.net/">varscan</a> | | | varscan_cns_singlesample | <a href="http://varscan.sourceforge.net/">varscan</a> | |
##### 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 | <a href="https://software.broadinstitute.org/gatk/gatkdocs/3.7-0/org_broadinstitute_gatk_tools_walkers_cancer_m2_MuTect2.php">MuTect2</a> | Running mutect2, requires tumor normal pairs |
| varscan_cns_singlesample | <a href="http://varscan.sourceforge.net/">varscan</a> | |
| 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 ## Config options
### Required settings ### Required settings
......
...@@ -208,7 +208,8 @@ class Flexiprep(val parent: Configurable) ...@@ -208,7 +208,8 @@ class Flexiprep(val parent: Configurable)
qcCmdR2.compress = false qcCmdR2.compress = false
val fqSync = new FastqSync(this) val fqSync = new FastqSync(this)
fqSync.refFastq = R1_in fqSync.refFastq1 = R1_in
fqSync.refFastq2 = R2_in.get
fqSync.inputFastq1 = qcCmdR1.output fqSync.inputFastq1 = qcCmdR1.output
fqSync.inputFastq2 = qcCmdR2.output fqSync.inputFastq2 = qcCmdR2.output
fqSync.outputFastq1 = new File(outDir, fastqR1Qc.getName) fqSync.outputFastq1 = new File(outDir, fastqR1Qc.getName)
......
...@@ -120,8 +120,8 @@ trait MultisampleMappingTrait extends MultiSampleQScript with Reference { qscrip ...@@ -120,8 +120,8 @@ trait MultisampleMappingTrait extends MultiSampleQScript with Reference { qscrip
lazy val inputR1: Option[File] = MultisampleMapping.fileMustBeAbsolute(config("R1")) lazy val inputR1: Option[File] = MultisampleMapping.fileMustBeAbsolute(config("R1"))
lazy val inputR2: Option[File] = MultisampleMapping.fileMustBeAbsolute(config("R2")) lazy val inputR2: Option[File] = MultisampleMapping.fileMustBeAbsolute(config("R2"))
lazy val qcFastqR1 = mapping.map(_.flexiprep.fastqR1Qc) lazy val qcFastqR1: Option[File] = mapping.map(_.flexiprep.fastqR1Qc)
lazy val qcFastqR2 = mapping.flatMap(_.flexiprep.fastqR2Qc) lazy val qcFastqR2: Option[File] = mapping.flatMap(_.flexiprep.fastqR2Qc)
lazy val inputBam: Option[File] = lazy val inputBam: Option[File] =
MultisampleMapping.fileMustBeAbsolute(if (inputR1.isEmpty) config("bam") else None) MultisampleMapping.fileMustBeAbsolute(if (inputR1.isEmpty) config("bam") else None)
lazy val bamToFastq: Boolean = config("bam_to_fastq", default = false) lazy val bamToFastq: Boolean = config("bam_to_fastq", default = false)
...@@ -229,17 +229,19 @@ trait MultisampleMappingTrait extends MultiSampleQScript with Reference { qscrip ...@@ -229,17 +229,19 @@ trait MultisampleMappingTrait extends MultiSampleQScript with Reference { qscrip
qscript.add(aorrg) qscript.add(aorrg)
} }
} else add(Ln.linkBamFile(qscript, inputBam.get, bamFile.get): _*) } else add(Ln.linkBamFile(qscript, inputBam.get, bamFile.get): _*)
}
if (!bamToFastq) {
val bamMetrics = new BamMetrics(qscript) val bamMetrics = new BamMetrics(qscript)
bamMetrics.sampleId = Some(sampleId) bamMetrics.sampleId = Some(sampleId)