Skip to content
Snippets Groups Projects
Unverified Commit 6bab3aad authored by Peter van 't Hof's avatar Peter van 't Hof Committed by GitHub
Browse files

Merge pull request #61 from biowdl/BIOWDL-85

Switch to structs
parents 9ad8f00d 89b7851b
No related branches found
No related tags found
No related merge requests found
language: java language: java
script: script:
- set -e - set -e
- export CROMWELL_VERSION=34 - export CROMWELL_VERSION=34
- wget https://github.com/broadinstitute/cromwell/releases/download/$CROMWELL_VERSION/womtool-$CROMWELL_VERSION.jar # - wget https://github.com/broadinstitute/cromwell/releases/download/$CROMWELL_VERSION/womtool-$CROMWELL_VERSION.jar
- for F in $(git ls-files *.wdl); do echo $F; java -jar womtool-$CROMWELL_VERSION.jar validate $F; done - wget https://barmsijs.lumc.nl/womtool-35-a7ae2d8-SNAP.jar
- for F in `find -name "*.wdl"`; do echo $F; java -jar womtool-*.jar validate $F; done
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then git submodule foreach --recursive git checkout $TRAVIS_BRANCH && git submodule foreach --recursive git pull; fi'
- "git diff --exit-code || (echo ERROR: Git changes detected. Please update submodules && exit 1)"
...@@ -2,19 +2,19 @@ version 1.0 ...@@ -2,19 +2,19 @@ version 1.0
# Copyright Sequencing Analysis Support Core - Leiden University Medical Center 2018 # Copyright Sequencing Analysis Support Core - Leiden University Medical Center 2018
import "../common.wdl" as common
task Generate { task Generate {
input { input {
String? preCommand String? preCommand
File? toolJar File? toolJar
File bam IndexedBamFile bam
File bamIndex
File? bedFile File? bedFile
Boolean scatterMode = false Boolean scatterMode = false
Boolean onlyUnmapped = false Boolean onlyUnmapped = false
Boolean tsvOutputs = false Boolean tsvOutputs = false
String outputDir String outputDir
File? reference Reference? reference
File? referenceDict
Int memory = 4 Int memory = 4
Float memoryMultiplier = 2.0 Float memoryMultiplier = 2.0
} }
...@@ -23,14 +23,16 @@ task Generate { ...@@ -23,14 +23,16 @@ task Generate {
then "java -Xmx" + memory + "G -jar " + toolJar then "java -Xmx" + memory + "G -jar " + toolJar
else "biopet-bamstats -Xmx" + memory + "G" else "biopet-bamstats -Xmx" + memory + "G"
String refArg = if (defined(reference)) then "--reference " + select_first([reference]).fasta else ""
command { command {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
mkdir -p ~{outputDir} mkdir -p ~{outputDir}
~{toolCommand} Generate \ ~{toolCommand} Generate \
--bam ~{bam} \ --bam ~{bam.file} \
~{"--bedFile " + bedFile} \ ~{"--bedFile " + bedFile} \
~{"--reference " + reference} \ ~{refArg} \
~{true="--onlyUnmapped" false="" onlyUnmapped} \ ~{true="--onlyUnmapped" false="" onlyUnmapped} \
~{true="--scatterMode" false="" scatterMode} \ ~{true="--scatterMode" false="" scatterMode} \
~{true="--tsvOutputs" false="" tsvOutputs} \ ~{true="--tsvOutputs" false="" tsvOutputs} \
......
version 1.0 version 1.0
import "../common.wdl"
task BaseCounter { task BaseCounter {
input { input {
String? preCommand String? preCommand
File? toolJar File? toolJar
File bam IndexedBamFile bam
File bamIndex
File refFlat File refFlat
String outputDir String outputDir
String prefix String prefix
...@@ -23,7 +24,7 @@ task BaseCounter { ...@@ -23,7 +24,7 @@ task BaseCounter {
mkdir -p ~{outputDir} mkdir -p ~{outputDir}
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
-b ~{bam} \ -b ~{bam.file} \
-r ~{refFlat} \ -r ~{refFlat} \
-o ~{outputDir} \ -o ~{outputDir} \
-p ~{prefix} -p ~{prefix}
...@@ -160,10 +161,8 @@ task FastqSplitter { ...@@ -160,10 +161,8 @@ task FastqSplitter {
task FastqSync { task FastqSync {
input { input {
String? preCommand String? preCommand
File ref1 FastqPair refFastq
File ref2 FastqPair inputFastq
File in1
File in2
String out1path String out1path
String out2path String out2path
File? toolJar File? toolJar
...@@ -181,17 +180,19 @@ task FastqSync { ...@@ -181,17 +180,19 @@ task FastqSync {
~{preCommand} ~{preCommand}
mkdir -p $(dirname ~{out1path}) $(dirname ~{out2path}) mkdir -p $(dirname ~{out1path}) $(dirname ~{out2path})
~{toolCommand} \ ~{toolCommand} \
--in1 ~{in1} \ --in1 ~{inputFastq.R1} \
--in2 ~{in2} \ --in2 ~{inputFastq.R2} \
--ref1 ~{ref1} \ --ref1 ~{refFastq.R1} \
--ref2 ~{ref2} \ --ref2 ~{refFastq.R2} \
--out1 ~{out1path} \ --out1 ~{out1path} \
--out2 ~{out2path} --out2 ~{out2path}
} }
output { output {
File out1 = out1path FastqPair out1 = object {
File out2 = out2path R1: out1path,
R1: out2path
}
} }
runtime { runtime {
...@@ -199,89 +200,10 @@ task FastqSync { ...@@ -199,89 +200,10 @@ task FastqSync {
} }
} }
task SampleConfig {
input {
File? toolJar
String? preCommand
Array[File]+ inputFiles
String keyFilePath
String? sample
String? library
String? readgroup
String? jsonOutputPath
String? tsvOutputPath
Int memory = 4
Float memoryMultiplier = 2.0
}
String toolCommand = if defined(toolJar)
then "java -Xmx" + memory + "G -jar " +toolJar
else "biopet-sampleconfig -Xmx" + memory + "G"
command {
set -e -o pipefail
~{preCommand}
mkdir -p . ~{"$(dirname " + jsonOutputPath + ")"} ~{"$(dirname " + tsvOutputPath + ")"}
~{toolCommand} \
-i ~{sep="-i " inputFiles} \
~{"--sample " + sample} \
~{"--library " + library} \
~{"--readgroup " + readgroup} \
~{"--jsonOutput " + jsonOutputPath} \
~{"--tsvOutput " + tsvOutputPath} \
> ~{keyFilePath}
}
output {
File keysFile = keyFilePath
File? jsonOutput = jsonOutputPath
File? tsvOutput = tsvOutputPath
}
runtime {
memory: ceil(memory * memoryMultiplier)
}
}
task SampleConfigCromwellArrays {
input {
File? toolJar
String? preCommand
Array[File]+ inputFiles
String outputPath
Int memory = 4
Float memoryMultiplier = 2.0
}
String toolCommand = if defined(toolJar)
then "java -Xmx" + memory + "G -jar " + toolJar
else "biopet-sampleconfig -Xmx" + memory + "G"
command {
set -e -o pipefail
~{preCommand}
mkdir -p $(dirname ~{outputPath})
~{toolCommand} CromwellArrays \
-i ~{sep="-i " inputFiles} \
~{"-o " + outputPath}
}
output {
File outputFile = outputPath
}
runtime {
memory: ceil(memory * memoryMultiplier)
}
}
task ScatterRegions { task ScatterRegions {
input { input {
String? preCommand String? preCommand
File refFasta Reference reference
File refDict
String outputDirPath String outputDirPath
File? toolJar File? toolJar
Int? scatterSize Int? scatterSize
...@@ -300,7 +222,7 @@ task ScatterRegions { ...@@ -300,7 +222,7 @@ task ScatterRegions {
~{preCommand} ~{preCommand}
mkdir -p ~{outputDirPath} mkdir -p ~{outputDirPath}
~{toolCommand} \ ~{toolCommand} \
-R ~{refFasta} \ -R ~{reference.fasta} \
-o ~{outputDirPath} \ -o ~{outputDirPath} \
~{"-s " + scatterSize} \ ~{"-s " + scatterSize} \
~{"-L " + regions} ~{"-L " + regions}
...@@ -315,48 +237,13 @@ task ScatterRegions { ...@@ -315,48 +237,13 @@ task ScatterRegions {
} }
} }
task Seqstat {
input {
String? preCommand
File? toolJar
File fastq
String outputFile
Int memory = 4
Float memoryMultiplier = 2.0
}
String toolCommand = if defined(toolJar)
then "java -Xmx" + memory + "G -jar " + toolJar
else "biopet-seqstat -Xmx" + memory + "G"
command {
set -e -o pipefail
~{preCommand}
mkdir -p $(dirname ~{outputFile})
~{toolCommand} \
--fastq ~{fastq} \
--output ~{outputFile}
}
output {
File json = outputFile
}
runtime {
memory: ceil(memory * memoryMultiplier)
}
}
task ValidateAnnotation { task ValidateAnnotation {
input { input {
String? preCommand String? preCommand
File? toolJar File? toolJar
File? refRefflat File? refRefflat
File? gtfFile File? gtfFile
File refFasta Reference reference
File refFastaIndex
File refDict
Int memory = 4 Int memory = 4
Float memoryMultiplier = 2.0 Float memoryMultiplier = 2.0
...@@ -372,7 +259,7 @@ task ValidateAnnotation { ...@@ -372,7 +259,7 @@ task ValidateAnnotation {
~{toolCommand} \ ~{toolCommand} \
~{"-r " + refRefflat} \ ~{"-r " + refRefflat} \
~{"-g " + gtfFile} \ ~{"-g " + gtfFile} \
-R ~{refFasta} -R ~{reference.fasta}
} }
output { output {
...@@ -388,8 +275,7 @@ task ValidateFastq { ...@@ -388,8 +275,7 @@ task ValidateFastq {
input { input {
String? preCommand String? preCommand
File? toolJar File? toolJar
File fastq1 FastqPair inputFastq
File? fastq2
Int memory = 4 Int memory = 4
Float memoryMultiplier = 2.0 Float memoryMultiplier = 2.0
...@@ -403,14 +289,13 @@ task ValidateFastq { ...@@ -403,14 +289,13 @@ task ValidateFastq {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
--fastq1 ~{fastq1} \ --fastq1 ~{inputFastq.R1} \
~{"--fastq2 " + fastq2} ~{"--fastq2 " + inputFastq.R2}
} }
output { output {
File stderr = stderr() File stderr = stderr()
File validatedFastq1 = fastq1 FastqPair validatedFastq = inputFastq
File? validatedFastq2 = fastq2
} }
runtime { runtime {
...@@ -422,11 +307,8 @@ task ValidateVcf { ...@@ -422,11 +307,8 @@ task ValidateVcf {
input { input {
String? preCommand String? preCommand
File? toolJar File? toolJar
File vcfFile IndexedVcfFile vcf
File vcfIndex Reference reference
File refFasta
File refFastaIndex
File refDict
Int memory = 4 Int memory = 4
Float memoryMultiplier = 2.0 Float memoryMultiplier = 2.0
...@@ -440,8 +322,8 @@ task ValidateVcf { ...@@ -440,8 +322,8 @@ task ValidateVcf {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
-i ~{vcfFile} \ -i ~{vcf.file} \
-R ~{refFasta} -R ~{reference.fasta}
} }
output { output {
...@@ -455,11 +337,8 @@ task ValidateVcf { ...@@ -455,11 +337,8 @@ task ValidateVcf {
task VcfStats { task VcfStats {
input { input {
File vcfFile IndexedVcfFile vcf
File vcfIndex Reference reference
File refFasta
File refFastaIndex
File refDict
String outputDir String outputDir
File? intervals File? intervals
Array[String]+? infoTags Array[String]+? infoTags
...@@ -493,8 +372,8 @@ task VcfStats { ...@@ -493,8 +372,8 @@ task VcfStats {
mkdir -p ~{outputDir} mkdir -p ~{outputDir}
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
-I ~{vcfFile} \ -I ~{vcf.file} \
-R ~{refFasta} \ -R ~{reference.fasta} \
-o ~{outputDir} \ -o ~{outputDir} \
-t ~{localThreads} \ -t ~{localThreads} \
~{"--intervals " + intervals} \ ~{"--intervals " + intervals} \
......
version 1.0
task SampleConfig {
input {
File? toolJar
String? preCommand
Array[File]+ inputFiles
String keyFilePath
String? sample
String? library
String? readgroup
String? jsonOutputPath
String? tsvOutputPath
Int memory = 4
Float memoryMultiplier = 2.0
}
String toolCommand = if defined(toolJar)
then "java -Xmx" + memory + "G -jar " +toolJar
else "biopet-sampleconfig -Xmx" + memory + "G"
command {
set -e -o pipefail
~{preCommand}
mkdir -p . ~{"$(dirname " + jsonOutputPath + ")"} ~{"$(dirname " + tsvOutputPath + ")"}
~{toolCommand} \
-i ~{sep="-i " inputFiles} \
~{"--sample " + sample} \
~{"--library " + library} \
~{"--readgroup " + readgroup} \
~{"--jsonOutput " + jsonOutputPath} \
~{"--tsvOutput " + tsvOutputPath} \
> ~{keyFilePath}
}
output {
File keysFile = keyFilePath
File? jsonOutput = jsonOutputPath
File? tsvOutput = tsvOutputPath
}
runtime {
memory: ceil(memory * memoryMultiplier)
}
}
task SampleConfigCromwellArrays {
input {
File? toolJar
String? preCommand
Array[File]+ inputFiles
String outputPath
Int memory = 4
Float memoryMultiplier = 2.0
}
String toolCommand = if defined(toolJar)
then "java -Xmx" + memory + "G -jar " + toolJar
else "biopet-sampleconfig -Xmx" + memory + "G"
command {
set -e -o pipefail
~{preCommand}
mkdir -p $(dirname ~{outputPath})
~{toolCommand} CromwellArrays \
-i ~{sep="-i " inputFiles} \
~{"-o " + outputPath}
}
output {
File outputFile = outputPath
}
runtime {
memory: ceil(memory * memoryMultiplier)
}
}
...@@ -2,12 +2,13 @@ version 1.0 ...@@ -2,12 +2,13 @@ version 1.0
# Copyright Sequencing Analysis Support Core - Leiden University Medical Center 2018 # Copyright Sequencing Analysis Support Core - Leiden University Medical Center 2018
import "../common.wdl" as common
task Generate { task Generate {
input { input {
String? preCommand String? preCommand
File? toolJar File? toolJar
File fastqR1 FastqPair fastq
File? fastqR2
String outputFile String outputFile
String sample String sample
String library String library
...@@ -26,8 +27,8 @@ task Generate { ...@@ -26,8 +27,8 @@ task Generate {
~{preCommand} ~{preCommand}
mkdir -p $(dirname ~{outputFile}) mkdir -p $(dirname ~{outputFile})
~{toolCommand} Generate \ ~{toolCommand} Generate \
--fastqR1 ~{fastqR1} \ --fastqR1 ~{fastq.R1} \
~{"--fastqR2 " + fastqR2} \ ~{"--fastqR2 " + fastq.R2} \
--output ~{outputFile} \ --output ~{outputFile} \
~{"--sample " + sample} \ ~{"--sample " + sample} \
~{"--library " + library } \ ~{"--library " + library } \
......
...@@ -5,15 +5,14 @@ import "common.wdl" as common ...@@ -5,15 +5,14 @@ import "common.wdl" as common
task Mem { task Mem {
input { input {
String? preCommand String? preCommand
File inputR1 FastqPair inputFastq
File? inputR2
BwaIndex bwaIndex BwaIndex bwaIndex
String outputPath String outputPath
String? readgroup String? readgroup
String? picardJar String? picardJar
Int threads = 1 Int threads = 2
Int memory = 8 Int memory = 8
Int picardMemory = 4 Int picardMemory = 4
} }
...@@ -48,8 +47,8 @@ task Mem { ...@@ -48,8 +47,8 @@ task Mem {
bwa mem ~{"-t " + threads} \ bwa mem ~{"-t " + threads} \
~{readgroupArg} \ ~{readgroupArg} \
~{bwaIndex.fastaFile} \ ~{bwaIndex.fastaFile} \
~{inputR1} \ ~{inputFastq.R1} \
~{inputR2} \ ~{inputFastq.R2} \
~{altCommand} \ ~{altCommand} \
| ~{picardCommand} | ~{picardCommand}
} }
......
...@@ -24,13 +24,14 @@ task AppendToStringArray { ...@@ -24,13 +24,14 @@ task AppendToStringArray {
task CheckFileMD5 { task CheckFileMD5 {
input { input {
File file File file
String MD5sum File md5
} }
command { command {
set -e -o pipefail set -e -o pipefail
MD5SUM=$(md5sum ~{file} | cut -d ' ' -f 1) MD5SUM=$(md5sum ~{file} | cut -d ' ' -f 1)
[ $MD5SUM = ~{MD5sum} ] MD5SUM_CORRECT=$(cat ~{md5} | grep ~{basename(file)} | cut -d ' ' -f 1)
[ $MD5SUM = $MD5SUM_CORRECT ]
} }
} }
...@@ -147,16 +148,18 @@ struct Reference { ...@@ -147,16 +148,18 @@ struct Reference {
struct IndexedVcfFile { struct IndexedVcfFile {
File file File file
File index File index
File? md5sum
} }
struct IndexedBamFile { struct IndexedBamFile {
File file File file
File index File index
File? md5sum
} }
struct FastqPair { struct FastqPair {
File R1 File R1
String? R1_md5 File? R1_md5
File? R2 File? R2
String? R2_md5 File? R2_md5
} }
version 1.0 version 1.0
import "common.wdl"
task Cutadapt { task Cutadapt {
input { input {
File read1 FastqPair inputFastq
File? read2
String read1output String read1output
String? read2output String? read2output
String? format String? format
...@@ -119,15 +120,17 @@ task Cutadapt { ...@@ -119,15 +120,17 @@ task Cutadapt {
~{true="--bwa" false="" bwa} \ ~{true="--bwa" false="" bwa} \
~{true="--zero-cap" false="" zeroCap} \ ~{true="--zero-cap" false="" zeroCap} \
~{true="--no-zero-cap" false="" noZeroCap} \ ~{true="--no-zero-cap" false="" noZeroCap} \
~{read1} \ ~{inputFastq.R1} \
~{read2} \ ~{inputFastq.R2} \
~{"> " + reportPath} ~{"> " + reportPath}
} }
output{ output{
FastqPair cutOutput = object {
R1: read1output,
R2: read2output
}
File report = if defined(reportPath) then select_first([reportPath]) else stdout() File report = if defined(reportPath) then select_first([reportPath]) else stdout()
File cutRead1 = read1output
File? cutRead2 = read2output
File? tooLongOutput=tooLongOutputPath File? tooLongOutput=tooLongOutputPath
File? tooShortOutput=tooShortOutputPath File? tooShortOutput=tooShortOutputPath
File? untrimmedOutput=untrimmedOutputPath File? untrimmedOutput=untrimmedOutputPath
......
version 1.0 version 1.0
import "common.wdl" as common
task Flash { task Flash {
input { input {
String? preCommand String? preCommand
File inputR1 FastqPair inputFastq
File inputR2
String outdirPath String outdirPath
String outPrefix = "flash" String outPrefix = "flash"
Int? minOverlap Int? minOverlap
...@@ -25,13 +26,17 @@ task Flash { ...@@ -25,13 +26,17 @@ task Flash {
~{true="--compress " false="" compress} \ ~{true="--compress " false="" compress} \
~{"--min-overlap=" + minOverlap} \ ~{"--min-overlap=" + minOverlap} \
~{"--max-overlap=" + maxOverlap} \ ~{"--max-overlap=" + maxOverlap} \
~{inputR1} ~{inputR2} ~{inputFastq.R1} ~{inputFastq.R2}
} }
output { output {
File extendedFrags = outdirPath + "/" + outPrefix + ".extendedFrags.fastq.gz" File extendedFrags = outdirPath + "/" + outPrefix + ".extendedFrags.fastq.gz"
File notCombined1 = outdirPath + "/" + outPrefix + ".notCombined_1.fastq.gz" File notCombined1 = outdirPath + "/" + outPrefix + ".notCombined_1.fastq.gz"
File notCombined2 = outdirPath + "/" + outPrefix + ".notCombined_2.fastq.gz" File notCombined2 = outdirPath + "/" + outPrefix + ".notCombined_2.fastq.gz"
FastqPair notCombined = object {
R1: notCombined1,
R2: notCombined2
}
File hist = outdirPath + "/" + outPrefix + ".hist" File hist = outdirPath + "/" + outPrefix + ".hist"
File histogram = outdirPath + "/" + outPrefix + ".histogram" File histogram = outdirPath + "/" + outPrefix + ".histogram"
} }
......
version 1.0 version 1.0
import "common.wdl"
# Apply Base Quality Score Recalibration (BQSR) model # Apply Base Quality Score Recalibration (BQSR) model
task ApplyBQSR { task ApplyBQSR {
input { input {
String? preCommand String? preCommand
File? gatkJar File? gatkJar
File inputBam IndexedBamFile inputBam
File inputBamIndex
String outputBamPath String outputBamPath
File recalibrationReport File recalibrationReport
Array[File]+ sequenceGroupInterval Array[File]+ sequenceGroupInterval
File refDict Reference reference
File refFasta
File refFastaIndex
Int memory = 4 Int memory = 4
Float memoryMultiplier = 3.0 Float memoryMultiplier = 3.0
...@@ -29,8 +28,8 @@ task ApplyBQSR { ...@@ -29,8 +28,8 @@ task ApplyBQSR {
ApplyBQSR \ ApplyBQSR \
--create-output-bam-md5 \ --create-output-bam-md5 \
--add-output-sam-program-record \ --add-output-sam-program-record \
-R ~{refFasta} \ -R ~{reference.fasta} \
-I ~{inputBam} \ -I ~{inputBam.file} \
--use-original-qualities \ --use-original-qualities \
-O ~{outputBamPath} \ -O ~{outputBamPath} \
-bqsr ~{recalibrationReport} \ -bqsr ~{recalibrationReport} \
...@@ -41,8 +40,11 @@ task ApplyBQSR { ...@@ -41,8 +40,11 @@ task ApplyBQSR {
} }
output { output {
File recalibrated_bam = outputBamPath IndexedBamFile recalibratedBam = {
File recalibrated_bam_checksum = outputBamPath + ".md5" "file": outputBamPath,
"index": sub(outputBamPath, "\.bam$", ".bai"),
"md5": outputBamPath + ".md5"
}
} }
runtime { runtime {
...@@ -55,28 +57,20 @@ task BaseRecalibrator { ...@@ -55,28 +57,20 @@ task BaseRecalibrator {
input { input {
String? preCommand String? preCommand
File? gatkJar File? gatkJar
File inputBam IndexedBamFile inputBam
File inputBamIndex
String recalibrationReportPath String recalibrationReportPath
Array[File]+ sequenceGroupInterval Array[File]+ sequenceGroupInterval
Array[File]? knownIndelsSitesVCFs Array[File]? knownIndelsSitesVCFs
Array[File]? knownIndelsSitesIndices Array[File]? knownIndelsSitesVCFIndexes
File? dbsnpVCF IndexedVcfFile? dbsnpVCF
File? dbsnpVCFindex Reference reference
File refDict
File refFasta
File refFastaIndex
Int memory = 4 Int memory = 4
Float memoryMultiplier = 3.0 Float memoryMultiplier = 3.0
} }
Array[File]+ knownIndelsSitesVCFsArg = flatten([ Array[File]+ knownIndelsSitesVCFsArg = flatten([
select_first([knownIndelsSitesVCFs, []]), select_first([knownIndelsSitesVCFs, []]),
select_all([dbsnpVCF]) [select_first([dbsnpVCF]).file]
])
Array[File]+ knownIndelsSitesIndicesArg = flatten([
select_first([knownIndelsSitesIndices, []]),
select_all([dbsnpVCFindex])
]) ])
String toolCommand = if defined(gatkJar) String toolCommand = if defined(gatkJar)
...@@ -88,8 +82,8 @@ task BaseRecalibrator { ...@@ -88,8 +82,8 @@ task BaseRecalibrator {
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
BaseRecalibrator \ BaseRecalibrator \
-R ~{refFasta} \ -R ~{reference.fasta} \
-I ~{inputBam} \ -I ~{inputBam.file} \
--use-original-qualities \ --use-original-qualities \
-O ~{recalibrationReportPath} \ -O ~{recalibrationReportPath} \
--known-sites ~{sep=" --known-sites " knownIndelsSitesVCFsArg} \ --known-sites ~{sep=" --known-sites " knownIndelsSitesVCFsArg} \
...@@ -109,16 +103,14 @@ task CombineGVCFs { ...@@ -109,16 +103,14 @@ task CombineGVCFs {
input { input {
String? preCommand String? preCommand
Array[File]+ gvcfFiles Array[File]+ gvcfFiles
Array[File]+ gvcfFileIndexes Array[File]+ gvcfFilesIndex
Array[File]+ intervals Array[File]+ intervals
String outputPath String outputPath
String? gatkJar String? gatkJar
File refFasta Reference reference
File refFastaIndex
File refDict
Int memory = 4 Int memory = 4
Float memoryMultiplier = 3.0 Float memoryMultiplier = 3.0
...@@ -135,19 +127,21 @@ task CombineGVCFs { ...@@ -135,19 +127,21 @@ task CombineGVCFs {
if [ ~{length(gvcfFiles)} -gt 1 ]; then if [ ~{length(gvcfFiles)} -gt 1 ]; then
~{toolCommand} \ ~{toolCommand} \
CombineGVCFs \ CombineGVCFs \
-R ~{refFasta} \ -R ~{reference.fasta} \
-O ~{outputPath} \ -O ~{outputPath} \
-V ~{sep=' -V ' gvcfFiles} \ -V ~{sep=' -V ' gvcfFiles} \
-L ~{sep=' -L ' intervals} -L ~{sep=' -L ' intervals}
else # TODO this should be handeled in wdl else # TODO this should be handeled in wdl
ln -sf ~{gvcfFiles[0]} ~{outputPath} ln -sf ~{gvcfFiles[0]} ~{outputPath}
ln -sf ~{gvcfFileIndexes[0]} ~{outputPath}.tbi ln -sf ~{gvcfFiles[0]} ~{outputPath}.tbi
fi fi
} }
output { output {
File outputGVCF = outputPath IndexedVcfFile outputVCF = {
File outputGVCFindex = outputPath + ".tbi" "file": outputPath,
"index": outputPath + ".tbi"
}
} }
runtime { runtime {
...@@ -192,25 +186,24 @@ task GatherBqsrReports { ...@@ -192,25 +186,24 @@ task GatherBqsrReports {
task GenotypeGVCFs { task GenotypeGVCFs {
input { input {
String? preCommand String? preCommand
File gvcfFiles Array[File]+ gvcfFiles
File gvcfFileIndexes Array[File]+ gvcfFilesIndex
Array[File]+ intervals Array[File]+ intervals
String outputPath String outputPath
String? gatkJar String? gatkJar
File refFasta Reference reference
File refFastaIndex
File refDict
File? dbsnpVCF IndexedVcfFile? dbsnpVCF
File? dbsnpVCFindex
Int memory = 4 Int memory = 6
Float memoryMultiplier =3.0 Float memoryMultiplier = 2.0
} }
String dbsnpArg = if defined(dbsnpVCF) then "-D " + select_first([dbsnpVCF]).file else ""
String toolCommand = if defined(gatkJar) String toolCommand = if defined(gatkJar)
then "java -Xmx" + memory + "G -jar " + gatkJar then "java -Xmx" + memory + "G -jar " + gatkJar
else "gatk --java-options -Xmx" + memory + "G" else "gatk --java-options -Xmx" + memory + "G"
...@@ -220,19 +213,21 @@ task GenotypeGVCFs { ...@@ -220,19 +213,21 @@ task GenotypeGVCFs {
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
GenotypeGVCFs \ GenotypeGVCFs \
-R ~{refFasta} \ -R ~{reference.fasta} \
-O ~{outputPath} \ -O ~{outputPath} \
~{"-D " + dbsnpVCF} \ ~{dbsnpArg} \
-G StandardAnnotation \ -G StandardAnnotation \
--only-output-calls-starting-in-intervals \ --only-output-calls-starting-in-intervals \
-new-qual \ -new-qual \
-V ~{gvcfFiles} \ -V ~{sep=' -V ' gvcfFiles} \
-L ~{sep=' -L ' intervals} -L ~{sep=' -L ' intervals}
} }
output { output {
File outputVCF = outputPath IndexedVcfFile outputVCF = {
File outputVCFindex = outputPath + ".tbi" "file": outputPath,
"index": outputPath + ".tbi"
}
} }
runtime{ runtime{
...@@ -248,19 +243,18 @@ task HaplotypeCallerGvcf { ...@@ -248,19 +243,18 @@ task HaplotypeCallerGvcf {
Array[File]+ inputBamsIndex Array[File]+ inputBamsIndex
Array[File]+ intervalList Array[File]+ intervalList
String gvcfPath String gvcfPath
File refDict Reference reference
File refFasta
File refFastaIndex
Float contamination = 0.0 Float contamination = 0.0
String? gatkJar String? gatkJar
File? dbsnpVCF IndexedVcfFile? dbsnpVCF
File? dbsnpVCFindex
Int memory = 4 Int memory = 4
Float memoryMultiplier = 3 Float memoryMultiplier = 3
} }
String dbsnpArg = if (defined(dbsnpVCF)) then "-D " + select_first([dbsnpVCF]).file else ""
String toolCommand = if defined(gatkJar) String toolCommand = if defined(gatkJar)
then "java -Xmx" + memory + "G -jar " + gatkJar then "java -Xmx" + memory + "G -jar " + gatkJar
else "gatk --java-options -Xmx" + memory + "G" else "gatk --java-options -Xmx" + memory + "G"
...@@ -270,18 +264,20 @@ task HaplotypeCallerGvcf { ...@@ -270,18 +264,20 @@ task HaplotypeCallerGvcf {
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
HaplotypeCaller \ HaplotypeCaller \
-R ~{refFasta} \ -R ~{reference.fasta} \
-O ~{gvcfPath} \ -O ~{gvcfPath} \
-I ~{sep=" -I " inputBams} \ -I ~{sep=" -I " inputBams} \
-L ~{sep=' -L ' intervalList} \ -L ~{sep=' -L ' intervalList} \
~{"-D " + dbsnpVCF} \ ~{dbsnpArg} \
-contamination ~{contamination} \ -contamination ~{contamination} \
-ERC GVCF -ERC GVCF
} }
output { output {
File outputGVCF = gvcfPath IndexedVcfFile outputGVCF = {
File outputGVCFindex = gvcfPath + ".tbi" "file": gvcfPath,
"index": gvcfPath + ".tbi"
}
} }
runtime { runtime {
...@@ -294,10 +290,8 @@ task MuTect2 { ...@@ -294,10 +290,8 @@ task MuTect2 {
String? preCommand String? preCommand
Array[File]+ inputBams Array[File]+ inputBams
Array[File]+ inputBamIndex Array[File]+ inputBamsIndex
File refFasta Reference reference
File refFastaIndex
File refDict
String outputVcf String outputVcf
String tumorSample String tumorSample
String? normalSample String? normalSample
...@@ -317,7 +311,7 @@ task MuTect2 { ...@@ -317,7 +311,7 @@ task MuTect2 {
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
Mutect2 \ Mutect2 \
-R ~{refFasta} \ -R ~{reference.fasta} \
-I ~{sep=" -I " inputBams} \ -I ~{sep=" -I " inputBams} \
-tumor ~{tumorSample} \ -tumor ~{tumorSample} \
~{"-normal " + normalSample} \ ~{"-normal " + normalSample} \
...@@ -326,8 +320,10 @@ task MuTect2 { ...@@ -326,8 +320,10 @@ task MuTect2 {
} }
output { output {
File vcfFile = outputVcf IndexedVcfFile vcfFile = {
File vcfIndex = outputVcf + ".tbi" "file": outputVcf,
"index": outputVcf + ".tbi"
}
} }
runtime { runtime {
...@@ -339,11 +335,8 @@ task SplitNCigarReads { ...@@ -339,11 +335,8 @@ task SplitNCigarReads {
input { input {
String? preCommand String? preCommand
File inputBam IndexedBamFile inputBam
File inputBamIndex Reference reference
File refFasta
File refFastaIndex
File refDict
String outputBam String outputBam
String? gatkJar String? gatkJar
Array[File]+ intervals Array[File]+ intervals
...@@ -361,15 +354,17 @@ task SplitNCigarReads { ...@@ -361,15 +354,17 @@ task SplitNCigarReads {
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
SplitNCigarReads \ SplitNCigarReads \
-I ~{inputBam} \ -I ~{inputBam.file} \
-R ~{refFasta} \ -R ~{reference.fasta} \
-O ~{outputBam} \ -O ~{outputBam} \
-L ~{sep=' -L ' intervals} -L ~{sep=' -L ' intervals}
} }
output { output {
File bam = outputBam IndexedBamFile bam = {
File bamIndex = sub(outputBam, "\.bam$", ".bai") "file": outputBam,
"index": sub(outputBam, "\.bam$", ".bai")
}
} }
runtime { runtime {
......
version 1.0 version 1.0
import "common.wdl"
task HTSeqCount { task HTSeqCount {
input { input {
String? preCommand String? preCommand
Array[File] alignmentFiles Array[File]+ inputBams
Array[File]+ inputBamsIndex
File gtfFile File gtfFile
String outputTable String outputTable
String format = "bam" String format = "bam"
...@@ -21,7 +24,7 @@ task HTSeqCount { ...@@ -21,7 +24,7 @@ task HTSeqCount {
-f ~{format} \ -f ~{format} \
-r ~{order} \ -r ~{order} \
-s ~{stranded} \ -s ~{stranded} \
~{sep=" " alignmentFiles} \ ~{sep=" " inputBams} \
~{gtfFile} \ ~{gtfFile} \
> ~{outputTable} > ~{outputTable}
} }
......
version 1.0 version 1.0
import "common.wdl"
task PeakCalling { task PeakCalling {
input { input {
String? preCommand String? preCommand
Array[File] bamFiles Array[File]+ inputBams
Array[File]+ inputBamsIndex
String outDir String outDir
String sampleName String sampleName
Int threads = 1 Int threads = 1
...@@ -15,7 +18,7 @@ task PeakCalling { ...@@ -15,7 +18,7 @@ task PeakCalling {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
macs2 callpeak \ macs2 callpeak \
--treatment ~{sep = ' ' bamFiles} \ --treatment ~{sep = ' ' inputBams} \
--outdir ~{outDir} \ --outdir ~{outDir} \
--name ~{sampleName} \ --name ~{sampleName} \
~{true='--nomodel' false='' nomodel} ~{true='--nomodel' false='' nomodel}
......
version 1.0 version 1.0
import "common.wdl"
task ConfigureSomatic { task ConfigureSomatic {
input { input {
File tumorBam IndexedBamFile tumorBam
File tumorIndex IndexedBamFile? normalBam
File? normalBam Reference reference
File? normalIndex
File refFasta
File refFastaIndex
String runDir String runDir
File? callRegions File? callRegions
File? callRegionsIndex File? callRegionsIndex
...@@ -20,13 +19,15 @@ task ConfigureSomatic { ...@@ -20,13 +19,15 @@ task ConfigureSomatic {
then installDir + "bin/configMata.py" then installDir + "bin/configMata.py"
else "configManta.py" else "configManta.py"
String normalArg = if (defined(normalBam)) then "--normalBam " + select_first([normalBam]).file else ""
command { command {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
~{"--normalBam " + normalBam} \ ~{normalArg} \
~{"--tumorBam " + tumorBam} \ ~{"--tumorBam " + tumorBam.file} \
--referenceFasta ~{refFasta} \ --referenceFasta ~{reference.fasta} \
~{"--callRegions " + callRegions} \ ~{"--callRegions " + callRegions} \
--runDir ~{runDir} \ --runDir ~{runDir} \
~{true="--exome" false="" exome} ~{true="--exome" false="" exome}
...@@ -53,19 +54,27 @@ task RunSomatic { ...@@ -53,19 +54,27 @@ task RunSomatic {
} }
output { output {
File condidateSmallIndels = runDir + "/results/variants/candidateSmallIndels.vcf.gz" IndexedVcfFile condidateSmallIndels = object {
File condidateSmallIndelsIndex = runDir + file: runDir + "/results/variants/candidateSmallIndels.vcf.gz",
"/results/variants/candidateSmallIndels.vcf.gz.tbi" index: runDir + "/results/variants/candidateSmallIndels.vcf.gz.tbi"
File candidateSV = runDir + "/results/variants/candidateSV.vcf.gz" }
File candidateSVindex = runDir + "/results/variants/candidateSV.vcf.gz.tbi" IndexedVcfFile candidateSV = object {
File tumorSV = if paired file: runDir + "/results/variants/candidateSV.vcf.gz",
then runDir + "/results/variants/somaticSV.vcf.gz" index: runDir + "/results/variants/candidateSV.vcf.gz.tbi"
else runDir + "/results/variants/tumorSV.vcf.gz" }
File tumorSVindex = if paired IndexedVcfFile tumorSV = if (paired)
then runDir + "/results/variants/somaticSV.vcf.gz.tbi" then object {
else runDir + "/results/variants/tumorSV.vcf.gz.tbi" file: runDir + "/results/variants/somaticSV.vcf.gz",
File? diploidSV = "/results/variants/diploidSV.vcf.gz" index: runDir + "/results/variants/somaticSV.vcf.gz.tbi"
File? diploidSVindex = "/results/variants/diploidSV.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? diploidSV = runDir + "/results/variants/diploidSV.vcf.gz"
File? diploidSVindex = runDir + "/results/variants/diploidSV.vcf.gz.tbi"
} }
runtime { runtime {
......
version 1.0 version 1.0
import "common.wdl"
task BedToIntervalList { task BedToIntervalList {
input { input {
String? preCommand String? preCommand
...@@ -40,11 +42,8 @@ task BedToIntervalList { ...@@ -40,11 +42,8 @@ task BedToIntervalList {
task CollectMultipleMetrics { task CollectMultipleMetrics {
input { input {
String? preCommand String? preCommand
File bamFile IndexedBamFile bamFile
File bamIndex Reference reference
File refFasta
File refDict
File refFastaIndex
String basename String basename
Boolean collectAlignmentSummaryMetrics = true Boolean collectAlignmentSummaryMetrics = true
...@@ -53,7 +52,7 @@ task CollectMultipleMetrics { ...@@ -53,7 +52,7 @@ task CollectMultipleMetrics {
Boolean meanQualityByCycle = true Boolean meanQualityByCycle = true
Boolean collectBaseDistributionByCycle = true Boolean collectBaseDistributionByCycle = true
Boolean collectGcBiasMetrics = true Boolean collectGcBiasMetrics = true
#Boolean rnaSeqMetrics = false # There is a bug in picard https://github.com/broadinstitute/picard/issues/999 #FIXME: Boolean rnaSeqMetrics = false # There is a bug in picard https://github.com/broadinstitute/picard/issues/999
Boolean collectSequencingArtifactMetrics = true Boolean collectSequencingArtifactMetrics = true
Boolean collectQualityYieldMetrics = true Boolean collectQualityYieldMetrics = true
...@@ -73,8 +72,8 @@ task CollectMultipleMetrics { ...@@ -73,8 +72,8 @@ task CollectMultipleMetrics {
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
CollectMultipleMetrics \ CollectMultipleMetrics \
I=~{bamFile} \ I=~{bamFile.file} \
R=~{refFasta} \ R=~{reference.fasta} \
O=~{basename} \ O=~{basename} \
PROGRAM=null \ PROGRAM=null \
~{true="PROGRAM=CollectAlignmentSummaryMetrics" false="" collectAlignmentSummaryMetrics} \ ~{true="PROGRAM=CollectAlignmentSummaryMetrics" false="" collectAlignmentSummaryMetrics} \
...@@ -117,8 +116,7 @@ task CollectMultipleMetrics { ...@@ -117,8 +116,7 @@ task CollectMultipleMetrics {
task CollectRnaSeqMetrics { task CollectRnaSeqMetrics {
input { input {
String? preCommand String? preCommand
File bamFile IndexedBamFile bamFile
File bamIndex
File refRefflat File refRefflat
String basename String basename
String strandSpecificity = "NONE" String strandSpecificity = "NONE"
...@@ -139,7 +137,7 @@ task CollectRnaSeqMetrics { ...@@ -139,7 +137,7 @@ task CollectRnaSeqMetrics {
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
CollectRnaSeqMetrics \ CollectRnaSeqMetrics \
I=~{bamFile} \ I=~{bamFile.file} \
O=~{basename}.RNA_Metrics \ O=~{basename}.RNA_Metrics \
CHART_OUTPUT=~{basename}.RNA_Metrics.pdf \ CHART_OUTPUT=~{basename}.RNA_Metrics.pdf \
STRAND_SPECIFICITY=~{strandSpecificity} \ STRAND_SPECIFICITY=~{strandSpecificity} \
...@@ -159,11 +157,8 @@ task CollectRnaSeqMetrics { ...@@ -159,11 +157,8 @@ task CollectRnaSeqMetrics {
task CollectTargetedPcrMetrics { task CollectTargetedPcrMetrics {
input { input {
String? preCommand String? preCommand
File bamFile IndexedBamFile bamFile
File bamIndex Reference reference
File refFasta
File refDict
File refFastaIndex
File ampliconIntervals File ampliconIntervals
Array[File]+ targetIntervals Array[File]+ targetIntervals
String basename String basename
...@@ -184,8 +179,8 @@ task CollectTargetedPcrMetrics { ...@@ -184,8 +179,8 @@ task CollectTargetedPcrMetrics {
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
CollectTargetedPcrMetrics \ CollectTargetedPcrMetrics \
I=~{bamFile} \ I=~{bamFile.file} \
R=~{refFasta} \ R=~{reference.fasta} \
AMPLICON_INTERVALS=~{ampliconIntervals} \ AMPLICON_INTERVALS=~{ampliconIntervals} \
TARGET_INTERVALS=~{sep=" TARGET_INTERVALS=" targetIntervals} \ TARGET_INTERVALS=~{sep=" TARGET_INTERVALS=" targetIntervals} \
O=~{basename}.targetPcrMetrics \ O=~{basename}.targetPcrMetrics \
...@@ -208,9 +203,9 @@ task CollectTargetedPcrMetrics { ...@@ -208,9 +203,9 @@ task CollectTargetedPcrMetrics {
task GatherBamFiles { task GatherBamFiles {
input { input {
String? preCommand String? preCommand
Array[File]+ input_bams Array[File]+ inputBams
String output_bam_path Array[File]+ inputBamsIndex
Int? compression_level String outputBamPath
String? picardJar String? picardJar
Int memory = 4 Int memory = 4
...@@ -226,16 +221,18 @@ task GatherBamFiles { ...@@ -226,16 +221,18 @@ task GatherBamFiles {
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
GatherBamFiles \ GatherBamFiles \
INPUT=~{sep=' INPUT=' input_bams} \ INPUT=~{sep=' INPUT=' inputBams} \
OUTPUT=~{output_bam_path} \ OUTPUT=~{outputBamPath} \
CREATE_INDEX=true \ CREATE_INDEX=true \
CREATE_MD5_FILE=true CREATE_MD5_FILE=true
} }
output { output {
File output_bam = "~{output_bam_path}" IndexedBamFile outputBam = object {
File output_bam_index = sub(output_bam_path, ".bam$", ".bai") file: outputBamPath,
File output_bam_md5 = "~{output_bam_path}.md5" index: sub(outputBamPath, ".bam$", ".bai"),
md5: outputBamPath + ".md5"
}
} }
runtime { runtime {
...@@ -247,10 +244,10 @@ task GatherBamFiles { ...@@ -247,10 +244,10 @@ task GatherBamFiles {
task MarkDuplicates { task MarkDuplicates {
input { input {
String? preCommand String? preCommand
Array[File] input_bams Array[File]+ inputBams
String output_bam_path Array[File] inputBamIndexes
String metrics_path String outputBamPath
Int? compression_level String metricsPath
String? picardJar String? picardJar
Int memory = 4 Int memory = 4
...@@ -273,24 +270,28 @@ task MarkDuplicates { ...@@ -273,24 +270,28 @@ task MarkDuplicates {
command { command {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
mkdir -p $(dirname ~{output_bam_path}) mkdir -p $(dirname ~{outputBamPath})
~{toolCommand} \ ~{toolCommand} \
MarkDuplicates \ MarkDuplicates \
INPUT=~{sep=' INPUT=' input_bams} \ INPUT=~{sep=' INPUT=' inputBams} \
OUTPUT=~{output_bam_path} \ OUTPUT=~{outputBamPath} \
METRICS_FILE=~{metrics_path} \ METRICS_FILE=~{metricsPath} \
VALIDATION_STRINGENCY=SILENT \ VALIDATION_STRINGENCY=SILENT \
~{"READ_NAME_REGEX=" + read_name_regex} \ ~{"READ_NAME_REGEX=" + read_name_regex} \
OPTICAL_DUPLICATE_PIXEL_DISTANCE=2500 \ OPTICAL_DUPLICATE_PIXEL_DISTANCE=2500 \
CLEAR_DT="false" \ CLEAR_DT="false" \
CREATE_INDEX=true \ CREATE_INDEX=true \
ADD_PG_TAG_TO_READS=false ADD_PG_TAG_TO_READS=false \
CREATE_MD5_FILE=true
} }
output { output {
File output_bam = output_bam_path IndexedBamFile outputBam = object {
File output_bam_index = sub(output_bam_path, ".bam$", ".bai") file: outputBamPath,
File duplicate_metrics = metrics_path index: sub(outputBamPath, ".bam$", ".bai"),
md5: outputBamPath + ".md5"
}
File metricsFile = metricsPath
} }
runtime { runtime {
...@@ -304,7 +305,7 @@ task MergeVCFs { ...@@ -304,7 +305,7 @@ task MergeVCFs {
String? preCommand String? preCommand
Array[File] inputVCFs Array[File] inputVCFs
Array[File] inputVCFsIndexes Array[File] inputVCFsIndexes
String outputVCFpath String outputVcfPath
Int? compressionLevel Int? compressionLevel
String? picardJar String? picardJar
...@@ -325,12 +326,14 @@ task MergeVCFs { ...@@ -325,12 +326,14 @@ task MergeVCFs {
~{toolCommand} \ ~{toolCommand} \
MergeVcfs \ MergeVcfs \
INPUT=~{sep=' INPUT=' inputVCFs} \ INPUT=~{sep=' INPUT=' inputVCFs} \
OUTPUT=~{outputVCFpath} OUTPUT=~{outputVcfPath}
} }
output { output {
File outputVCF = outputVCFpath IndexedVcfFile outputVcf = object {
File outputVCFindex = outputVCFpath + ".tbi" file: outputVcfPath,
index: outputVcfPath + ".tbi"
}
} }
runtime { runtime {
...@@ -341,7 +344,7 @@ task MergeVCFs { ...@@ -341,7 +344,7 @@ task MergeVCFs {
task SamToFastq { task SamToFastq {
input { input {
String? preCommand String? preCommand
File inputBam IndexedBamFile inputBam
String outputRead1 String outputRead1
String? outputRead2 String? outputRead2
String? outputUnpaired String? outputUnpaired
...@@ -360,7 +363,7 @@ task SamToFastq { ...@@ -360,7 +363,7 @@ task SamToFastq {
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
SamToFastq \ SamToFastq \
I=~{inputBam} \ I=~{inputBam.file} \
~{"FASTQ=" + outputRead1} \ ~{"FASTQ=" + outputRead1} \
~{"SECOND_END_FASTQ=" + outputRead2} \ ~{"SECOND_END_FASTQ=" + outputRead2} \
~{"UNPAIRED_FASTQ=" + outputUnpaired} ~{"UNPAIRED_FASTQ=" + outputUnpaired}
...@@ -422,8 +425,8 @@ task SortVcf { ...@@ -422,8 +425,8 @@ task SortVcf {
String? picardJar String? picardJar
Array[File]+ vcfFiles Array[File]+ vcfFiles
String outputVcf String outputVcfPath
File? sequenceDict File? dict
Int memory = 4 Int memory = 4
Float memoryMultiplier = 3.0 Float memoryMultiplier = 3.0
...@@ -439,13 +442,15 @@ task SortVcf { ...@@ -439,13 +442,15 @@ task SortVcf {
~{toolCommand} \ ~{toolCommand} \
SortVcf \ SortVcf \
I=~{sep=" I=" vcfFiles} \ I=~{sep=" I=" vcfFiles} \
~{"SEQUENCE_DICTIONARY=" + sequenceDict} \ ~{"SEQUENCE_DICTIONARY=" + dict} \
O=~{outputVcf} O=~{outputVcfPath}
} }
output { output {
File vcfFile = outputVcf IndexedVcfFile outputVcf = object {
File vcfIndex = outputVcf + ".tbi" file: outputVcfPath,
index: outputVcfPath + ".tbi"
}
} }
runtime { runtime {
......
version 1.0 version 1.0
import "common.wdl"
task BgzipAndIndex { task BgzipAndIndex {
input { input {
File inputFile File inputFile
...@@ -23,20 +25,21 @@ task BgzipAndIndex { ...@@ -23,20 +25,21 @@ task BgzipAndIndex {
task Index { task Index {
input { input {
String? preCommand String? preCommand
File bamFilePath File bamFile
String? bamIndexPath String bamIndexPath
} }
command { command {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
samtools index ~{bamFilePath} ~{bamIndexPath} samtools index ~{bamFile} ~{bamIndexPath}
} }
output { output {
File indexFile = if defined(bamIndexPath) IndexedBamFile outputBam = object {
then select_first([bamIndexPath]) file: bamFile,
else bamFilePath + ".bai" index: bamIndexPath
}
} }
} }
......
version 1.0 version 1.0
import "common.wdl" as common
task ConfigureGermline { task ConfigureGermline {
input { input {
String? preCommand String? preCommand
...@@ -7,8 +9,7 @@ task ConfigureGermline { ...@@ -7,8 +9,7 @@ task ConfigureGermline {
String runDir String runDir
Array[File]+ bams Array[File]+ bams
Array[File]+ indexes Array[File]+ indexes
File refFasta Reference reference
File refFastaIndex
File? callRegions File? callRegions
File? callRegionsIndex File? callRegionsIndex
Boolean exome = false Boolean exome = false
...@@ -24,7 +25,7 @@ task ConfigureGermline { ...@@ -24,7 +25,7 @@ task ConfigureGermline {
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
--bam ~{sep=" --bam " bams} \ --bam ~{sep=" --bam " bams} \
--ref ~{refFasta} \ --ref ~{reference.fasta} \
--runDir ~{runDir} \ --runDir ~{runDir} \
~{"--callRegions " + callRegions} \ ~{"--callRegions " + callRegions} \
~{true="--exome" false="" exome} \ ~{true="--exome" false="" exome} \
...@@ -41,16 +42,12 @@ task ConfigureSomatic { ...@@ -41,16 +42,12 @@ task ConfigureSomatic {
String? preCommand String? preCommand
String? installDir String? installDir
String runDir String runDir
File normalBam IndexedBamFile normalBam
File normalIndex IndexedBamFile tumorBam
File tumorBam Reference reference
File tumorIndex
File refFasta
File refFastaIndex
File? callRegions File? callRegions
File? callRegionsIndex File? callRegionsIndex
File? indelCandidates IndexedVcfFile? indelCandidates
File? indelCandidatesIndex
Boolean exome = false Boolean exome = false
} }
...@@ -58,16 +55,18 @@ task ConfigureSomatic { ...@@ -58,16 +55,18 @@ task ConfigureSomatic {
then installDir + "bin/configureStrelkaSomaticWorkflow.py" then installDir + "bin/configureStrelkaSomaticWorkflow.py"
else "configureStrelkaSomaticWorkflow.py" else "configureStrelkaSomaticWorkflow.py"
String indelCandidatesArg = if (defined(indelCandidates)) then "--indelCandidates " + select_first([indelCandidates]).file else ""
command { command {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
--normalBam ~{normalBam} \ --normalBam ~{normalBam.file} \
--tumorBam ~{tumorBam} \ --tumorBam ~{tumorBam.file} \
--ref ~{refFasta} \ --ref ~{reference.fasta} \
--runDir ~{runDir} \ --runDir ~{runDir} \
~{"--callRegions " + callRegions} \ ~{"--callRegions " + callRegions} \
~{"--indelCandidates " + indelCandidates} \ ~{indelCandidatesArg} \
~{true="--exome" false="" exome} \ ~{true="--exome" false="" exome} \
} }
...@@ -82,6 +81,7 @@ task Run { ...@@ -82,6 +81,7 @@ task Run {
Int cores = 1 Int cores = 1
Int memory = 4 Int memory = 4
Boolean somatic = true Boolean somatic = true
#FIXME: This task does not have input files
} }
command { command {
......
version 1.0 version 1.0
import "common.wdl"
task Stringtie { task Stringtie {
input { input {
String? preCommand String? preCommand
File alignedReads IndexedBamFile bamFile
File? referenceGtf File? referenceGtf
Int threads = 1 Int threads = 1
String assembledTranscriptsFile String assembledTranscriptsFile
...@@ -23,7 +25,7 @@ task Stringtie { ...@@ -23,7 +25,7 @@ task Stringtie {
~{true="fr" false="" secondStranded} \ ~{true="fr" false="" secondStranded} \
-o ~{assembledTranscriptsFile} \ -o ~{assembledTranscriptsFile} \
~{"-A " + geneAbundanceFile} \ ~{"-A " + geneAbundanceFile} \
~{alignedReads} ~{bamFile.file}
} }
output { output {
......
version 1.0 version 1.0
import "common.wdl"
task VarDict { task VarDict {
input { input {
String? installDir String? installDir
Boolean useJavaVersion = true Boolean useJavaVersion = true
String tumorSampleName String tumorSampleName
File tumorBam IndexedBamFile tumorBam
File tumorIndex
String? normalSampleName String? normalSampleName
File? normalBam IndexedBamFile? normalBam
File? normalIndex Reference reference
File refFasta
File refFastaIndex
File bedFile File bedFile
String outputVcf String outputVcf
...@@ -26,6 +25,8 @@ task VarDict { ...@@ -26,6 +25,8 @@ task VarDict {
Float memoryMultiplier = 2.0 Float memoryMultiplier = 2.0
} }
String normalArg = if (defined(normalBam)) then "|" + select_first([normalBam]).file else ""
String toolCommand = if defined(installDir) String toolCommand = if defined(installDir)
then installDir + "/VarDict" then installDir + "/VarDict"
else if useJavaVersion else if useJavaVersion
...@@ -37,9 +38,9 @@ task VarDict { ...@@ -37,9 +38,9 @@ task VarDict {
export JAVA_OPTS="-Xmx~{memory}G" export JAVA_OPTS="-Xmx~{memory}G"
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
-G ~{refFasta} \ -G ~{reference.fasta} \
-N ~{tumorSampleName} \ -N ~{tumorSampleName} \
-b "~{tumorBam}~{"|" + normalBam}" \ -b "~{tumorBam.file}~{normalArg}" \
~{true="" false="-z" defined(normalBam)} \ ~{true="" false="-z" defined(normalBam)} \
-c ~{chromosomeColumn} \ -c ~{chromosomeColumn} \
-S ~{startColumn} \ -S ~{startColumn} \
...@@ -52,10 +53,14 @@ task VarDict { ...@@ -52,10 +53,14 @@ task VarDict {
-N "~{tumorSampleName}~{"|" + normalSampleName}" \ -N "~{tumorSampleName}~{"|" + normalSampleName}" \
~{true="" false="-E" defined(normalBam)} | \ ~{true="" false="-E" defined(normalBam)} | \
bgzip -c > ~{outputVcf} bgzip -c > ~{outputVcf}
tabix -p vcf ~{outputVcf}
} }
output { output {
File vcfFile = outputVcf IndexedVcfFile vcfFile = object {
file: outputVcf,
index: outputVcf + ".tbi"
}
} }
runtime { runtime {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment