diff --git a/manta.wdl b/manta.wdl index 6eb724844b28ce44b1b1f7f2120659058501470c..546d468c166fa75a615b63e836aa83a76f316f6e 100644 --- a/manta.wdl +++ b/manta.wdl @@ -4,10 +4,13 @@ import "common.wdl" task Somatic { input { - IndexedBamFile tumorBam - IndexedBamFile? normalBam - Reference reference - String runDir + File tumorBam + File tumorBamIndex + File? normalBam + File? normalBamIndex + File referenceFasta + File referenceFastaFai + String runDir = "." File? callRegions File? callRegionsIndex Boolean exome = false @@ -16,19 +19,15 @@ task Somatic { Int memory = 4 String dockerImage = "quay.io/biocontainers/manta:1.4.0--py27_1" - File? doNotDefineThis #FIXME } - File? normalBamFile = if defined(normalBam) - then select_first([normalBam]).file - else doNotDefineThis - command { + mkdir -p ~{runDir} set -e configManta.py \ - ~{"--normalBam " + normalBamFile} \ - ~{"--tumorBam " + tumorBam.file} \ - --referenceFasta ~{reference.fasta} \ + ~{"--normalBam " + normalBam} \ + ~{"--tumorBam " + tumorBam} \ + --referenceFasta ~{referenceFasta} \ ~{"--callRegions " + callRegions} \ --runDir ~{runDir} \ ~{true="--exome" false="" exome} @@ -40,25 +39,16 @@ task Somatic { } output { - IndexedVcfFile candidateSmallIndels = object { - file: runDir + "/results/variants/candidateSmallIndels.vcf.gz", - index: runDir + "/results/variants/candidateSmallIndels.vcf.gz.tbi" - } - IndexedVcfFile candidateSV = object { - file: runDir + "/results/variants/candidateSV.vcf.gz", - index: runDir + "/results/variants/candidateSV.vcf.gz.tbi" - } - IndexedVcfFile tumorSV = if defined(normalBam) - then object { - file: runDir + "/results/variants/somaticSV.vcf.gz", - index: runDir + "/results/variants/somaticSV.vcf.gz.tbi" - } - else object { - file: runDir + "/results/variants/tumorSV.vcf.gz", - index: runDir + "/results/variants/tumorSV.vcf.gz.tbi" - } - - #FIXME: workaround for https://github.com/broadinstitute/cromwell/issues/4111 + File candidateSmallIndelsVcf = runDir + "/results/variants/candidateSmallIndels.vcf.gz" + File candidateSmallIndelsVcfIndex = runDir + "/results/variants/candidateSmallIndels.vcf.gz.tbi" + File candidateSVVcf = runDir + "/results/variants/candidateSV.vcf.gz" + File candidatSVVcfIndex = runDir + "/results/variants/candidateSV.vcf.gz.tbi" + File tumorSVVcf = if defined(normalBam) + then runDir + "/results/variants/somaticSV.vcf.gz" + else runDir + "/results/variants/tumorSV.vcf.gz" + File tumorSVVcfIndex = if defined(normalBam) + then runDir + "/results/variants/somaticSV.vcf.gz.tbi" + else runDir + "/results/variants/tumorSV.vcf.gz.tbi" File? diploidSV = runDir + "/results/variants/diploidSV.vcf.gz" File? diploidSVindex = runDir + "/results/variants/diploidSV.vcf.gz.tbi" } diff --git a/samtools.wdl b/samtools.wdl index e83474be6b805829cdb91b7b35ff64d225d16091..45376a09fecaf1ee28bf3ba70555933f1c40a2eb 100644 --- a/samtools.wdl +++ b/samtools.wdl @@ -13,6 +13,7 @@ task BgzipAndIndex { command { set -e + mkdir -p $(dirname ~{outputGz}) bgzip -c ~{inputFile} > ~{outputGz} tabix ~{outputGz} -p ~{type} } @@ -36,6 +37,8 @@ task Index { } command { + set -e + mkdir -p $(dirname ~{bamIndexPath}) samtools index ~{bamFile} ~{bamIndexPath} } @@ -85,6 +88,8 @@ task Markdup { } command { + set -e + mkdir -p $(dirname ~{outputBamPath}) samtools markdup ~{inputBam} ~{outputBamPath} } @@ -222,6 +227,8 @@ task View { } command { + set -e + mkdir -p $(dirname ~{outputFileName}) samtools view \ ~{"-T " + referenceFasta} \ ~{"-o " + outputFileName} \ diff --git a/somaticseq.wdl b/somaticseq.wdl index 9e47183f3d2f47e9d21be83883714d9c095e4298..d1163b4a1fcda41b45f9e3a12e7eb5b2ad16c882 100644 --- a/somaticseq.wdl +++ b/somaticseq.wdl @@ -1,7 +1,5 @@ version 1.0 -import "common.wdl" as common - task ParallelPaired { input { String installDir = "/opt/somaticseq" #the location in the docker image @@ -9,11 +7,14 @@ task ParallelPaired { File? classifierSNV File? classifierIndel String outputDir - Reference reference + File referenceFasta + File referenceFastaFai File? inclusionRegion File? exclusionRegion - IndexedBamFile tumorBam - IndexedBamFile normalBam + File tumorBam + File tumorBamIndex + File normalBam + File normalBamIndex File? mutect2VCF File? varscanSNV File? varscanIndel @@ -36,13 +37,13 @@ task ParallelPaired { ~{"--classifier-snv " + classifierSNV} \ ~{"--classifier-indel " + classifierIndel} \ --output-directory ~{outputDir} \ - --genome-reference ~{reference.fasta} \ + --genome-reference ~{referenceFasta} \ ~{"--inclusion-region " + inclusionRegion} \ ~{"--exclusion-region " + exclusionRegion} \ --threads ~{threads} \ paired \ - --tumor-bam-file ~{tumorBam.file} \ - --normal-bam-file ~{normalBam.file} \ + --tumor-bam-file ~{tumorBam} \ + --normal-bam-file ~{normalBam} \ ~{"--mutect2-vcf " + mutect2VCF} \ ~{"--varscan-snv " + varscanSNV} \ ~{"--varscan-indel " + varscanIndel} \ @@ -81,11 +82,14 @@ task ParallelPairedTrain { File truthSNV File truthIndel String outputDir - Reference reference + File referenceFasta + File referenceFastaFai File? inclusionRegion File? exclusionRegion - IndexedBamFile tumorBam - IndexedBamFile normalBam + File tumorBam + File tumorBamIndex + File normalBam + File normalBamIndex File? mutect2VCF File? varscanSNV File? varscanIndel @@ -109,13 +113,13 @@ task ParallelPairedTrain { --truth-snv ~{truthSNV} \ --truth-indel ~{truthIndel} \ --output-directory ~{outputDir} \ - --genome-reference ~{reference.fasta} \ + --genome-reference ~{referenceFasta} \ ~{"--inclusion-region " + inclusionRegion} \ ~{"--exclusion-region " + exclusionRegion} \ --threads ~{threads} \ paired \ - --tumor-bam-file ~{tumorBam.file} \ - --normal-bam-file ~{normalBam.file} \ + --tumor-bam-file ~{tumorBam} \ + --normal-bam-file ~{normalBam} \ ~{"--mutect2-vcf " + mutect2VCF} \ ~{"--varscan-snv " + varscanSNV} \ ~{"--varscan-indel " + varscanIndel} \ @@ -152,10 +156,12 @@ task ParallelSingle { File? classifierSNV File? classifierIndel String outputDir - Reference reference + File referenceFasta + File referenceFastaFai File? inclusionRegion File? exclusionRegion - IndexedBamFile bam + File bam + File bamIndex File? mutect2VCF File? varscanVCF File? vardictVCF @@ -172,12 +178,12 @@ task ParallelSingle { ~{"--classifier-snv " + classifierSNV} \ ~{"--classifier-indel " + classifierIndel} \ --output-directory ~{outputDir} \ - --genome-reference ~{reference.fasta} \ + --genome-reference ~{referenceFasta} \ ~{"--inclusion-region " + inclusionRegion} \ ~{"--exclusion-region " + exclusionRegion} \ --threads ~{threads} \ single \ - --bam-file ~{bam.file} \ + --bam-file ~{bam} \ ~{"--mutect2-vcf " + mutect2VCF} \ ~{"--varscan-vcf " + varscanVCF} \ ~{"--vardict-vcf " + vardictVCF} \ @@ -210,10 +216,12 @@ task ParallelSingleTrain { File truthSNV File truthIndel String outputDir - Reference reference + File referenceFasta + File referenceFastaFai File? inclusionRegion File? exclusionRegion - IndexedBamFile bam + File bam + File bamIndex File? mutect2VCF File? varscanVCF File? vardictVCF @@ -231,12 +239,12 @@ task ParallelSingleTrain { --truth-snv ~{truthSNV} \ --truth-indel ~{truthIndel} \ --output-directory ~{outputDir} \ - --genome-reference ~{reference.fasta} \ + --genome-reference ~{referenceFasta} \ ~{"--inclusion-region " + inclusionRegion} \ ~{"--exclusion-region " + exclusionRegion} \ --threads ~{threads} \ single \ - --bam-file ~{bam.file} \ + --bam-file ~{bam} \ ~{"--mutect2-vcf " + mutect2VCF} \ ~{"--varscan-vcf " + varscanVCF} \ ~{"--vardict-vcf " + vardictVCF} \ diff --git a/strelka.wdl b/strelka.wdl index f9166ecc928a489d94ecfcc92c062ea00370a40c..262d3fdc5a12edc75e7fb36cc4f39e16dac28141 100644 --- a/strelka.wdl +++ b/strelka.wdl @@ -4,10 +4,11 @@ import "common.wdl" as common task Germline { input { - String runDir + String runDir = "." Array[File]+ bams Array[File]+ indexes - Reference reference + File referenceFasta + File referenceFastaFai File? callRegions File? callRegionsIndex Boolean exome = false @@ -20,9 +21,10 @@ task Germline { command { set -e + mkdir -p ~{runDir} configureStrelkaGermlineWorkflow.py \ --bam ~{sep=" --bam " bams} \ - --ref ~{reference.fasta} \ + --ref ~{referenceFasta} \ --runDir ~{runDir} \ ~{"--callRegions " + callRegions} \ ~{true="--exome" false="" exome} \ @@ -48,13 +50,17 @@ task Germline { task Somatic { input { - String runDir - IndexedBamFile normalBam - IndexedBamFile tumorBam - Reference reference + String runDir = "." + File normalBam + File normalBamIndex + File tumorBam + File tumorBamIndex + File referenceFasta + File referenceFastaFai File? callRegions File? callRegionsIndex - IndexedVcfFile? indelCandidates + File? indelCandidatesVcf + File? indelCandidatesVcfIndex Boolean exome = false Int cores = 1 @@ -64,19 +70,16 @@ task Somatic { File? doNotDefineThis #FIXME } - File? indelCandidatesFile = if (defined(indelCandidates)) - then select_first([indelCandidates]).file - else doNotDefineThis - command { set -e + mkdir -p ~{runDir} configureStrelkaSomaticWorkflow.py \ - --normalBam ~{normalBam.file} \ - --tumorBam ~{tumorBam.file} \ - --ref ~{reference.fasta} \ + --normalBam ~{normalBam} \ + --tumorBam ~{tumorBam} \ + --ref ~{referenceFasta} \ --runDir ~{runDir} \ ~{"--callRegions " + callRegions} \ - ~{"--indelCandidates " + indelCandidatesFile} \ + ~{"--indelCandidates " + indelCandidatesVcf} \ ~{true="--exome" false="" exome} ~{runDir}/runWorkflow.py \ diff --git a/vardict.wdl b/vardict.wdl index 0fe6ee14dbc40e28de5a029894ead72321e1ecac..0cbf38acd7a69f22e4b760f7f17932f585a52852 100644 --- a/vardict.wdl +++ b/vardict.wdl @@ -5,10 +5,13 @@ import "common.wdl" task VarDict { input { String tumorSampleName - IndexedBamFile tumorBam + File tumorBam + File tumorBamIndex String? normalSampleName - IndexedBamFile? normalBam - Reference reference + File? normalBam + File? normalBamIndex + File referenceFasta + File referenceFastaFai File bedFile String outputVcf @@ -22,21 +25,16 @@ task VarDict { Float memoryMultiplier = 2.5 String dockerImage = "quay.io/biocontainers/vardict-java:1.5.8--1" - File? doNotDefineThis #FIXME } - File? normalBamFile = if defined(normalBam) - then select_first([normalBam]).file - else doNotDefineThis - command { set -e -o pipefail export JAVA_OPTS="-Xmx~{memory}G" vardict-java \ ~{"-th " + threads} \ - -G ~{reference.fasta} \ + -G ~{referenceFasta} \ -N ~{tumorSampleName} \ - -b "~{tumorBam.file}~{"|" + normalBamFile}" \ + -b "~{tumorBam}~{"|" + normalBam}" \ ~{true="" false="-z" defined(normalBam)} \ -c ~{chromosomeColumn} \ -S ~{startColumn} \