From c53cc122e2e78e425021e8a31ba804c971190987 Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Sun, 4 Jan 2026 19:58:39 +1000 Subject: [PATCH 1/2] fix: log path for gubbins rule --- Snakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Snakefile b/Snakefile index 6fd2ac9..b4baf70 100644 --- a/Snakefile +++ b/Snakefile @@ -189,7 +189,7 @@ rule gubbins: group: "gubbins" log: - "../../../logs/gubbins_{strain}.log" + "logs/gubbins_{strain}.log" params: prefix=config['gubbins']['prefix'], tree_builder=config['gubbins']['tree_builder'], From c93c2ff8d8208e4344f5bc1134e503aec8ab5f98 Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Sun, 4 Jan 2026 20:28:10 +1000 Subject: [PATCH 2/2] Refactor shell command in gubbins rule Refactor shell command in gubbins rule to improve readability and error handling. --- Snakefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Snakefile b/Snakefile index b4baf70..3192f40 100644 --- a/Snakefile +++ b/Snakefile @@ -200,13 +200,14 @@ rule gubbins: threads: 2 shell: - "pushd output/strains/{wildcards.strain}/ && \ + """ + (cd output/strains/{wildcards.strain}/ && \ run_gubbins.py map_variants.aln --prefix {params.prefix} \ --starting-tree besttree.nwk --tree-builder {params.tree_builder} \ --min-snps {params.min_snp} --min-window-size {params.min_window} \ --max-window-size {params.max_window} --iterations {params.iterations} \ - --threads {threads} > {log} \ - && popd" + --threads {threads}) > {log} 2>&1 + """ rule bactdating: input: