From b5d6e71a72124dc53eb9344ad0d6a1857bdaea69 Mon Sep 17 00:00:00 2001
From: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
Date: Tue, 7 Jul 2020 12:47:13 +0200
Subject: [PATCH] Add outputBAMcompression to STAR

---
 CHANGELOG.md | 2 ++
 star.wdl     | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index edfffb5..e70b06a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,8 @@ that users understand how the changes affect the new version.
 
 version 4.0.0-develop
 ---------------------------
++ Alignment tasks (STAR, Hisat2, BWA) now produce BAM files at level 1 
+  compression.
 + Hisat2 task has added controls for samtools.
 + Alignment tasks no longer produce BAM indexes as these are not needed
   by the markduplicates step.
diff --git a/star.wdl b/star.wdl
index 4da67f7..3d0e2eb 100644
--- a/star.wdl
+++ b/star.wdl
@@ -103,6 +103,7 @@ task Star {
         String? twopassMode = "Basic"
         Array[String]? outSAMattrRGline
         String? outSAMunmapped = "Within KeepPairs"
+        Int outBAMcompression = 1
         Int? limitBAMsortRAM
 
         Int runThreadN = 4
@@ -129,6 +130,7 @@ task Star {
         --outFileNamePrefix ~{outFileNamePrefix} \
         --genomeDir ~{sub(indexFiles[0], basename(indexFiles[0]), "")} \
         --outSAMtype ~{outSAMtype} \
+        --outBAMcompression ~{outBAMcompression} \
         --readFilesCommand ~{readFilesCommand} \
         ~{"--outFilterScoreMin " + outFilterScoreMin} \
         ~{"--outFilterScoreMinOverLread " + outFilterScoreMinOverLread} \
@@ -172,6 +174,7 @@ task Star {
         limitBAMsortRAM: {description: "Equivalent to star's `--limitBAMsortRAM` option.", category: "advanced"}
         runThreadN: {description: "The number of threads to use.", category: "advanced"}
         memory: {description: "The amount of memory this job will use.", category: "advanced"}
+        outBAMcompression: {description: "The compression level of the output BAM.", 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"}
     }
-- 
GitLab