From 5f9751a9ec2bd23de5109c8a3c1d812a1cd968ea Mon Sep 17 00:00:00 2001
From: Sander Bollen <a.h.b.bollen@lumc.nl>
Date: Thu, 15 Feb 2018 16:56:50 +0100
Subject: [PATCH] Chunks may have quirky names. Wrap in quotes to prevent shell
 oddities.

---
 Snakefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Snakefile b/Snakefile
index 6bd0b70..82566ee 100644
--- a/Snakefile
+++ b/Snakefile
@@ -261,13 +261,13 @@ rule gvcf_gather:
         ref=REFERENCE,
         gatk=GATK
     params:
-        gvcfs=" -V ".join(expand(out_path("{{sample}}/vcf/{{sample}}.{chunk}.part.vcf.gz"),
+        gvcfs="' -V '".join(expand(out_path("{{sample}}/vcf/{{sample}}.{chunk}.part.vcf.gz"),
                                  chunk=CHUNKS))
     output:
         gvcf=out_path("{sample}/vcf/{sample}.g.vcf.gz")
     conda: "envs/gatk.yml"
     shell: "java -Xmx4G -cp {input.gatk} org.broadinstitute.gatk.tools.CatVariants "\
-           "-R {input.ref} -V {params.gvcfs} -out {output.gvcf} "\
+           "-R {input.ref} -V '{params.gvcfs}' -out {output.gvcf} "\
            "-assumeSorted"
 
 
@@ -295,13 +295,13 @@ rule genotype_gather:
         ref=REFERENCE,
         gatk=GATK
     params:
-        vcfs=" -V ".join(expand(out_path("multisample/genotype.{chunk}.part.vcf.gz"),
+        vcfs="' -V '".join(expand(out_path("multisample/genotype.{chunk}.part.vcf.gz"),
                                 chunk=CHUNKS))
     output:
         combined=out_path("multisample/genotyped.vcf.gz")
     conda: "envs/gatk.yml"
     shell: "java -Xmx4G -cp {input.gatk} org.broadinstitute.gatk.tools.CatVariants "\
-           "-R {input.ref} -V {params.vcfs} -out {output.combined} "\
+           "-R {input.ref} -V '{params.vcfs}' -out {output.combined} "\
            "-assumeSorted"
 
 
-- 
GitLab