patchworks 0.11.0__tar.gz → 0.11.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {patchworks-0.11.0 → patchworks-0.11.2}/PKG-INFO +1 -1
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/guide/snakemake.md +26 -2
- patchworks-0.11.2/workflow/.snakemake/metadata/L3RtcC9wd193Zi9vdXQvbGFiZWxzLmRvbmU= +1 -0
- patchworks-0.11.2/workflow/.snakemake/metadata/L3RtcC9wd193Zi9vdXQvc2VnLzAuZG9uZQ== +1 -0
- patchworks-0.11.2/workflow/.snakemake/metadata/L3RtcC9wd193Zi9vdXQvc2VnLzEuZG9uZQ== +1 -0
- patchworks-0.11.2/workflow/.snakemake/metadata/L3RtcC9wd193Zi9vdXQvc2VnLzIuZG9uZQ== +1 -0
- patchworks-0.11.2/workflow/.snakemake/metadata/L3RtcC9wd193Zi9vdXQvc2VnLzMuZG9uZQ== +1 -0
- patchworks-0.11.2/workflow/.snakemake/metadata/L3RtcC9wd193Zi9vdXQvc2VnLzQuZG9uZQ== +1 -0
- patchworks-0.11.2/workflow/.snakemake/metadata/L3RtcC9wd193Zi9vdXQvc2VnLzUuZG9uZQ== +1 -0
- patchworks-0.11.2/workflow/.snakemake/metadata/L3RtcC9wd193Zi9vdXQvc2VnLzYuZG9uZQ== +1 -0
- patchworks-0.11.2/workflow/.snakemake/metadata/L3RtcC9wd193Zi9vdXQvc2VnLzcuZG9uZQ== +1 -0
- patchworks-0.11.2/workflow/.snakemake/metadata/L3RtcC9wd193Zi9vdXQvc3RhZ2UuemFycg== +1 -0
- patchworks-0.11.2/workflow/.snakemake/metadata/L3RtcC9wd193Zi9vdXQvdGlsZXMuanNvbg== +1 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/workflow/README.md +9 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/workflow/config/config.yaml +2 -0
- patchworks-0.11.2/workflow/pixi.toml +24 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/workflow/rules/common.smk +5 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/workflow/rules/convert.smk +2 -1
- {patchworks-0.11.0 → patchworks-0.11.2}/workflow/rules/segment.smk +2 -2
- patchworks-0.11.2/workflow/scripts/convert.py +21 -0
- patchworks-0.11.0/workflow/.snakemake/metadata/L3RtcC90b3kvb3V0L2ltYWdlLnphcnI= +0 -1
- patchworks-0.11.0/workflow/.snakemake/metadata/L3RtcC90b3kvb3V0L2xhYmVscy5kb25l +0 -1
- patchworks-0.11.0/workflow/.snakemake/metadata/L3RtcC90b3kvb3V0L3N0YWdlLnphcnI= +0 -1
- patchworks-0.11.0/workflow/.snakemake/metadata/L3RtcC90b3kvb3V0L3NlZy80LmRvbmU= +0 -1
- patchworks-0.11.0/workflow/.snakemake/metadata/L3RtcC90b3kvb3V0L3NlZy8wLmRvbmU= +0 -1
- patchworks-0.11.0/workflow/.snakemake/metadata/L3RtcC90b3kvb3V0L3NlZy8xLmRvbmU= +0 -1
- patchworks-0.11.0/workflow/.snakemake/metadata/L3RtcC90b3kvb3V0L3NlZy8zLmRvbmU= +0 -1
- patchworks-0.11.0/workflow/.snakemake/metadata/L3RtcC90b3kvb3V0L3RpbGVzLmpzb24= +0 -1
- patchworks-0.11.0/workflow/scripts/convert.py +0 -15
- {patchworks-0.11.0 → patchworks-0.11.2}/.github/workflows/docs.yml +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/.github/workflows/lint.yml +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/.github/workflows/release.yml +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/.gitignore +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/.markdownlint-cli2.yaml +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/README.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/cliff.toml +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/api/chunks.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/api/cluster.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/api/io.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/api/merge_tile_labels.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/api/plugins/cellpose.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/api/plugins/napari.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/api/plugins/ome_zarr.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/api/relabel.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/api/tile_process.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/examples/cellpose_2d.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/examples/cellpose_2d.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/examples/cellpose_3d.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/examples/cellpose_3d.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/examples/custom.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/examples/custom_method.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/examples/standalone_merge.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/examples/stardist.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/examples/stardist_2d.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/getting_started.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/guide/gpu_distributed.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/guide/merging.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/guide/ome_zarr_napari.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/guide/performance.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/guide/pitfalls.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/guide/skip_empty.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/guide/tiling.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/docs/index.md +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/mkdocs.yml +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/pyproject.toml +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/src/patchworks/__init__.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/src/patchworks/_chunks.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/src/patchworks/_cluster.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/src/patchworks/_core.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/src/patchworks/_distributed.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/src/patchworks/_io.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/src/patchworks/_merge.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/src/patchworks/_relabel.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/src/patchworks/plugins/__init__.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/src/patchworks/plugins/cellpose.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/src/patchworks/plugins/napari.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/src/patchworks/plugins/ome_zarr.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/tests/test_core.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/tests/test_distributed.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/tests/test_napari.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/tests/test_ome_zarr.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/workflow/Snakefile +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/workflow/profile/slurm/config.yaml +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/workflow/rules/merge.smk +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/workflow/scripts/_pw.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/workflow/scripts/merge.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/workflow/scripts/prepare_tiles.py +0 -0
- {patchworks-0.11.0 → patchworks-0.11.2}/workflow/scripts/segment_tile.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: patchworks
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.2
|
|
4
4
|
Summary: Tiled processing of arbitrarily large images with globally consistent labels
|
|
5
5
|
Project-URL: Homepage, https://github.com/imcf/patchworks
|
|
6
6
|
Project-URL: Issues, https://github.com/imcf/patchworks/issues
|
|
@@ -34,8 +34,9 @@ pip install "patchworks[workflow,cellpose,imaris,bioio]"
|
|
|
34
34
|
- `cellpose` → the segmentation model
|
|
35
35
|
- `imaris` / `bioio` → read your input format (`.ims`, `.czi`, `.lif`, …)
|
|
36
36
|
|
|
37
|
-
On a cluster, do this inside a conda/venv that the compute nodes can
|
|
38
|
-
each rule activate a conda env
|
|
37
|
+
On a cluster, do this inside a conda/venv/pixi env that the compute nodes can
|
|
38
|
+
see, or let each rule activate a conda env. Prefer pixi? Skip this step — the
|
|
39
|
+
workflow ships a `pixi.toml`; see *pixi (instead of conda)*, below.
|
|
39
40
|
|
|
40
41
|
## 3. Configure the run
|
|
41
42
|
|
|
@@ -173,6 +174,29 @@ Snakemake is resumable — if jobs fail or you cancel, just relaunch the same
|
|
|
173
174
|
command and it picks up only the missing tiles. To force a clean rerun, delete
|
|
174
175
|
`work_dir` (or the relevant outputs).
|
|
175
176
|
|
|
177
|
+
The OME-ZARR conversion is **not redone** once `image.zarr` exists: the
|
|
178
|
+
`convert` rule's output is a marker file inside the store, so Snakemake skips it
|
|
179
|
+
on every later run. To force a fresh conversion, delete `image.zarr` or run
|
|
180
|
+
`snakemake --forcerun convert`.
|
|
181
|
+
|
|
182
|
+
## pixi (instead of conda)
|
|
183
|
+
|
|
184
|
+
Conda is **not** required — Snakemake runs in whatever environment launches it.
|
|
185
|
+
The workflow ships a `pixi.toml`, so the whole thing is:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
cd workflow
|
|
189
|
+
pixi install # builds the env (patchworks + snakemake + readers)
|
|
190
|
+
pixi run dry # dry-run
|
|
191
|
+
pixi run go # run locally (8 cores)
|
|
192
|
+
pixi run slurm # submit to SLURM (edit profile/slurm/config.yaml first)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
`pixi run …` activates the env, so the rule scripts execute in that env — do
|
|
196
|
+
**not** pass `--use-conda`. On a cluster, keep the `workflow/` directory on a
|
|
197
|
+
shared filesystem the compute nodes can read: the SLURM executor re-launches
|
|
198
|
+
Snakemake from this env's interpreter on each compute node.
|
|
199
|
+
|
|
176
200
|
## Conda (optional)
|
|
177
201
|
|
|
178
202
|
To have each rule run in a named conda env instead of the active one, add
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rule": "merge", "input": ["/tmp/pw_wf/out/seg/0.done", "/tmp/pw_wf/out/seg/1.done", "/tmp/pw_wf/out/seg/2.done", "/tmp/pw_wf/out/seg/3.done", "/tmp/pw_wf/out/seg/4.done", "/tmp/pw_wf/out/seg/5.done", "/tmp/pw_wf/out/seg/6.done", "/tmp/pw_wf/out/seg/7.done"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/merge.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 8289946198395, "starttime": 1782306826.05809, "endtime": 1782306826.057891, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/pw_wf/out/seg/0.done": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "/tmp/pw_wf/out/seg/1.done": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "/tmp/pw_wf/out/seg/2.done": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "/tmp/pw_wf/out/seg/3.done": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "/tmp/pw_wf/out/seg/4.done": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "/tmp/pw_wf/out/seg/5.done": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "/tmp/pw_wf/out/seg/6.done": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "/tmp/pw_wf/out/seg/7.done": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rule": "segment", "input": ["/tmp/pw_wf/out/image.zarr/zarr.json", "/tmp/pw_wf/out/stage.zarr", "/tmp/pw_wf/out/tiles.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/segment_tile.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 8289938895482, "starttime": 1782306823.2564273, "endtime": 1782306823.255227, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/pw_wf/out/tiles.json": "sha256:d5abe0a9301e6274b02cdae545a8b5e414d3b51c1396d18ae9bcb1ea935bfe67", "/tmp/pw_wf/out/image.zarr/zarr.json": "sha256:8baa9bb439818b6e4a5358464300e6239dae6fddb2b31fa26717a7c56eaf1458"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rule": "segment", "input": ["/tmp/pw_wf/out/image.zarr/zarr.json", "/tmp/pw_wf/out/stage.zarr", "/tmp/pw_wf/out/tiles.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/segment_tile.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 8289938895635, "starttime": 1782306823.2361996, "endtime": 1782306823.2352273, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/pw_wf/out/tiles.json": "sha256:d5abe0a9301e6274b02cdae545a8b5e414d3b51c1396d18ae9bcb1ea935bfe67", "/tmp/pw_wf/out/image.zarr/zarr.json": "sha256:8baa9bb439818b6e4a5358464300e6239dae6fddb2b31fa26717a7c56eaf1458"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rule": "segment", "input": ["/tmp/pw_wf/out/image.zarr/zarr.json", "/tmp/pw_wf/out/stage.zarr", "/tmp/pw_wf/out/tiles.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/segment_tile.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 8289938895788, "starttime": 1782306820.7251186, "endtime": 1782306820.724245, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/pw_wf/out/tiles.json": "sha256:d5abe0a9301e6274b02cdae545a8b5e414d3b51c1396d18ae9bcb1ea935bfe67", "/tmp/pw_wf/out/image.zarr/zarr.json": "sha256:8baa9bb439818b6e4a5358464300e6239dae6fddb2b31fa26717a7c56eaf1458"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rule": "segment", "input": ["/tmp/pw_wf/out/image.zarr/zarr.json", "/tmp/pw_wf/out/stage.zarr", "/tmp/pw_wf/out/tiles.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/segment_tile.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 8289938792521, "starttime": 1782306820.8450873, "endtime": 1782306820.8442442, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/pw_wf/out/tiles.json": "sha256:d5abe0a9301e6274b02cdae545a8b5e414d3b51c1396d18ae9bcb1ea935bfe67", "/tmp/pw_wf/out/image.zarr/zarr.json": "sha256:8baa9bb439818b6e4a5358464300e6239dae6fddb2b31fa26717a7c56eaf1458"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rule": "segment", "input": ["/tmp/pw_wf/out/image.zarr/zarr.json", "/tmp/pw_wf/out/stage.zarr", "/tmp/pw_wf/out/tiles.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/segment_tile.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 8289938792674, "starttime": 1782306820.7828398, "endtime": 1782306820.7822447, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/pw_wf/out/tiles.json": "sha256:d5abe0a9301e6274b02cdae545a8b5e414d3b51c1396d18ae9bcb1ea935bfe67", "/tmp/pw_wf/out/image.zarr/zarr.json": "sha256:8baa9bb439818b6e4a5358464300e6239dae6fddb2b31fa26717a7c56eaf1458"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rule": "segment", "input": ["/tmp/pw_wf/out/image.zarr/zarr.json", "/tmp/pw_wf/out/stage.zarr", "/tmp/pw_wf/out/tiles.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/segment_tile.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 8289938792827, "starttime": 1782306823.5588164, "endtime": 1782306823.558225, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/pw_wf/out/tiles.json": "sha256:d5abe0a9301e6274b02cdae545a8b5e414d3b51c1396d18ae9bcb1ea935bfe67", "/tmp/pw_wf/out/image.zarr/zarr.json": "sha256:8baa9bb439818b6e4a5358464300e6239dae6fddb2b31fa26717a7c56eaf1458"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rule": "segment", "input": ["/tmp/pw_wf/out/image.zarr/zarr.json", "/tmp/pw_wf/out/stage.zarr", "/tmp/pw_wf/out/tiles.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/segment_tile.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 8289938792980, "starttime": 1782306823.0890763, "endtime": 1782306823.0882282, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/pw_wf/out/tiles.json": "sha256:d5abe0a9301e6274b02cdae545a8b5e414d3b51c1396d18ae9bcb1ea935bfe67", "/tmp/pw_wf/out/image.zarr/zarr.json": "sha256:8baa9bb439818b6e4a5358464300e6239dae6fddb2b31fa26717a7c56eaf1458"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rule": "segment", "input": ["/tmp/pw_wf/out/image.zarr/zarr.json", "/tmp/pw_wf/out/stage.zarr", "/tmp/pw_wf/out/tiles.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/segment_tile.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 8289938793133, "starttime": 1782306821.0048127, "endtime": 1782306821.0042431, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/pw_wf/out/tiles.json": "sha256:d5abe0a9301e6274b02cdae545a8b5e414d3b51c1396d18ae9bcb1ea935bfe67", "/tmp/pw_wf/out/image.zarr/zarr.json": "sha256:8baa9bb439818b6e4a5358464300e6239dae6fddb2b31fa26717a7c56eaf1458"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rule": "prepare", "input": ["/tmp/pw_wf/out/image.zarr/zarr.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/prepare_tiles.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 8289946375343, "starttime": 1782306818.2703326, "endtime": 1782306818.2701185, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/pw_wf/out/image.zarr/zarr.json": "sha256:8baa9bb439818b6e4a5358464300e6239dae6fddb2b31fa26717a7c56eaf1458"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rule": "prepare", "input": ["/tmp/pw_wf/out/image.zarr/zarr.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/prepare_tiles.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 8289946375343, "starttime": 1782306818.2703326, "endtime": 1782306818.2692626, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/pw_wf/out/image.zarr/zarr.json": "sha256:8baa9bb439818b6e4a5358464300e6239dae6fddb2b31fa26717a7c56eaf1458"}}
|
|
@@ -38,6 +38,15 @@ pip install "patchworks[workflow,cellpose,imaris,bioio]"
|
|
|
38
38
|
# workflow → snakemake + the SLURM executor plugin
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
Prefer pixi? No conda needed — a `pixi.toml` is included:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pixi install
|
|
45
|
+
pixi run dry # dry-run
|
|
46
|
+
pixi run go # run locally
|
|
47
|
+
pixi run slurm # submit to SLURM
|
|
48
|
+
```
|
|
49
|
+
|
|
41
50
|
## Configure
|
|
42
51
|
|
|
43
52
|
Edit `config/config.yaml` (input, output dir, channel, tile shape, Cellpose
|
|
@@ -15,6 +15,8 @@ work_dir: "/path/to/results" # everything is written under here
|
|
|
15
15
|
reuse_pyramid: true # for .ims: copy its own pyramid (fast); else rebuild
|
|
16
16
|
convert_chunks: null # null → patchworks' bounded auto chunks; or [c,z,y,x]
|
|
17
17
|
shard: false # true → pack chunks into shards (zarr v3; fewer files)
|
|
18
|
+
# Re-running reuses an existing image.zarr automatically (skips conversion).
|
|
19
|
+
# To force a rebuild: delete image.zarr, or `snakemake --forcerun convert`.
|
|
18
20
|
|
|
19
21
|
# ---- tiling -----------------------------------------------------------------
|
|
20
22
|
channel: 0 # channel to segment
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# pixi environment for the patchworks Snakemake workflow.
|
|
2
|
+
# pixi install
|
|
3
|
+
# pixi run dry # dry-run (plan only)
|
|
4
|
+
# pixi run go # run locally
|
|
5
|
+
# pixi run slurm # submit to SLURM (edit profile/slurm/config.yaml first)
|
|
6
|
+
#
|
|
7
|
+
# On a cluster, put this project on a shared filesystem the compute nodes can
|
|
8
|
+
# read: the SLURM jobs re-launch snakemake from this env's interpreter.
|
|
9
|
+
|
|
10
|
+
[project]
|
|
11
|
+
name = "patchworks-workflow"
|
|
12
|
+
channels = ["conda-forge"]
|
|
13
|
+
platforms = ["linux-64"]
|
|
14
|
+
|
|
15
|
+
[dependencies]
|
|
16
|
+
python = "3.12.*"
|
|
17
|
+
|
|
18
|
+
[pypi-dependencies]
|
|
19
|
+
patchworks = { version = "*", extras = ["workflow", "cellpose", "imaris", "bioio"] }
|
|
20
|
+
|
|
21
|
+
[tasks]
|
|
22
|
+
dry = "snakemake -s Snakefile --configfile config/config.yaml -n -p"
|
|
23
|
+
go = "snakemake -s Snakefile --configfile config/config.yaml --cores 8"
|
|
24
|
+
slurm = "snakemake --workflow-profile profile/slurm --configfile config/config.yaml"
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
WORK = config["work_dir"]
|
|
4
4
|
IMAGE = f"{WORK}/image.zarr"
|
|
5
|
+
# A single file inside the store, used as the convert rule's output and as the
|
|
6
|
+
# dependency marker for downstream rules. Tracking a leaf file (not the
|
|
7
|
+
# directory) lets Snakemake skip conversion when the store already exists and
|
|
8
|
+
# avoids wiping the whole store on a re-run (same trick as imcf/sopa).
|
|
9
|
+
IMAGE_OK = f"{IMAGE}/zarr.json"
|
|
5
10
|
TILES = f"{WORK}/tiles.json"
|
|
6
11
|
STAGE = f"{WORK}/stage.zarr"
|
|
7
12
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
checkpoint prepare:
|
|
4
4
|
input:
|
|
5
|
-
|
|
5
|
+
IMAGE_OK,
|
|
6
6
|
output:
|
|
7
7
|
tiles=TILES,
|
|
8
8
|
stage=directory(STAGE),
|
|
@@ -15,7 +15,7 @@ rule segment:
|
|
|
15
15
|
input:
|
|
16
16
|
tiles=TILES,
|
|
17
17
|
stage=STAGE,
|
|
18
|
-
image=
|
|
18
|
+
image=IMAGE_OK,
|
|
19
19
|
output:
|
|
20
20
|
f"{WORK}/seg/{{index}}.done",
|
|
21
21
|
script:
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""Snakemake script: convert the input to a pyramidal OME-ZARR.
|
|
2
|
+
|
|
3
|
+
The rule's output is a marker file inside the store (``image.zarr/zarr.json``),
|
|
4
|
+
so Snakemake skips this step entirely when the store already exists — the
|
|
5
|
+
conversion is not redone. To force a fresh conversion, delete ``image.zarr``
|
|
6
|
+
(or run ``snakemake --forcerun convert``).
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from patchworks.plugins.ome_zarr import to_ome_zarr
|
|
10
|
+
|
|
11
|
+
cfg = snakemake.config # noqa: F821 (injected by Snakemake)
|
|
12
|
+
chunks = cfg.get("convert_chunks")
|
|
13
|
+
to_ome_zarr(
|
|
14
|
+
cfg["input"],
|
|
15
|
+
str(snakemake.output[0]).removesuffix("/zarr.json"), # noqa: F821
|
|
16
|
+
chunks=tuple(chunks) if chunks else None,
|
|
17
|
+
shard=bool(cfg.get("shard", False)),
|
|
18
|
+
reuse_pyramid=bool(cfg.get("reuse_pyramid", False)),
|
|
19
|
+
progress=False,
|
|
20
|
+
overwrite=True,
|
|
21
|
+
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"rule": "convert", "input": [], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/convert.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 7968324357465, "starttime": 1782285191.3091571, "endtime": 1782285191.3090107, "incomplete": false, "external_jobid": null, "input_checksums": {}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"rule": "merge", "input": ["/tmp/toy/out/seg/0.done", "/tmp/toy/out/seg/1.done", "/tmp/toy/out/seg/3.done", "/tmp/toy/out/seg/4.done"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/merge.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 7968324177309, "starttime": 1782285198.9120235, "endtime": 1782285198.9118745, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/toy/out/seg/0.done": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "/tmp/toy/out/seg/1.done": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "/tmp/toy/out/seg/3.done": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "/tmp/toy/out/seg/4.done": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"rule": "prepare", "input": ["/tmp/toy/out/image.zarr"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/prepare_tiles.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 7968324357329, "starttime": 1782285193.0925362, "endtime": 1782285193.0922585, "incomplete": false, "external_jobid": null, "input_checksums": {}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"rule": "segment", "input": ["/tmp/toy/out/image.zarr", "/tmp/toy/out/stage.zarr", "/tmp/toy/out/tiles.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/segment_tile.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 7968316803128, "starttime": 1782285194.9512916, "endtime": 1782285194.9498596, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/toy/out/tiles.json": "sha256:a7ba7de7a100b9eed2f69158d779580251e48da2c4bdb722e28c4d9a79abb411"}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"rule": "segment", "input": ["/tmp/toy/out/image.zarr", "/tmp/toy/out/stage.zarr", "/tmp/toy/out/tiles.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/segment_tile.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 7968316911209, "starttime": 1782285194.9791708, "endtime": 1782285194.9778593, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/toy/out/tiles.json": "sha256:a7ba7de7a100b9eed2f69158d779580251e48da2c4bdb722e28c4d9a79abb411"}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"rule": "segment", "input": ["/tmp/toy/out/image.zarr", "/tmp/toy/out/stage.zarr", "/tmp/toy/out/tiles.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/segment_tile.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 7968316911362, "starttime": 1782285196.8732357, "endtime": 1782285196.871846, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/toy/out/tiles.json": "sha256:a7ba7de7a100b9eed2f69158d779580251e48da2c4bdb722e28c4d9a79abb411"}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"rule": "segment", "input": ["/tmp/toy/out/image.zarr", "/tmp/toy/out/stage.zarr", "/tmp/toy/out/tiles.json"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/segment_tile.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 7968316911515, "starttime": 1782285196.9122667, "endtime": 1782285196.9108458, "incomplete": false, "external_jobid": null, "input_checksums": {"/tmp/toy/out/tiles.json": "sha256:a7ba7de7a100b9eed2f69158d779580251e48da2c4bdb722e28c4d9a79abb411"}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"rule": "prepare", "input": ["/tmp/toy/out/image.zarr"], "log": [], "shellcmd": null, "params": [], "code": " \"../scripts/prepare_tiles.py\"\n", "record_format_version": 6, "conda_env": null, "container_img_url": null, "software_stack_hash": "d41d8cd98f00b204e9800998ecf8427e", "job_hash": 7968324357329, "starttime": 1782285193.0925362, "endtime": 1782285193.0908728, "incomplete": false, "external_jobid": null, "input_checksums": {}}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"""Snakemake script: convert the input to a pyramidal OME-ZARR."""
|
|
2
|
-
|
|
3
|
-
from patchworks.plugins.ome_zarr import to_ome_zarr
|
|
4
|
-
|
|
5
|
-
cfg = snakemake.config # noqa: F821 (injected by Snakemake)
|
|
6
|
-
chunks = cfg.get("convert_chunks")
|
|
7
|
-
to_ome_zarr(
|
|
8
|
-
cfg["input"],
|
|
9
|
-
snakemake.output[0], # noqa: F821
|
|
10
|
-
chunks=tuple(chunks) if chunks else None,
|
|
11
|
-
shard=bool(cfg.get("shard", False)),
|
|
12
|
-
reuse_pyramid=bool(cfg.get("reuse_pyramid", False)),
|
|
13
|
-
progress=False,
|
|
14
|
-
overwrite=True,
|
|
15
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|