From 1aa3aebd0ded58c1fec86a9d0a4c892f9b127ab6 Mon Sep 17 00:00:00 2001 From: sacundim Date: Sun, 10 Jul 2022 23:36:37 -0700 Subject: [PATCH] Allow the `files.exclude` parameter to specify not just a single file, but optionally a list of files, that will all be passed to `augur filter --exclude`. --- workflow/snakemake_rules/main_workflow.smk | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/workflow/snakemake_rules/main_workflow.smk b/workflow/snakemake_rules/main_workflow.smk index c3d19cea2..996e7d6c1 100644 --- a/workflow/snakemake_rules/main_workflow.smk +++ b/workflow/snakemake_rules/main_workflow.smk @@ -559,12 +559,16 @@ rule diagnostic: def _collect_exclusion_files(wildcards): # This rule creates a per-input exclude file for `rule filter`. This file contains one or both of the following: - # (1) a config-defined exclude file + # (1) a config-defined exclude file or list of such files # (2) a dynamically created file (`rule diagnostic`) which scans the alignment for potential errors # The second file is optional - it may be opted out via config → skip_diagnostics + exclude = config["files"]["exclude"] + if type(exclude) is not list: + exclude = [ exclude ] if config["filter"].get("skip_diagnostics", False): - return [ config["files"]["exclude"] ] - return [ config["files"]["exclude"], f"results/{wildcards.build_name}/excluded_by_diagnostics.txt" ] + return exclude + else: + return exclude + [f"results/{wildcards.build_name}/excluded_by_diagnostics.txt"] rule mask: message: