From cb854d983ba960975ffbfe59508682ba042faa36 Mon Sep 17 00:00:00 2001
From: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
Date: Mon, 20 Aug 2018 14:26:28 +0200
Subject: [PATCH] add seqstat generate

---
 biopet/seqstat.wdl | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 biopet/seqstat.wdl

diff --git a/biopet/seqstat.wdl b/biopet/seqstat.wdl
new file mode 100644
index 0000000..2009975
--- /dev/null
+++ b/biopet/seqstat.wdl
@@ -0,0 +1,40 @@
+task Generate {
+    input {
+        String? preCommand
+        File? toolJar
+        File fastqR1
+        File fastqR2
+        String outputFile
+        String? sample
+        String? library
+        String? readgroup
+
+        Int memory = 4
+        Float memoryMultiplier = 2.0
+    }
+
+    String toolCommand = if defined(toolJar)
+        then "java -Xmx" + memory + "G -jar " + toolJar
+        else "biopet-seqstat -Xmx" + memory + "G"
+
+    command {
+        set -e -o pipefail
+        ~{preCommand}
+        mkdir -p $(dirname ~{outputFile})
+        ~{toolCommand} \
+        --fastqR1 ~{fastqR1} \
+        --fastqR2 ~{fastqR2} \
+        --output ~{outputFile} \
+        ~{"--sample " + sample} \
+        ~{"--library " + library } \
+        ~{"--readgroup " + readgroup }
+    }
+
+    output {
+        File json = outputFile
+    }
+
+    runtime {
+        memory: ceil(memory * memoryMultiplier)
+    }
+}
\ No newline at end of file
-- 
GitLab