From 19ecc1e21b607cca224906854ad942a48d1685e5 Mon Sep 17 00:00:00 2001 From: Erik Montag <47230559+emontag47@users.noreply.github.com> Date: Tue, 14 Dec 2021 17:52:30 -0500 Subject: [PATCH 1/4] Attempted to fix issue 700 by for including metadata on line 503 --- workflow/snakemake_rules/main_workflow.smk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/snakemake_rules/main_workflow.smk b/workflow/snakemake_rules/main_workflow.smk index a9aeec6ef..3c3549bd4 100644 --- a/workflow/snakemake_rules/main_workflow.smk +++ b/workflow/snakemake_rules/main_workflow.smk @@ -500,7 +500,7 @@ rule combine_samples: augur filter \ --sequences {input.sequences} \ --sequence-index {input.sequence_index} \ - --metadata {input.metadata} \ + --metadata ({input.metadata}{references_metadata.tsv}) \ --exclude-all \ --include {input.include} \ --output-sequences {output.sequences} \ From 555fd094354782eaa99b15d8fd95623dcfdcd577 Mon Sep 17 00:00:00 2001 From: Erik Montag <47230559+emontag47@users.noreply.github.com> Date: Tue, 14 Dec 2021 17:57:37 -0500 Subject: [PATCH 2/4] Attempted to fix issue 463 by checking subsampling scheme against list of supported subsampling flags --- Snakefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Snakefile b/Snakefile index ae1e46156..51e69bcb6 100644 --- a/Snakefile +++ b/Snakefile @@ -39,6 +39,9 @@ shell.prefix("set -euo pipefail; export AUGUR_RECURSION_LIMIT=10000; ") # [5] https://github.com/snakemake/snakemake/blob/a7ac40c96d6e2af47102563d0478a2220e2a2ab7/snakemake/utils.py#L455-L476 user_subsampling = copy.deepcopy(config.get("subsampling", {})) +# List of currently supported subsampling flags +supported_subsampling = ["--group-by", "--sequences-per-group", "--subsample-max-sequences", "--probabilistic-sampling", "--no-probabilistic-sampling", "--priority", "--subsample-seed"] + configfile: "defaults/parameters.yaml" # Check config file for errors @@ -69,6 +72,16 @@ if len(overlapping_schemes) > 0: logger.warning("") time.sleep(5) +# Check for unsupported subsampling schemes in user and default +# configurations. Returns a helpful error message and exits. +for scheme_name, scheme in user_subsampling.items(): + if scheme_name not in supported_subsampling: + error_string = "The inputted subsampling rule {} is not supported at this time. Please use one of the following supported subsampling rules: ".format(user_subsampling) + for i in supported_subsampling: + error_string = error_string + i + ", " + logger.error(error_string) + sys.exit(1) + # Assign a default build if none are specified in the config. Users can define a # `default_build_name` in their builds config without assigning any other build # information. Otherwise, we use a generic name for the default build. From a50ad58f0868c2b7a65ba926511e559756e2fc57 Mon Sep 17 00:00:00 2001 From: Erik Montag <47230559+emontag47@users.noreply.github.com> Date: Tue, 14 Dec 2021 18:00:00 -0500 Subject: [PATCH 3/4] Attempted to fix issue 657 by adding new function that checks input file names for spaces and makes sure they're in the right directory --- workflow/snakemake_rules/common.smk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/workflow/snakemake_rules/common.smk b/workflow/snakemake_rules/common.smk index b0b75a79f..f4286d7f1 100644 --- a/workflow/snakemake_rules/common.smk +++ b/workflow/snakemake_rules/common.smk @@ -168,3 +168,11 @@ def _get_upload_inputs(wildcards): else: raise Exception("The upload rule requires an 'upload' parameter in the config.") +def _check_input_files(wildcards): + # function that checks the config["inputs"] and check local files to make sure input file exists + + for file in config["inputs"]: + if ' ' in file: + raise Exception("The inputted file {} has an invalid name as it contains spaces. Please remove them and try again.".format(file)) + if not os.path.exists(file): + raise Exception("The inputted file {} does not exist. Please input a valid file and try again.".format(file)) \ No newline at end of file From fb67fa7f228436da7e0d29a387efe3f0663949d9 Mon Sep 17 00:00:00 2001 From: Erik Montag <47230559+emontag47@users.noreply.github.com> Date: Tue, 14 Dec 2021 18:55:28 -0500 Subject: [PATCH 4/4] move issue fix to other branch --- Snakefile | 13 ------------- workflow/snakemake_rules/main_workflow.smk | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/Snakefile b/Snakefile index 51e69bcb6..ae1e46156 100644 --- a/Snakefile +++ b/Snakefile @@ -39,9 +39,6 @@ shell.prefix("set -euo pipefail; export AUGUR_RECURSION_LIMIT=10000; ") # [5] https://github.com/snakemake/snakemake/blob/a7ac40c96d6e2af47102563d0478a2220e2a2ab7/snakemake/utils.py#L455-L476 user_subsampling = copy.deepcopy(config.get("subsampling", {})) -# List of currently supported subsampling flags -supported_subsampling = ["--group-by", "--sequences-per-group", "--subsample-max-sequences", "--probabilistic-sampling", "--no-probabilistic-sampling", "--priority", "--subsample-seed"] - configfile: "defaults/parameters.yaml" # Check config file for errors @@ -72,16 +69,6 @@ if len(overlapping_schemes) > 0: logger.warning("") time.sleep(5) -# Check for unsupported subsampling schemes in user and default -# configurations. Returns a helpful error message and exits. -for scheme_name, scheme in user_subsampling.items(): - if scheme_name not in supported_subsampling: - error_string = "The inputted subsampling rule {} is not supported at this time. Please use one of the following supported subsampling rules: ".format(user_subsampling) - for i in supported_subsampling: - error_string = error_string + i + ", " - logger.error(error_string) - sys.exit(1) - # Assign a default build if none are specified in the config. Users can define a # `default_build_name` in their builds config without assigning any other build # information. Otherwise, we use a generic name for the default build. diff --git a/workflow/snakemake_rules/main_workflow.smk b/workflow/snakemake_rules/main_workflow.smk index 3c3549bd4..a9aeec6ef 100644 --- a/workflow/snakemake_rules/main_workflow.smk +++ b/workflow/snakemake_rules/main_workflow.smk @@ -500,7 +500,7 @@ rule combine_samples: augur filter \ --sequences {input.sequences} \ --sequence-index {input.sequence_index} \ - --metadata ({input.metadata}{references_metadata.tsv}) \ + --metadata {input.metadata} \ --exclude-all \ --include {input.include} \ --output-sequences {output.sequences} \