Skip to content
Snippets Groups Projects
Commit 7b7eb3da authored by Ruben Vorderman's avatar Ruben Vorderman
Browse files

Update sortsam task with extra variables

parent 95020710
No related branches found
No related tags found
No related merge requests found
......@@ -654,9 +654,15 @@ task SortSam {
input {
File inputBam
String outputPath
Int XmxGb = 4
Int memoryGb = 1 + XmxGb
Boolean sortByName = false
Boolean createIndex = true
Boolean createMd5File = false
Int maxRecordsInRam = 500000
Int compressionLevel = 1
# Default ram of 4 GB. Using 125001.0 to prevent an answer of
# 4.000000001 which gets rounded to 5.
Int XmxGb = ceil(maxRecordsInRam / 125001.0)
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)
......@@ -664,12 +670,17 @@ task SortSam {
}
command {
set -e
mkdir -p "$(dirname ~{outputPath})"
picard -Xmx~{XmxGb}G -XX:ParallelGCThreads=1 SortSam \
INPUT=~{inputBam} \
OUTPUT=~{outputPath} \
SORT_ORDER=coordinate \
CREATE_INDEX=true
MAX_RECORDS_IN_RAM=~{maxRecordsInRam} \
SORT_ORDER=~{true="queryname" false="coordinate" sortByName} \
CREATE_INDEX=~{true="true" false="false" createIndex} \
COMPRESSION_LEVEL=~{compressionLevel} \
CREATE_MD5_FILE=~{true="true" false="false" createMd5File}
}
output {
......@@ -679,7 +690,7 @@ task SortSam {
runtime {
cpu: 1
memory: "~{memoryGb}G"
memory: "~{1 + XmxGb}G"
time_minutes: timeMinutes
docker: dockerImage
}
......@@ -687,7 +698,6 @@ task SortSam {
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"}
......
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