From 7e07b4badc7a18b5decf986f529931f1a22458b7 Mon Sep 17 00:00:00 2001 From: "Mitchell R. Vollger" Date: Thu, 13 Aug 2026 17:55:11 -0700 Subject: [PATCH] fix: exclude_from_shuffle when no excludes are configured Guard the empty-EXCLUDES case (non-hg38 references) and use gunzip -cf instead of less for portable plain/gzip handling. Co-Authored-By: Claude Fable 5 --- workflow/rules/coverages.smk | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/workflow/rules/coverages.smk b/workflow/rules/coverages.smk index 9a0aa1394..e7eb5ea89 100644 --- a/workflow/rules/coverages.smk +++ b/workflow/rules/coverages.smk @@ -126,13 +126,14 @@ rule exclude_from_shuffle: conda: DEFAULT_ENV params: - exclude=EXCLUDES, + exclude=lambda wc: " ".join(EXCLUDES) if EXCLUDES else "", shell: """ - - ( \ - bedtools genomecov -bga -i {input.filtered} -g {input.fai} | awk '$4 == 0'; \ - less {params.exclude} \ + ( + bedtools genomecov -bga -i {input.filtered} -g {input.fai} | awk '$4 == 0' + if [ -n "{params.exclude}" ]; then + gunzip -cf {params.exclude} + fi ) \ | cut -f 1-3 \ | bedtools sort \