diff --git a/hippunfold/config/snakebids.yml b/hippunfold/config/snakebids.yml index c6f38d55..8d266dc0 100644 --- a/hippunfold/config/snakebids.yml +++ b/hippunfold/config/snakebids.yml @@ -264,11 +264,6 @@ parse_args: nargs: '+' help: 'Run hipp (CA + subiculum) alone or include dentate (default: %(default)s)' - --workdir: - help: 'Folder for storing working files, if not specified, will make a temporary folder with tempfile.mkdtemp() (default: %(default)s)' - default: None - type: Path - --force_nnunet_model: help: 'Force nnunet model to use (expert option). (default: %(default)s)' default: False @@ -294,6 +289,14 @@ parse_args: action: "store_false" default: True + --workdir: + help: | + Folder for storing working files. If not specified, a temporary folder + will be made in your system's temp directory (e.g. /tmp). You can also + use environment variables when setting the workdir, e.g. --workdir '$SLURM_TMPDIR'. + default: null + type: str + --version: help: 'Print the version of HippUnfold' diff --git a/hippunfold/workflow/Snakefile b/hippunfold/workflow/Snakefile index 9071bda0..5cbfc74d 100644 --- a/hippunfold/workflow/Snakefile +++ b/hippunfold/workflow/Snakefile @@ -4,6 +4,7 @@ import snakebids from snakebids import bids, set_bids_spec from tempfile import mkdtemp + configfile: "config/snakebids.yml" @@ -94,13 +95,11 @@ wildcard_constraints: template="[a-zA-Z0-9]+", -#root = os.path.normpath(os.path.join(config["root"], "hippunfold")) -#work = os.path.normpath(os.path.join(config["root"], "work")) - -root = os.path.expandvars(config["root"]) if config["workdir"] == None: config["workdir"] = mkdtemp() work = os.path.expandvars(config["workdir"]) +root = os.path.expandvars(config["root"]) + include: "rules/common.smk" include: "rules/download.smk" diff --git a/hippunfold/workflow/rules/common.smk b/hippunfold/workflow/rules/common.smk index ae9a2aa4..5aed626c 100644 --- a/hippunfold/workflow/rules/common.smk +++ b/hippunfold/workflow/rules/common.smk @@ -376,7 +376,6 @@ if "corobl" in ref_spaces: "cp {input} {output}" - def get_download_dir(): if "HIPPUNFOLD_CACHE_DIR" in os.environ.keys(): download_dir = os.environ["HIPPUNFOLD_CACHE_DIR"] @@ -385,5 +384,3 @@ def get_download_dir(): dirs = AppDirs("hippunfold", "khanlab") download_dir = dirs.user_cache_dir return download_dir - -