diff --git a/bioconda.wdl b/bioconda.wdl index e0b56b4a1df922c33015b3e357a804c338b03ca6..0a513ddc5df99f1354cfd8a4db8aad75d8ef7428 100644 --- a/bioconda.wdl +++ b/bioconda.wdl @@ -7,11 +7,11 @@ task installPrefix { input { Array[String] requirements String prefix - String? condaPath + String condaPath = "conda" } command <<< - ~{default="conda" condaPath} create \ + ~{condaPath} create \ --json -q \ --yes \ --override-channels \ diff --git a/biopet.wdl b/biopet.wdl index 3b550be223a7441a70eb8c4b21463b34005500c3..36d6f2a9cd7b4b4bf633a063ff2220c2cee70995 100644 --- a/biopet.wdl +++ b/biopet.wdl @@ -10,15 +10,13 @@ task BaseCounter { String outputDir String prefix - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(toolJar) - then "java -Xmx" + mem + "G -jar " +toolJar - else "biopet-basecounter -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " +toolJar + else "biopet-basecounter -Xmx" + memory + "G" command { set -e -o pipefail @@ -69,7 +67,7 @@ task BaseCounter { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -79,48 +77,46 @@ task ExtractAdaptersFastqc { String? preCommand File inputFile String outputDir - String? adapterOutputFilePath = outputDir + "/adapter.list" - String? contamsOutputFilePath = outputDir + "/contaminations.list" + String adapterOutputFilePath = outputDir + "/adapter.list" + String contamsOutputFilePath = outputDir + "/contaminations.list" Boolean? skipContams File? knownContamFile File? knownAdapterFile Float? adapterCutoff Boolean? outputAsFasta - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 2.5 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(toolJar) - then "java -Xmx" + mem + "G -jar " +toolJar - else "biopet-extractadaptersfastqc -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " +toolJar + else "biopet-extractadaptersfastqc -Xmx" + memory + "G" command { - set -e - ~{preCommand} - mkdir -p ~{outputDir} - ~{toolCommand} \ - --inputFile ~{inputFile} \ - ~{"--adapterOutputFile " + adapterOutputFilePath } \ - ~{"--contamsOutputFile " + contamsOutputFilePath } \ - ~{"--knownContamFile " + knownContamFile} \ - ~{"--knownAdapterFile " + knownAdapterFile} \ - ~{"--adapterCutoff " + adapterCutoff} \ - ~{true="--skipContams" false="" skipContams} \ - ~{true="--outputAsFasta" false="" outputAsFasta} + set -e + ~{preCommand} + mkdir -p ~{outputDir} + ~{toolCommand} \ + --inputFile ~{inputFile} \ + ~{"--adapterOutputFile " + adapterOutputFilePath } \ + ~{"--contamsOutputFile " + contamsOutputFilePath } \ + ~{"--knownContamFile " + knownContamFile} \ + ~{"--knownAdapterFile " + knownAdapterFile} \ + ~{"--adapterCutoff " + adapterCutoff} \ + ~{true="--skipContams" false="" skipContams} \ + ~{true="--outputAsFasta" false="" outputAsFasta} } output { - File adapterOutputFile = select_first([adapterOutputFilePath]) - File contamsOutputFile = select_first([contamsOutputFilePath]) - Array[String] adapterList = read_lines(select_first([adapterOutputFilePath])) - Array[String] contamsList = read_lines(select_first([contamsOutputFilePath])) + File adapterOutputFile = adapterOutputFilePath + File contamsOutputFile = contamsOutputFilePath + Array[String] adapterList = read_lines(adapterOutputFilePath) + Array[String] contamsList = read_lines(contamsOutputFilePath) } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 2.5])) + memory: ceil(memory * memoryMultiplier) } } @@ -128,18 +124,16 @@ task FastqSplitter { input { String? preCommand File inputFastq - Array[String] outputPaths + Array[String]+ outputPaths File? toolJar - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 2.5 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(toolJar) - then "java -Xmx" + mem + "G -jar " +toolJar - else "biopet-fastqsplitter -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " +toolJar + else "biopet-fastqsplitter -Xmx" + memory + "G" command { set -e -o pipefail @@ -159,7 +153,7 @@ task FastqSplitter { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 2.5])) + memory: ceil(memory * memoryMultiplier) } } @@ -174,15 +168,13 @@ task FastqSync { String out2path File? toolJar - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 2.5 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(toolJar) - then "java -Xmx" + mem + "G -jar " +toolJar - else "biopet-fastqsync -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " +toolJar + else "biopet-fastqsync -Xmx" + memory + "G" command { set -e -o pipefail @@ -203,7 +195,7 @@ task FastqSync { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 2.5])) + memory: ceil(memory * memoryMultiplier) } } @@ -219,15 +211,13 @@ task SampleConfig { String? jsonOutputPath String? tsvOutputPath - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 2.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(toolJar) - then "java -Xmx" + mem + "G -jar " +toolJar - else "biopet-sampleconfig -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " +toolJar + else "biopet-sampleconfig -Xmx" + memory + "G" command { set -e -o pipefail @@ -250,7 +240,7 @@ task SampleConfig { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 2.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -264,14 +254,13 @@ task ScatterRegions { Int? scatterSize File? regions - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3.0 } - Int mem = ceil(select_first([memory, 4.0])) String toolCommand = if defined(toolJar) - then "java -Xmx" + mem + "G -jar " +toolJar - else "biopet-scatterregions -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " +toolJar + else "biopet-scatterregions -Xmx" + memory + "G" command { set -e -o pipefail @@ -289,7 +278,7 @@ task ScatterRegions { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -299,15 +288,14 @@ task Seqstat { File? toolJar File fastq String outputFile - Float? memory - Float? memoryMultiplier - } - Int mem = ceil(select_first([memory, 4.0])) + Int memory = 4 + Float memoryMultiplier = 2.0 + } String toolCommand = if defined(toolJar) - then "java -Xmx" + mem + "G -jar " + toolJar - else "biopet-seqstat -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + toolJar + else "biopet-seqstat -Xmx" + memory + "G" command { set -e -o pipefail @@ -323,7 +311,7 @@ task Seqstat { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 2.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -337,15 +325,13 @@ task ValidateAnnotation { File refFastaIndex File refDict - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 2.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(toolJar) - then "java -Xmx" + mem + "G -jar " + toolJar - else "biopet-validateannotation -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + toolJar + else "biopet-validateannotation -Xmx" + memory + "G" command { set -e -o pipefail @@ -361,7 +347,7 @@ task ValidateAnnotation { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 2.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -372,15 +358,13 @@ task ValidateFastq { File fastq1 File? fastq2 - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 2.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(toolJar) - then "java -Xmx" + mem + "G -jar " + toolJar - else "biopet-validatefastq -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + toolJar + else "biopet-validatefastq -Xmx" + memory + "G" command { set -e -o pipefail @@ -395,7 +379,7 @@ task ValidateFastq { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 2.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -409,15 +393,13 @@ task ValidateVcf { File refFastaIndex File refDict - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 2.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(toolJar) - then "java -Xmx" + mem + "G -jar " + toolJar - else "biopet-validatevcf -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + toolJar + else "biopet-validatevcf -Xmx" + memory + "G" command { set -e -o pipefail @@ -432,6 +414,6 @@ task ValidateVcf { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 2.0])) + memory: ceil(memory * memoryMultiplier) } } diff --git a/bwa.wdl b/bwa.wdl index d012b38ea8e94bcd4d54e992cd43315e6df3ddb5..01d1b7d08b798083d0bb7dbf6fd74ce4ebe64a14 100644 --- a/bwa.wdl +++ b/bwa.wdl @@ -1,6 +1,6 @@ version 1.0 -task mem { +task Mem { input { String? preCommand File inputR1 @@ -10,8 +10,8 @@ task mem { String outputPath String? readgroup - Int? threads - Int? memory + Int threads = 1 + Int memory = 8 } command { @@ -20,7 +20,10 @@ task mem { ~{preCommand} bwa mem ~{"-t " + threads} \ ~{"-R '" + readgroup + "'"} \ - ~{referenceFasta} ~{inputR1} ~{inputR2} | samtools sort --output-fmt BAM - > ~{outputPath} + ~{referenceFasta} \ + ~{inputR1} \ + ~{inputR2} \ + | samtools sort --output-fmt BAM - > ~{outputPath} } output { @@ -28,12 +31,12 @@ task mem { } runtime{ - cpu: select_first([threads,1]) - memory: select_first([memory,8]) + cpu: threads + memory: memory } } -task index { +task Index { input { File fasta String? preCommand diff --git a/centrifuge.wdl b/centrifuge.wdl index a6659775f49748069a5f06ccec9961d938d549a0..4b128c33627eb4eec4facb184c4e49a321d4b4a7 100644 --- a/centrifuge.wdl +++ b/centrifuge.wdl @@ -1,4 +1,5 @@ version 1.0 + # Copyright Sequencing Analysis Support Core - Leiden University Medical Center 2018 # # Tasks from centrifuge @@ -9,15 +10,15 @@ task Build { File inputFasta String centrifugeIndexBase String? preCommand - String? centrifugeBuildExecutable = "centrifuge-build" + String centrifugeBuildExecutable = "centrifuge-build" #Boolean? c = false - Boolean? largeIndex = false - Boolean? noAuto = false + Boolean largeIndex = false + Boolean noAuto = false Int? bMax Int? bMaxDivn - Boolean? noDiffCover = false - Boolean? noRef = false - Boolean? justRef = false + Boolean noDiffCover = false + Boolean noRef = false + Boolean justRef = false Int? offRate Int? fTabChars File? nameTable @@ -25,8 +26,8 @@ task Build { Int? seed Int? kmerCount - Int? threads - Int? memory + Int threads = 8 + Int memory = 20 } command { @@ -55,15 +56,15 @@ task Build { } runtime { - cpu: select_first([threads, 8]) - memory: select_first([memory, 20]) + cpu: threads + memory: memory } } task Classify { input { String outputDir - Boolean? compressOutput = true + Boolean compressOutput = true String? preCommand String indexPrefix Array[File]? unpairedReads @@ -79,8 +80,8 @@ task Classify { Array[String]? hostTaxIds Array[String]? excludeTaxIds - Int? threads - Int? memory + Int threads = 4 + Int memory = 8 } String outputFilePath = outputDir + "/centrifuge.out" @@ -94,7 +95,7 @@ task Classify { mkdir -p ~{outputDir} ~{preCommand} centrifuge \ - ~{"-p " + select_first([threads, 4])} \ + ~{"-p " + threads} \ ~{"-x " + indexPrefix} \ ~{true="-f" false="" fastaInput} \ ~{true="-k" false="" defined(assignments)} ~{assignments} \ @@ -116,8 +117,8 @@ task Classify { } runtime { - cpu: select_first([threads, 4]) - memory: select_first([memory, 8]) + cpu: threads + memory: memory } } @@ -125,18 +126,18 @@ task Download { input { String libraryPath Array[String]? domain - String? executable = "centrifuge-download" + String executable = "centrifuge-download" String? preCommand String? seqTaxMapPath - String? database = "refseq" + String database = "refseq" String? assemblyLevel String? refseqCategory Array[String]? taxIds - Boolean? filterUnplaced = false - Boolean? maskLowComplexRegions = false - Boolean? downloadRnaSeqs = false - Boolean? modifyHeader = false - Boolean? downloadGiMap = false + Boolean filterUnplaced = false + Boolean maskLowComplexRegions = false + Boolean downloadRnaSeqs = false + Boolean modifyHeader = false + Boolean downloadGiMap = false } # This will use centrifuge-download to download. @@ -159,6 +160,7 @@ task Download { ~{true='-g' false='' downloadGiMap} \ ~{database} ~{">> " + seqTaxMapPath} } + output { File seqTaxMap = "~{seqTaxMapPath}" File library = libraryPath @@ -169,7 +171,7 @@ task Download { task DownloadTaxonomy { input { String centrifugeTaxonomyDir - String? executable = "centrifuge-download" + String executable = "centrifuge-download" String? preCommand } command { @@ -192,8 +194,8 @@ task Kreport { File centrifugeOut Boolean inputIsCompressed String outputDir - String? suffix = "kreport" - String? prefix = "centrifuge" + String suffix = "kreport" + String prefix = "centrifuge" String indexPrefix Boolean? onlyUnique Boolean? showZeros @@ -201,8 +203,8 @@ task Kreport { Int? minScore Int? minLength - Int? cores - Int? memory + Int cores = 1 + Int memory = 4 } String kreportFilePath = outputDir + "/" + prefix + "." + suffix @@ -226,7 +228,7 @@ task Kreport { } runtime { - cpu: select_first([cores, 1]) - memory: select_first([memory, 4]) + cpu: cores + memory: memory } } diff --git a/common.wdl b/common.wdl index 581553ad71957985b0e3fa5541c6d0f3f26c122f..15e99f5804089fdd328f263b21804dc18712e752 100644 --- a/common.wdl +++ b/common.wdl @@ -38,8 +38,8 @@ task ConcatenateTextFiles { input { Array[File] fileList String combinedFilePath - Boolean? unzip = false - Boolean? zip = false + Boolean unzip = false + Boolean zip = false } command { diff --git a/cutadapt.wdl b/cutadapt.wdl index 4a09e0dd144013cceec4f13b92ed180e77e0a51b..8b073442c02a449871f7dc6a320a8eabdf82d8d4 100644 --- a/cutadapt.wdl +++ b/cutadapt.wdl @@ -1,6 +1,6 @@ version 1.0 -task cutadapt { +task Cutadapt { input { File read1 File? read2 @@ -8,8 +8,8 @@ task cutadapt { String? read2output String? format String? preCommand - Int? cores = 1 - Int? memory = 4 + Int cores = 1 + Int memory = 4 Array[String]+? adapter Array[String]+? front Array[String]+? anywhere @@ -69,16 +69,19 @@ task cutadapt { ~{preCommand} cutadapt \ ~{"--cores=" + cores} \ - ~{true="-a " false="" defined(adapter)} ~{sep=" -a " adapter} \ - ~{true="-A " false="" defined(adapterRead2)} ~{sep=" -A " adapterRead2} \ - ~{true="-g " false="" defined(front)} ~{sep=" -g " front} \ - ~{true="-G " false="" defined(frontRead2)} ~{sep=" -G " frontRead2} \ - ~{true="-b " false="" defined(anywhere)} ~{sep=" -b " anywhere} \ - ~{true="-B " false="" defined(anywhereRead2)} ~{sep=" -B " anywhereRead2} \ + ~{true="-a" false="" defined(adapter)} ~{sep=" -a " adapter} \ + ~{true="-A" false="" defined(adapterRead2)} ~{sep=" -A " adapterRead2} \ + ~{true="-g" false="" defined(front)} ~{sep=" -g " front} \ + ~{true="-G" false="" defined(frontRead2)} ~{sep=" -G " frontRead2} \ + ~{true="-b" false="" defined(anywhere)} ~{sep=" -b " anywhere} \ + ~{true="-B" false="" defined(anywhereRead2)} ~{sep=" -B " anywhereRead2} \ --output ~{read1output} ~{"--paired-output " + read2output} \ - ~{"--to-short-output " + tooShortOutputPath} ~{"--to-short-paired-output " + tooShortPairedOutputPath} \ - ~{"--to-long-output " + tooLongOutputPath} ~{"--to-long-paired-output " + tooLongPairedOutputPath} \ - ~{"--untrimmed-output " + untrimmedOutputPath} ~{"--untrimmed-paired-output " + untrimmedPairedOutputPath} \ + ~{"--to-short-output " + tooShortOutputPath} \ + ~{"--to-short-paired-output " + tooShortPairedOutputPath} \ + ~{"--to-long-output " + tooLongOutputPath} \ + ~{"--to-long-paired-output " + tooLongPairedOutputPath} \ + ~{"--untrimmed-output " + untrimmedOutputPath} \ + ~{"--untrimmed-paired-output " + untrimmedPairedOutputPath} \ ~{"--pair-filter " + pairFilter} \ ~{"--error-rate " + errorRate} \ ~{"--times " + times} \ @@ -99,14 +102,24 @@ task cutadapt { ~{"--info-file " + infoFilePath } \ ~{"--rest-file " + restFilePath } \ ~{"--wildcard-file " + wildcardFilePath} \ - ~{true="--match-read-wildcards" false="" matchReadWildcards} ~{true="--no-match-adapter-wildcards" false="" noMatchAdapterWildcards} \ - ~{true="--no-trim" false="" noTrim} ~{true="--mask-adapter" false="" maskAdapter} \ - ~{true="--no-indels" false="" noIndels} ~{true="--trim-n" false="" trimN} \ - ~{true="--interleaved" false="" interleaved} ~{true="--discard-trimmed" false="" discardTrimmed } \ - ~{true="--colorspace" false="" colorspace} ~{true="--double-encode" false="" doubleEncode} \ - ~{true="--strip-f3" false="" stripF3} ~{true="--maq" false="" maq} ~{true="--bwa" false="" bwa} \ - ~{true="--zero-cap" false="" zeroCap} ~{true="--no-zero-cap" false="" noZeroCap} \ - ~{read1} ~{read2} ~{"> " + reportPath} + ~{true="--match-read-wildcards" false="" matchReadWildcards} \ + ~{true="--no-match-adapter-wildcards" false="" noMatchAdapterWildcards} \ + ~{true="--no-trim" false="" noTrim} \ + ~{true="--mask-adapter" false="" maskAdapter} \ + ~{true="--no-indels" false="" noIndels} \ + ~{true="--trim-n" false="" trimN} \ + ~{true="--interleaved" false="" interleaved} \ + ~{true="--discard-trimmed" false="" discardTrimmed } \ + ~{true="--colorspace" false="" colorspace} \ + ~{true="--double-encode" false="" doubleEncode} \ + ~{true="--strip-f3" false="" stripF3} \ + ~{true="--maq" false="" maq} \ + ~{true="--bwa" false="" bwa} \ + ~{true="--zero-cap" false="" zeroCap} \ + ~{true="--no-zero-cap" false="" noZeroCap} \ + ~{read1} \ + ~{read2} \ + ~{"> " + reportPath} } output{ @@ -125,7 +138,7 @@ task cutadapt { } runtime { - cpu: select_first([cores]) - memory: select_first([memory]) + cpu: cores + memory: memory } } diff --git a/fastqc.wdl b/fastqc.wdl index 4ca2733c53e2df4ddc58fec3a22081340d20ee52..6d924cf550a84640fcf3e8f9e1b555d2cf239dd7 100644 --- a/fastqc.wdl +++ b/fastqc.wdl @@ -1,6 +1,6 @@ version 1.0 -task fastqc { +task Fastqc { input { File seqFile String outdirPath @@ -8,11 +8,11 @@ task fastqc { Boolean? casava Boolean? nano Boolean? noFilter - Boolean? extract = true + Boolean extract = true Boolean? nogroup Int? minLength String? format - Int? threads = 1 + Int threads = 1 File? contaminants File? adapters File? limits @@ -56,14 +56,14 @@ task fastqc { } runtime { - cpu: select_first([threads]) + cpu: threads } } -task getConfiguration { +task GetConfiguration { input { String? preCommand - String? fastqcDirFile = "fastqcDir.txt" + String fastqcDirFile = "fastqcDir.txt" } command { diff --git a/flash.wdl b/flash.wdl index 93ba4cd92b4f3d16a6e209c1fca9c6972b6052d9..3d3eecdf3820be7c841ca44f0f4de580df5e61d1 100644 --- a/flash.wdl +++ b/flash.wdl @@ -1,17 +1,17 @@ version 1.0 -task flash { +task Flash { input { String? preCommand File inputR1 File inputR2 String outdirPath - String? outPrefix = "flash" + String outPrefix = "flash" Int? minOverlap Int? maxOverlap - Boolean? compress = true - Int? threads - Int? memory + Boolean compress = true + Int threads = 2 + Int memory = 2 } command { @@ -22,7 +22,7 @@ task flash { ~{"--threads=" + threads} \ ~{"--output-directory=" + outdirPath} \ ~{"--output-prefix=" + outPrefix} \ - ~{true="--compress " false="" defined(compress)} \ + ~{true="--compress " false="" compress} \ ~{"--min-overlap=" + minOverlap} \ ~{"--max-overlap=" + maxOverlap} \ ~{inputR1} ~{inputR2} @@ -37,8 +37,8 @@ task flash { } runtime { - cpu: select_first([threads, 2]) - memory: select_first([memory, 2]) + cpu: threads + memory: memory } } \ No newline at end of file diff --git a/gatk.wdl b/gatk.wdl index c8ea6e7d1e484e4afa334981ca8864b58b3d7d10..68281f386d0dab5e69f734415711a570f657382b 100644 --- a/gatk.wdl +++ b/gatk.wdl @@ -1,4 +1,5 @@ version 1.0 + # Apply Base Quality Score Recalibration (BQSR) model task ApplyBQSR { input { @@ -14,30 +15,30 @@ task ApplyBQSR { File refFastaIndex Int? compressionLevel - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(gatkJar) - then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk --java-options -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + gatkJar + else "gatk --java-options -Xmx" + memory + "G" command { set -e -o pipefail ~{preCommand} ~{toolCommand} \ - ApplyBQSR \ - --create-output-bam-md5 \ - --add-output-sam-program-record \ - -R ~{refFasta} \ - -I ~{inputBam} \ - --use-original-qualities \ - -O ~{outputBamPath} \ - -bqsr ~{recalibrationReport} \ - --static-quantized-quals 10 --static-quantized-quals 20 --static-quantized-quals 30 \ - -L ~{sep=" -L " sequenceGroupInterval} + ApplyBQSR \ + --create-output-bam-md5 \ + --add-output-sam-program-record \ + -R ~{refFasta} \ + -I ~{inputBam} \ + --use-original-qualities \ + -O ~{outputBamPath} \ + -bqsr ~{recalibrationReport} \ + --static-quantized-quals 10 \ + --static-quantized-quals 20 \ + --static-quantized-quals 30 \ + -L ~{sep=" -L " sequenceGroupInterval} } output { @@ -46,7 +47,7 @@ task ApplyBQSR { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -66,8 +67,8 @@ task BaseRecalibrator { File refDict File refFasta File refFastaIndex - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3.0 } Array[File]+ knownIndelsSitesVCFsArg = flatten([ @@ -79,23 +80,21 @@ task BaseRecalibrator { select_all([dbsnpVCFindex]) ]) - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(gatkJar) - then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk --java-options -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + gatkJar + else "gatk --java-options -Xmx" + memory + "G" command { set -e -o pipefail ~{preCommand} ~{toolCommand} \ - BaseRecalibrator \ - -R ~{refFasta} \ - -I ~{inputBam} \ - --use-original-qualities \ - -O ~{recalibrationReportPath} \ - --known-sites ~{sep=" --known-sites " knownIndelsSitesVCFsArg} \ - -L ~{sep=" -L " sequenceGroupInterval} + BaseRecalibrator \ + -R ~{refFasta} \ + -I ~{inputBam} \ + --use-original-qualities \ + -O ~{recalibrationReportPath} \ + --known-sites ~{sep=" --known-sites " knownIndelsSitesVCFsArg} \ + -L ~{sep=" -L " sequenceGroupInterval} } output { @@ -103,7 +102,7 @@ task BaseRecalibrator { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -122,16 +121,14 @@ task CombineGVCFs { File refFastaIndex File refDict - Int? compressionLevel - Float? memory - Float? memoryMultiplier + Int? compressionLevel #TODO This isn't being used? + Int memory = 4 + Float memoryMultiplier = 3.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(gatkJar) - then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk --java-options -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + gatkJar + else "gatk --java-options -Xmx" + memory + "G" command { set -e -o pipefail @@ -156,7 +153,7 @@ task CombineGVCFs { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -168,15 +165,13 @@ task GatherBqsrReports { Array[File] inputBQSRreports String outputReportPath - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(gatkJar) - then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk --java-options -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + gatkJar + else "gatk --java-options -Xmx" + memory + "G" command { set -e -o pipefail @@ -192,7 +187,7 @@ task GatherBqsrReports { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -215,30 +210,27 @@ task GenotypeGVCFs { File? dbsnpVCFindex Int? compressionLevel - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier =3.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(gatkJar) - then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk --java-options -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + gatkJar + else "gatk --java-options -Xmx" + memory + "G" command { set -e -o pipefail ~{preCommand} - ~{toolCommand} \ - GenotypeGVCFs \ - -R ~{refFasta} \ - -O ~{outputPath} \ - ~{"-D " + dbsnpVCF} \ - -G StandardAnnotation \ - --only-output-calls-starting-in-intervals \ - -new-qual \ - -V ~{gvcfFiles} \ - -L ~{sep=' -L ' intervals} + GenotypeGVCFs \ + -R ~{refFasta} \ + -O ~{outputPath} \ + ~{"-D " + dbsnpVCF} \ + -G StandardAnnotation \ + --only-output-calls-starting-in-intervals \ + -new-qual \ + -V ~{gvcfFiles} \ + -L ~{sep=' -L ' intervals} } output { @@ -247,13 +239,13 @@ task GenotypeGVCFs { } runtime{ - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } # Call variants on a single sample with HaplotypeCaller to produce a GVCF task HaplotypeCallerGvcf { - input { + input { String? preCommand Array[File]+ inputBams Array[File]+ inputBamsIndex @@ -262,35 +254,33 @@ task HaplotypeCallerGvcf { File refDict File refFasta File refFastaIndex - Float? contamination + Float contamination = 0.0 Int? compressionLevel String? gatkJar File? dbsnpVCF File? dbsnpVCFindex - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(gatkJar) - then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk --java-options -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + gatkJar + else "gatk --java-options -Xmx" + memory + "G" command { set -e -o pipefail ~{preCommand} ~{toolCommand} \ - HaplotypeCaller \ - -R ~{refFasta} \ - -O ~{gvcfPath} \ - -I ~{sep=" -I " inputBams} \ - -L ~{sep=' -L ' intervalList} \ - ~{"-D " + dbsnpVCF} \ - -contamination ~{default=0 contamination} \ - -ERC GVCF + HaplotypeCaller \ + -R ~{refFasta} \ + -O ~{gvcfPath} \ + -I ~{sep=" -I " inputBams} \ + -L ~{sep=' -L ' intervalList} \ + ~{"-D " + dbsnpVCF} \ + -contamination ~{contamination} \ + -ERC GVCF } output { @@ -299,7 +289,7 @@ task HaplotypeCallerGvcf { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -316,15 +306,13 @@ task SplitNCigarReads { String? gatkJar Array[File]+ intervals - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(gatkJar) - then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk --java-options -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + gatkJar + else "gatk --java-options -Xmx" + memory + "G" command { set -e -o pipefail @@ -343,6 +331,6 @@ task SplitNCigarReads { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } diff --git a/htseq.wdl b/htseq.wdl index 87c4c676fe5ea2485837449b0d802ea52e927fe4..db399cc2fb35061e69d280eb2efbcf44e1ccfb6d 100644 --- a/htseq.wdl +++ b/htseq.wdl @@ -6,11 +6,11 @@ task HTSeqCount { Array[File] alignmentFiles File gtfFile String outputTable - String? format - String? order - String? stranded + String format = "bam" + String order = "pos" + String stranded = "no" - Int? memory + Int memory = 3 } command { @@ -18,9 +18,9 @@ task HTSeqCount { mkdir -p ~{sub(outputTable, basename(outputTable), "")} ~{preCommand} htseq-count \ - -f ~{default="bam" format} \ - -r ~{default="pos" order} \ - -s ~{default="no" stranded} \ + -f ~{format} \ + -r ~{order} \ + -s ~{stranded} \ ~{sep=" " alignmentFiles} \ ~{gtfFile} \ > ~{outputTable} @@ -31,6 +31,6 @@ task HTSeqCount { } runtime { - memory: select_first([memory, 3]) + memory: memory } } \ No newline at end of file diff --git a/macs2.wdl b/macs2.wdl index fb580348dbad6f6f10fba2f48d68545a25fd49b2..8edcabab08bcbb6ec3fc3310d0968ebacfc1550e 100644 --- a/macs2.wdl +++ b/macs2.wdl @@ -6,9 +6,9 @@ task PeakCalling { Array[File] bamFiles String outDir String sampleName - Int? threads - Int? memory - Boolean? nomodel + Int threads = 1 + Int memory = 8 + Boolean nomodel = false } command { @@ -18,7 +18,7 @@ task PeakCalling { --treatment ~{sep = ' ' bamFiles} \ --outdir ~{outDir} \ --name ~{sampleName} \ - ~{default=false true='--nomodel' false='' nomodel} + ~{true='--nomodel' false='' nomodel} } output { @@ -26,7 +26,7 @@ task PeakCalling { } runtime { - cpu: select_first([threads,1]) - memory: select_first([memory,8]) + cpu: threads + memory: memory } } \ No newline at end of file diff --git a/ncbi.wdl b/ncbi.wdl index b6e0deb6f2008d6b238595c85779f31955788615..0678d3d4ea2fffcb9207e972779d056679058fe0 100644 --- a/ncbi.wdl +++ b/ncbi.wdl @@ -1,6 +1,6 @@ version 1.0 -task genomeDownload { +task GenomeDownload { input { String outputPath String? section = "refseq" @@ -12,11 +12,11 @@ task genomeDownload { String? ncbiBaseUri Int? parallel Int? retries - Boolean? verbose=true - Boolean? debug + Boolean verbose = true + Boolean debug = false String? domain = "all" - String? executable = "ncbi-genome-download" + String executable = "ncbi-genome-download" String? preCommand } @@ -72,11 +72,11 @@ task genomeDownload { } -task downloadNtFasta{ +task DownloadNtFasta{ input { String libraryPath String seqTaxMapPath - Boolean? unzip = true + Boolean unzip = true String ntDir = libraryPath + "/nt" String ntFilePath = ntDir + "/nt.fna" } @@ -91,7 +91,8 @@ task downloadNtFasta{ then zcat ~{ntDir}/nt.gz > ~{ntFilePath} fi - } + } + output { File ntFileGz = ntDir + "/nt.gz" File library = libraryPath @@ -102,7 +103,7 @@ task downloadNtFasta{ } } -task downloadAccessionToTaxId { +task DownloadAccessionToTaxId { input { String downloadDir Boolean gzip = false @@ -111,13 +112,18 @@ task downloadAccessionToTaxId { command { set -e -o pipefail mkdir -p ~{downloadDir} - rsync -av --partial rsync://ftp.ncbi.nlm.nih.gov/pub/taxonomy/accession2taxid/nucl_*.accession2taxid.gz* ~{downloadDir} + rsync -av \ + --partial \ + rsync://ftp.ncbi.nlm.nih.gov/pub/taxonomy/accession2taxid/nucl_*.accession2taxid.gz* \ + ~{downloadDir} (cd ~{downloadDir} && md5sum -c *.md5) for file in ~{downloadDir}/nucl_*.accession2taxid.gz do - zcat $file | tail -n +2 | cut -f 2,3 ~{true="| gzip " false='' gzip}> $file.seqtaxmap~{true='.gz' false='' gzip} + zcat $file | tail -n +2 | cut -f 2,3 ~{true="| gzip" false='' gzip} > \ + $file.seqtaxmap~{true='.gz' false='' gzip} done - } + } + output { Array[File] seqTaxMaps = glob(downloadDir + "/*.seqtaxmap") Array[File] seqTaxMapsGz = glob(downloadDir + "/*.seqtaxmap.gz") diff --git a/picard.wdl b/picard.wdl index 71f566e8ad0591da14d0848a2acfd4e583e211ad..0b13ebe4dbf857f311d5f5836e668ebd0545d62d 100644 --- a/picard.wdl +++ b/picard.wdl @@ -10,29 +10,25 @@ task CollectMultipleMetrics { File refFastaIndex String basename - # These should proably be optional, but I'm not sure how to handle the ouput in that - # case (without a null literal). Boolean collectAlignmentSummaryMetrics = true Boolean collectInsertSizeMetrics = true Boolean qualityScoreDistribution = true Boolean meanQualityByCycle = true Boolean collectBaseDistributionByCycle = true Boolean collectGcBiasMetrics = true - #Boolean? rnaSeqMetrics = false # There is a bug in picard https://github.com/broadinstitute/picard/issues/999 + #Boolean rnaSeqMetrics = false # There is a bug in picard https://github.com/broadinstitute/picard/issues/999 Boolean collectSequencingArtifactMetrics = true Boolean collectQualityYieldMetrics = true String? picardJar - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(picardJar) - then "java -Xmx" + mem + "G -jar " + picardJar - else "picard -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + picardJar + else "picard -Xmx" + memory + "G" command { set -e -o pipefail @@ -77,7 +73,7 @@ task CollectMultipleMetrics { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -88,19 +84,17 @@ task CollectRnaSeqMetrics { File bamIndex File refRefflat String basename - String? strandSpecificity = "NONE" + String strandSpecificity = "NONE" String? picardJar - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(picardJar) - then "java -Xmx" + mem + "G -jar " + picardJar - else "picard -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + picardJar + else "picard -Xmx" + memory + "G" command { set -e -o pipefail @@ -111,7 +105,7 @@ task CollectRnaSeqMetrics { I=~{bamFile} \ O=~{basename}.RNA_Metrics \ CHART_OUTPUT=~{basename}.RNA_Metrics.pdf \ - ~{"STRAND_SPECIFICITY=" + strandSpecificity} \ + STRAND_SPECIFICITY=~{strandSpecificity} \ REF_FLAT=~{refRefflat} } @@ -121,7 +115,7 @@ task CollectRnaSeqMetrics { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -139,15 +133,13 @@ task CollectTargetedPcrMetrics { String? picardJar - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(picardJar) - then "java -Xmx" + mem + "G -jar " + picardJar - else "picard -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + picardJar + else "picard -Xmx" + memory + "G" command { set -e -o pipefail @@ -171,7 +163,7 @@ task CollectTargetedPcrMetrics { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -184,25 +176,23 @@ task GatherBamFiles { Int? compression_level String? picardJar - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(picardJar) - then "java -Xmx" + mem + "G -jar " + picardJar - else "picard -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + picardJar + else "picard -Xmx" + memory + "G" command { set -e -o pipefail ~{preCommand} ~{toolCommand} \ - GatherBamFiles \ - INPUT=~{sep=' INPUT=' input_bams} \ - OUTPUT=~{output_bam_path} \ - CREATE_INDEX=true \ - CREATE_MD5_FILE=true + GatherBamFiles \ + INPUT=~{sep=' INPUT=' input_bams} \ + OUTPUT=~{output_bam_path} \ + CREATE_INDEX=true \ + CREATE_MD5_FILE=true } output { @@ -212,7 +202,7 @@ task GatherBamFiles { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -226,8 +216,8 @@ task MarkDuplicates { Int? compression_level String? picardJar - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3.0 # The program default for READ_NAME_REGEX is appropriate in nearly every case. # Sometimes we wish to supply "null" in order to turn off optical duplicate detection @@ -238,27 +228,26 @@ task MarkDuplicates { # Task is assuming query-sorted input so that the Secondary and Supplementary reads get marked correctly # This works because the output of BWA is query-grouped and therefore, so is the output of MergeBamAlignment. # While query-grouped isn't actually query-sorted, it's good enough for MarkDuplicates with ASSUME_SORT_ORDER="queryname" - Int mem = ceil(select_first([memory, 4.0])) String toolCommand = if defined(picardJar) - then "java -Xmx" + mem + "G -jar " + picardJar - else "picard -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + picardJar + else "picard -Xmx" + memory + "G" command { set -e -o pipefail ~{preCommand} mkdir -p $(dirname ~{output_bam_path}) ~{toolCommand} \ - MarkDuplicates \ - INPUT=~{sep=' INPUT=' input_bams} \ - OUTPUT=~{output_bam_path} \ - METRICS_FILE=~{metrics_path} \ - VALIDATION_STRINGENCY=SILENT \ - ~{"READ_NAME_REGEX=" + read_name_regex} \ - OPTICAL_DUPLICATE_PIXEL_DISTANCE=2500 \ - CLEAR_DT="false" \ - CREATE_INDEX=true \ - ADD_PG_TAG_TO_READS=false + MarkDuplicates \ + INPUT=~{sep=' INPUT=' input_bams} \ + OUTPUT=~{output_bam_path} \ + METRICS_FILE=~{metrics_path} \ + VALIDATION_STRINGENCY=SILENT \ + ~{"READ_NAME_REGEX=" + read_name_regex} \ + OPTICAL_DUPLICATE_PIXEL_DISTANCE=2500 \ + CLEAR_DT="false" \ + CREATE_INDEX=true \ + ADD_PG_TAG_TO_READS=false } output { @@ -268,7 +257,7 @@ task MarkDuplicates { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -282,25 +271,24 @@ task MergeVCFs { Int? compressionLevel String? picardJar - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3.0 } # Using MergeVcfs instead of GatherVcfs so we can create indices # See https://github.com/broadinstitute/picard/issues/789 for relevant GatherVcfs ticket - Int mem = ceil(select_first([memory, 4.0])) String toolCommand = if defined(picardJar) - then "java -Xmx" + mem + "G -jar " + picardJar - else "picard -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + picardJar + else "picard -Xmx" + memory + "G" command { set -e -o pipefail ~{preCommand} ~{toolCommand} \ - MergeVcfs \ - INPUT=~{sep=' INPUT=' inputVCFs} \ - OUTPUT=~{outputVCFpath} + MergeVcfs \ + INPUT=~{sep=' INPUT=' inputVCFs} \ + OUTPUT=~{outputVCFpath} } output { @@ -309,7 +297,7 @@ task MergeVCFs { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -320,16 +308,15 @@ task SamToFastq { String outputRead1 String? outputRead2 String? outputUnpaired + String? picardJar - Float? memory - Float? memoryMultiplier + Int memory = 16 # High memory default to avoid crashes. + Float memoryMultiplier = 3.0 } - Int mem = ceil(select_first([memory, 16.0])) # High memory default to avoid crashes. - String toolCommand = if defined(picardJar) - then "java -Xmx" + mem + "G -jar " + picardJar - else "picard -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + picardJar + else "picard -Xmx" + memory + "G" command { set -e -o pipefail @@ -349,7 +336,7 @@ task SamToFastq { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } } @@ -360,28 +347,26 @@ task ScatterIntervalList { Int scatter_count String? picardJar - Float? memory - Float? memoryMultiplier + Int memory = 4 + Float memoryMultiplier = 3.0 } - Int mem = ceil(select_first([memory, 4.0])) - String toolCommand = if defined(picardJar) - then "java -Xmx" + mem + "G -jar " + picardJar - else "picard -Xmx" + mem + "G" + then "java -Xmx" + memory + "G -jar " + picardJar + else "picard -Xmx" + memory + "G" command { set -e -o pipefail ~{preCommand} mkdir scatter_list ~{toolCommand} \ - IntervalListTools \ - SCATTER_COUNT=~{scatter_count} \ - SUBDIVISION_MODE=BALANCING_WITHOUT_INTERVAL_SUBDIVISION_WITH_OVERFLOW \ - UNIQUE=true \ - SORT=true \ - INPUT=~{interval_list} \ - OUTPUT=scatter_list + IntervalListTools \ + SCATTER_COUNT=~{scatter_count} \ + SUBDIVISION_MODE=BALANCING_WITHOUT_INTERVAL_SUBDIVISION_WITH_OVERFLOW \ + UNIQUE=true \ + SORT=true \ + INPUT=~{interval_list} \ + OUTPUT=scatter_list } output { @@ -390,6 +375,6 @@ task ScatterIntervalList { } runtime { - memory: ceil(mem * select_first([memoryMultiplier, 3.0])) + memory: ceil(memory * memoryMultiplier) } -} \ No newline at end of file +} diff --git a/samtools.wdl b/samtools.wdl index d756fda3367a89c7a8f97d9ede216f45592bcce8..2d910379db88bb9402df50c2e0704e08263a9ff7 100644 --- a/samtools.wdl +++ b/samtools.wdl @@ -14,7 +14,9 @@ task Index { } output { - File indexFile = if defined(bamIndexPath) then select_first([bamIndexPath]) else bamFilePath + ".bai" + File indexFile = if defined(bamIndexPath) + then select_first([bamIndexPath]) + else bamFilePath + ".bai" } } @@ -73,7 +75,7 @@ task Flagstat { } } -task fastq { +task Fastq { input { String? preCommand File inputBam @@ -86,9 +88,8 @@ task fastq { Boolean? appendReadNumber Boolean? outputQuality Int? compressionLevel - Int? threads - Int? memory - Int totalThreads = select_first([threads, 1]) + Int threads = 1 + Int memory = 1 } command { @@ -103,7 +104,7 @@ task fastq { ~{true="-N" false="-n" appendReadNumber} \ ~{true="-O" false="" outputQuality} \ ~{"-c " + compressionLevel} \ - ~{"--threads " + totalThreads} \ + ~{"--threads " + threads} \ ~{inputBam} } @@ -114,8 +115,8 @@ task fastq { } runtime { - cpu: totalThreads - memory: select_first([memory, 1]) + cpu: threads + memory: memory } parameter_meta { @@ -130,7 +131,7 @@ task fastq { } } -task view { +task View { input { String? preCommand File inFile @@ -141,8 +142,8 @@ task view { Int? includeFilter Int? excludeFilter Int? excludeSpecificFilter - Int? threads - Int? memory + Int threads = 1 + Int memory = 1 } command { @@ -164,7 +165,7 @@ task view { File outputFile = outputFileName } runtime { - cpu: select_first([threads, 1]) - memory: select_first([memory, 1]) + cpu: threads + memory: memory } } diff --git a/seqtk.wdl b/seqtk.wdl index d55fa716a993525a68d0559ad97462d31de513af..64c604a5ecfe0beba399605dcabb1bb3de0ee59a 100644 --- a/seqtk.wdl +++ b/seqtk.wdl @@ -1,31 +1,32 @@ version 1.0 -task sample { +task Sample { input { File sequenceFile - String? outFilePath = "subsampledReads.fq.gz" + String outFilePath = "subsampledReads.fq.gz" String? preCommand Int? seed - Boolean? twoPassMode + Boolean twoPassMode Float? fraction Int? number - Boolean? zip = true + Boolean zip = true } command { set -e -o pipefail - ~{'mkdir -p $(dirname ' + outFilePath + ')'} + mkdir -p $(dirname outFilePath) ~{preCommand} seqtk sample \ ~{"-s " + seed} \ ~{true="-2 " false="" twoPassMode} \ ~{sequenceFile} \ - ~{number} ~{fraction} \ + ~{number} \ + ~{fraction} \ ~{true="| gzip" false="" zip} \ - ~{"> " + outFilePath} + > ~{outFilePath} } output { - File subsampledReads= select_first([outFilePath]) + File subsampledReads = outFilePath } } \ No newline at end of file diff --git a/spades.wdl b/spades.wdl index 57bc6eb83ef5b6f5cbd30778f54b9c92c6e03451..47195f196967b8b1863b908d9c483ed49df9f978 100644 --- a/spades.wdl +++ b/spades.wdl @@ -1,6 +1,6 @@ version 1.0 -task spades { +task Spades { input { String outputDir String? preCommand @@ -24,18 +24,15 @@ task spades { Boolean? disableGzipOutput Boolean? disableRepeatResolution File? dataset - Int? threads = 1 - Float? memoryGb + Int threads = 1 + Float memoryGb = 16.0 File? tmpDir String? k Float? covCutoff Int? phredOffset } - Int finalThreads = select_first([threads]) - Float totalMemory = select_first([memoryGb, finalThreads * 16.0]) - Int finalMemory = ceil(totalMemory) - Int clusterMemory = ceil(totalMemory / finalThreads) + Int clusterMemory = ceil(memoryGb / threads) command { set -e -o pipefail @@ -47,26 +44,26 @@ task spades { ~{true="--rna" false="" rna} \ ~{true="--plasmid" false="" plasmid} \ ~{true="--iontorrent" false="" ionTorrent} \ - ~{"--12 " + interlacedReads } \ + ~{"--12 " + interlacedReads} \ ~{true="-1" false="-s" defined(read2)} ~{read1} \ - ~{"-2 " + read2 } \ - ~{"--sanger " + sangerReads } \ - ~{"--pacbio " + pacbioReads } \ - ~{"--nanopore " + nanoporeReads } \ - ~{"--tslr " + tslrContigs } \ - ~{"--trusted-contigs " + trustedContigs } \ - ~{"--untrusted-contigs " + untrustedContigs } \ - ~{true="--only-error-correction" false="" onlyErrorCorrection } \ - ~{true="--only-assembler" false="" onlyAssembler } \ - ~{true="--careful" false="" careful } \ + ~{"-2 " + read2} \ + ~{"--sanger " + sangerReads} \ + ~{"--pacbio " + pacbioReads} \ + ~{"--nanopore " + nanoporeReads} \ + ~{"--tslr " + tslrContigs} \ + ~{"--trusted-contigs " + trustedContigs} \ + ~{"--untrusted-contigs " + untrustedContigs} \ + ~{true="--only-error-correction" false="" onlyErrorCorrection} \ + ~{true="--only-assembler" false="" onlyAssembler} \ + ~{true="--careful" false="" careful} \ ~{true="--disable-gzip-output" false="" disableGzipOutput} \ - ~{true="--disable-rr" false="" disableRepeatResolution } \ - ~{"--dataset " + dataset } \ - ~{"--threads " + finalThreads} \ - ~{"--memory " + finalMemory } \ - ~{"-k " + k } \ - ~{"--cov-cutoff " + covCutoff } \ - ~{"--phred-offset " + phredOffset } + ~{true="--disable-rr" false="" disableRepeatResolution} \ + ~{"--dataset " + dataset} \ + ~{"--threads " + threads} \ + ~{"--memory " + memoryGb} \ + ~{"-k " + k} \ + ~{"--cov-cutoff " + covCutoff} \ + ~{"--phred-offset " + phredOffset} } output { @@ -82,7 +79,7 @@ task spades { } runtime { - cpu: finalThreads + cpu: threads memory: clusterMemory } } \ No newline at end of file diff --git a/star.wdl b/star.wdl index 1301fe145daaf9d79c7055e5cea7d30dcc322e4d..e03f6301052b648f2b86cd126e5ecfd9bdd27aed 100644 --- a/star.wdl +++ b/star.wdl @@ -9,23 +9,20 @@ task Star { String genomeDir String outFileNamePrefix - String? outSAMtype - String? readFilesCommand - Int? runThreadN + String outSAMtype = "BAM SortedByCoordinate" + String readFilesCommand = "zcat" + Int runThreadN = 1 String? outStd String? twopassMode Array[String]? outSAMattrRGline Int? limitBAMsortRAM - Int? memory + Int memory = 10 } #TODO needs to be extended for all possible output extensions Map[String, String] samOutputNames = {"BAM SortedByCoordinate": "sortedByCoord.out.bam"} - # converts String? to String for use as key (for the Map above) in output - String key = select_first([outSAMtype, "BAM SortedByCoordinate"]) - command { set -e -o pipefail mkdir -p ~{sub(outFileNamePrefix, basename(outFileNamePrefix) + "$", "")} @@ -34,8 +31,8 @@ task Star { --readFilesIn ~{sep=',' inputR1} ~{sep="," inputR2} \ --outFileNamePrefix ~{outFileNamePrefix} \ --genomeDir ~{genomeDir} \ - --outSAMtype ~{default="BAM SortedByCoordinate" outSAMtype} \ - --readFilesCommand ~{default="zcat" readFilesCommand} \ + --outSAMtype ~{outSAMtype} \ + --readFilesCommand ~{readFilesCommand} \ ~{"--runThreadN " + runThreadN} \ ~{"--outStd " + outStd} \ ~{"--twopassMode " + twopassMode} \ @@ -44,25 +41,25 @@ task Star { } output { - File bamFile = outFileNamePrefix + "Aligned." + samOutputNames[key] + File bamFile = outFileNamePrefix + "Aligned." + samOutputNames[outSAMtype] } runtime { - cpu: select_first([runThreadN, 1]) - memory: select_first([memory, 10]) + cpu: runThreadN + memory: memory } } -task makeStarRGline { +task MakeStarRGline { input { String sample String library - String? platform + String platform = "ILLUMINA" String readgroup } command { - printf '"ID:~{readgroup}" "LB:~{library}" "PL:~{default="ILLUMINA" platform}" "SM:~{sample}"' + printf '"ID:~{readgroup}" "LB:~{library}" "PL:~{platform}" "SM:~{sample}"' } output { diff --git a/stringtie.wdl b/stringtie.wdl index 9929b8062aa9edb17a7fa3d832529794938e6b8d..97455da498f722ddf05008fc7102c9eef360335e 100644 --- a/stringtie.wdl +++ b/stringtie.wdl @@ -5,7 +5,7 @@ task Stringtie { String? preCommand File alignedReads File? referenceGtf - Int? threads + Int threads = 1 String assembledTranscriptsFile Boolean? firstStranded Boolean? secondStranded @@ -32,6 +32,6 @@ task Stringtie { } runtime { - cpu: select_first([threads, 1]) + cpu: threads } } \ No newline at end of file diff --git a/unicycler.wdl b/unicycler.wdl index 318252ae25ef8c94ab10e2f6cab7bfca5476971a..c5b30ba93c184a1aef7417e16997053ca507101e 100644 --- a/unicycler.wdl +++ b/unicycler.wdl @@ -1,6 +1,6 @@ version 1.0 -task unicycler { +task Unicycler { input { String? preCommand File? short1 @@ -12,8 +12,8 @@ task unicycler { Int? minFastaLength Int? keep Boolean? vcf - Int? threads = 1 - Int? memory = 4 + Int threads = 1 + Int memory = 4 String? mode Float? minBridgeQual Int? linearSeqs @@ -101,7 +101,7 @@ task unicycler { } runtime { - cpu: select_first([threads]) - memory: select_first([memory]) + cpu: threads + memory: memory } } \ No newline at end of file