From 5a4a0440ff1bd297aa8255aeb557a9a9bdab0c7c Mon Sep 17 00:00:00 2001
From: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
Date: Tue, 6 Mar 2018 11:14:03 +0100
Subject: [PATCH] solve poretools issue

---
 poretools.wdl | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/poretools.wdl b/poretools.wdl
index fcbaff7..95dce6c 100644
--- a/poretools.wdl
+++ b/poretools.wdl
@@ -1,5 +1,5 @@
 task fastq {
-    Array[String]+ files # Array[String]+ instead of Array[File]+ to allow for globs
+    Array[File]+ files # Files should exist! Also accepts multiple directories (unlike poretools).
     String outputFile
     String? preCommand
     String? type
@@ -16,16 +16,22 @@ task fastq {
     mkdir -p $(dirname ${outputFile})
     ${preCommand}
 
-    poretools fastq \
-    ${"--type " + type} \
-    ${"--start " + start } \
-    ${"--end " + end } \
-    ${"--min-length " + minLength } \
-    ${"--max-length " + maxLength } \
-    ${true="--high-quality" false="" highQuality} \
-    ${true="--normal-quality" false="" normalQuality} \
-    ${"--group " + group} \
-    ${sep=" " files} ${true="| gzip " false="" gzip}> ${outputFile}
+    (
+    # Allow for multiple directory input by looping over files
+    for file in ${sep=" " files}
+    do
+        poretools fastq \
+        ${"--type " + type} \
+        ${"--start " + start } \
+        ${"--end " + end } \
+        ${"--min-length " + minLength } \
+        ${"--max-length " + maxLength } \
+        ${true="--high-quality" false="" highQuality} \
+        ${true="--normal-quality" false="" normalQuality} \
+        ${"--group " + group} \
+        $file
+    done
+    ) ${true="| gzip " false="" gzip}> ${outputFile}
     }
 
     output {
-- 
GitLab