From 9a082726b10c00676607ff76346be674dbb15a7f Mon Sep 17 00:00:00 2001
From: DavyCats <davycats.dc@gmail.com>
Date: Mon, 29 Oct 2018 15:26:26 +0100
Subject: [PATCH] add GatherVcfs

---
 picard.wdl | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/picard.wdl b/picard.wdl
index 6a52ee4..4b70a0b 100644
--- a/picard.wdl
+++ b/picard.wdl
@@ -240,6 +240,40 @@ task GatherBamFiles {
     }
 }
 
+task GatherVcfs {
+    input {
+        String? preCommand
+        Array[File]+ inputVcfs
+        Array[File]+ inputVcfIndexes
+        String outputVcfPath
+        String? picardJar
+
+        Int memory = 4
+        Float memoryMultiplier = 3.0
+    }
+
+    String toolCommand = if defined(picardJar)
+        then "java -Xmx" + memory + "G -jar " + picardJar
+        else "picard -Xmx" + memory + "G"
+
+    command {
+        set -e -o pipefail
+        ~{preCommand}
+        ~{toolCommand} \
+        GatherVcfs \
+        INPUT=~{sep=' INPUT=' inputVcfs} \
+        OUTPUT=~{outputVcfPath}
+    }
+
+    output {
+        File outputVcf = outputVcfPath
+    }
+
+    runtime {
+        memory: ceil(memory * memoryMultiplier)
+    }
+}
+
 # Mark duplicate reads to avoid counting non-independent observations
 task MarkDuplicates {
     input {
-- 
GitLab