From 68061dfd78deb22abcc308450c9b3decfba81dec Mon Sep 17 00:00:00 2001
From: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
Date: Wed, 3 Jul 2019 12:51:02 +0200
Subject: [PATCH] fix

---
 samtools.wdl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/samtools.wdl b/samtools.wdl
index 0c3b589..da7d570 100644
--- a/samtools.wdl
+++ b/samtools.wdl
@@ -31,10 +31,12 @@ task BgzipAndIndex {
 task Index {
     input {
         File bamFile
-        String? outputBamPath
+        String outputBamPath = basename(bamFile)
         String dockerImage = "quay.io/biocontainers/samtools:1.8--h46bd0b3_5"
     }
-    String bamIndexPath = sub(select_first([outputBamPath, basename(bamFile)]), "\.bam$", ".bai")
+
+    # Select_first is needed, otherwise womtool validate fails.
+    String bamIndexPath = sub(select_first([outputBamPath]), "\.bam$", ".bai")
 
     command {
         bash -c '
-- 
GitLab