diff --git a/workflow/rules/common.smk b/workflow/rules/common.smk index ac92e65..03f6c3e 100644 --- a/workflow/rules/common.smk +++ b/workflow/rules/common.smk @@ -9,6 +9,10 @@ IMAGE = f"{WORK}/image.zarr" IMAGE_OK = f"{IMAGE}/zarr.json" TILES = f"{WORK}/tiles.json" STAGE = f"{WORK}/stage.zarr" +# Completion sentinel for the stage store. Tracking a touch()ed marker instead +# of directory(STAGE) keeps Snakemake from deleting/recreating the store on a +# re-run and avoids directory-mtime quirks (same touch() discipline as sopa). +STAGE_OK = f"{STAGE}.done" def occupied_done(wildcards): diff --git a/workflow/rules/segment.smk b/workflow/rules/segment.smk index 3d3328f..2111868 100644 --- a/workflow/rules/segment.smk +++ b/workflow/rules/segment.smk @@ -5,7 +5,7 @@ checkpoint prepare: IMAGE_OK, output: tiles=TILES, - stage=directory(STAGE), + stage=touch(STAGE_OK), script: "../scripts/prepare_tiles.py" @@ -14,7 +14,7 @@ rule segment: """Segment one tile on a GPU and write it into the stage store.""" input: tiles=TILES, - stage=STAGE, + stage=STAGE_OK, image=IMAGE_OK, output: f"{WORK}/seg/{{index}}.done",