From 680563febf9dba81cff822f73ab599b351f3e7c6 Mon Sep 17 00:00:00 2001
From: Redmar van den Berg <RedmarvandenBerg@lumc.nl>
Date: Wed, 28 Oct 2020 10:33:36 +0100
Subject: [PATCH] Fix bug in whatshap task

---
 whatshap.wdl | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/whatshap.wdl b/whatshap.wdl
index 2ee90f5..9362459 100644
--- a/whatshap.wdl
+++ b/whatshap.wdl
@@ -45,6 +45,8 @@ task Phase {
     }
 
     command {
+        set -e
+
         whatshap phase \
         ~{vcf} \
         ~{phaseInput} \
@@ -56,7 +58,8 @@ task Phase {
         ~{if defined(sample) then ("--sample " +  '"' + sample + '"') else ""} \
         ~{if defined(chromosome) then ("--chromosome " +  '"' + chromosome + '"') else ""} \
         ~{if defined(threshold) then ("--threshold " +  '"' + threshold + '"') else ""} \
-        ~{if defined(ped) then ("--ped " +  '"' + ped + '"') else ""} \
+        ~{if defined(ped) then ("--ped " +  '"' + ped + '"') else ""}
+
         tabix -p vcf ~{outputVCF}
     }
 
@@ -159,13 +162,16 @@ task Haplotag {
     }
 
     command {
+        set -e
+
         whatshap haplotag \
           ~{vcf} \
           ~{alignments} \
           ~{if defined(outputFile) then ("--output " +  '"' + outputFile+ '"') else ""} \
           ~{if defined(reference) then ("--reference " +  '"' + reference + '"') else ""} \
           ~{if defined(regions) then ("--regions " +  '"' + regions + '"') else ""} \
-          ~{if defined(sample) then ("--sample " +  '"' + sample + '"') else ""} \
+          ~{if defined(sample) then ("--sample " +  '"' + sample + '"') else ""}
+
           python3 -c "import pysam; pysam.index('~{outputFile}')"
     }
 
-- 
GitLab