From 0665c22fa2d64813c022e3e9dc731dac2a5fa63c Mon Sep 17 00:00:00 2001 From: Ruben Vorderman <r.h.p.vorderman@lumc.nl> Date: Wed, 24 Jun 2020 13:25:52 +0200 Subject: [PATCH] Add sortSam task --- picard.wdl | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/picard.wdl b/picard.wdl index 0ee5da3..ef648ae 100644 --- a/picard.wdl +++ b/picard.wdl @@ -650,6 +650,52 @@ task ScatterIntervalList { } } +task SortSam { + input { + File inputBam + String outputPath + + Int XmxGb = 4 + Int memoryGb = 1 + XmxGb + Int timeMinutes = 1 + ceil(size(inputBam, "G") * 2) + # A mulled container is needed to have both picard and bwa in one container. + # This container contains: picard (2.18.7), bwa (0.7.17-r1188) + String dockerImage = "quay.io/biocontainers/picard:2.23.1--h37ae868_0" + } + + command { + mkdir -p "$(dirname ~{outputPath})" + picard -Xmx~{XmxGb}G -XX:ParallelGCThreads=1 SortSam \ + INPUT=/dev/stdin \ + OUTPUT=~{outputPath} \ + SORT_ORDER=coordinate \ + CREATE_INDEX=true + } + + output { + File outputBam = outputPath + File outputBamIndex = sub(outputPath, "\.bam$", ".bai") + } + + runtime { + cpu: 1 + memory: "~{memoryGb}G" + time_minutes: timeMinutes + docker: dockerImage + } + + parameter_meta { + inputBam: {description: "The unsorted input BAM file", category: "required"} + outputPath: {description: "The location the output BAM file should be written to.", category: "required"} + memoryGb: {description: "The amount of memory this job will use.", category: "advanced"} + XmxGb: {description: "The maximum memory available to picard SortSam. Should be lower than `memory` to accommodate JVM overhead and BWA mem's memory usage.", + category: "advanced"} + timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"} + dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.", + category: "advanced"} + } +} + task SortVcf { input { Array[File]+ vcfFiles -- GitLab