Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#657 Validate input files from config file #821

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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))