From ea5cf6bc869ffa7cd64c82f8ee868b9778769e71 Mon Sep 17 00:00:00 2001 From: mcmero Date: Tue, 26 Mar 2024 13:57:12 +1100 Subject: [PATCH] Ensure that only directories get picked up for sample names Fix bug where pipeline stalls if there are any loose files under project directory --- workflow/rules/archive.smk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/rules/archive.smk b/workflow/rules/archive.smk index a82a344..627018f 100644 --- a/workflow/rules/archive.smk +++ b/workflow/rules/archive.smk @@ -127,7 +127,7 @@ rule archive_complete: shell: """ transfer_path={params.data_dir}/{wildcards.project}/{params.transfer_dir} - samples=`ls {params.data_dir}/{wildcards.project}/ | grep -v _transfer` + samples=`find {params.data_dir}/{wildcards.project} -type d -maxdepth 1 -depth 1 -exec basename {{}} \; | grep -v _transfer` for sample in $samples; do count_file_regex=`echo -e ".*\/{wildcards.project}_${{sample}}_[pod5|bam|fast|reports].*_list\.txt"` count_files=`find $transfer_path -type f -regex $count_file_regex`