From dde60f45b67f248bdfa39d3c8f37b173b847da62 Mon Sep 17 00:00:00 2001
From: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
Date: Wed, 3 Jul 2019 09:05:47 +0200
Subject: [PATCH] improve indexing

---
 samtools.wdl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/samtools.wdl b/samtools.wdl
index b9e7d91..395c9ac 100644
--- a/samtools.wdl
+++ b/samtools.wdl
@@ -34,15 +34,16 @@ task Index {
         String dockerImage = "quay.io/biocontainers/samtools:1.8--h46bd0b3_5"
     }
     String bamPath = basename(bamFile)
+    String bamIndexPath = sub(bamPath, "\.bam$", ".bai")
 
     command {
         ln ~{bamFile} ~{bamPath}
-        samtools index ~{bamPath}
+        samtools index ~{bamPath} ~{bamIndexPath}
     }
 
     output {
         File indexedBam = bamPath
-        File index =  sub(bamPath, "\.bam$", ".bai")
+        File index =  bamIndexPath
     }
 
     runtime {
-- 
GitLab