Skip to content

Instantly share code, notes, and snippets.

View pvandyken's full-sized avatar

Peter Van Dyken pvandyken

View GitHub Profile
@pvandyken
pvandyken / tmpdir_envvar.smk
Last active July 22, 2022 17:49
Use an environment variable as the default resources tmpdir in a snakemake workflow
# For a local instance, use --default_resources 'tmpdir="$MYENV_VAR"'
# Everything should work properly
# For a cluster scheduling instance, use --default_resources 'tmpdir="$$MYENV_VAR"'
# The double dollar sign is needed for escaping.
# Note that you won't be able to use this tmpdir on localrules (only a concern in cluster mode)
# The `tmpdir` variable becomes available for use throughout the workflow
def eval_environ(s):