Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions workflow/snakemake_rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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))