Commit 28db4a1e authored by pjvan_thof's avatar pjvan_thof
Browse files

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

parents e70a3c2e 9b83c7aa
...@@ -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
...@@ -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
......
...@@ -242,7 +242,9 @@ class ShivaVariantcalling(val parent: Configurable) ...@@ -242,7 +242,9 @@ class ShivaVariantcalling(val parent: Configurable)
def summarySettings = Map( def summarySettings = Map(
"variantcallers" -> configCallers.toList, "variantcallers" -> configCallers.toList,
"regions_of_interest" -> roiBedFiles.map(_.getName), "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 */ /** Files for the summary */
......
...@@ -47,8 +47,8 @@ class MuTect2(val parent: Configurable) extends SomaticVariantCaller { ...@@ -47,8 +47,8 @@ class MuTect2(val parent: Configurable) extends SomaticVariantCaller {
if (runConEst) { if (runConEst) {
val namePrefix = outputFile.getAbsolutePath.stripSuffix(".vcf.gz") val namePrefix = outputFile.getAbsolutePath.stripSuffix(".vcf.gz")
val contEst = new gatk.ContEst(this) val contEst = new gatk.ContEst(this)
inputBams.get(pair.tumorSample).foreach(contEst.input_file :+= _) inputBams.get(pair.tumorSample).foreach(contEst.input_file :+= TaggedFile(_, "eval"))
inputBams.get(pair.normalSample).foreach(contEst.input_file :+= _) inputBams.get(pair.normalSample).foreach(contEst.input_file :+= TaggedFile(_, "genotype"))
contEst.output = new File(s"$namePrefix.contamination.txt") contEst.output = new File(s"$namePrefix.contamination.txt")
contEst.BQSR = bqsrFile contEst.BQSR = bqsrFile
add(contEst) add(contEst)
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
*/ */
package nl.lumc.sasc.biopet.pipelines.shiva 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 com.google.common.io.Files
import nl.lumc.sasc.biopet.core.BiopetPipe import nl.lumc.sasc.biopet.core.BiopetPipe
...@@ -208,8 +208,15 @@ trait ShivaVariantcallingTestTrait extends TestNGSuite with Matchers { ...@@ -208,8 +208,15 @@ trait ShivaVariantcallingTestTrait extends TestNGSuite with Matchers {
} }
// remove temporary run directory all tests in the class have been run // remove temporary run directory all tests in the class have been run
@AfterClass def removeTempOutputDir(): Unit = { @AfterClass def removeTempOutputDir() = {
dirs.foreach(FileUtils.deleteDirectory) 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)
}
}
} }
} }
......
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