Skip to content

Commit 75d83b4

Browse files
author
Laurent Guerard
committed
docs(workflow): πŸ“ update relation output docs for the xlsx change
.csv -> .xlsx in config/multi.yaml's example outputs, and document the two-sheet layout (per-a-object incl. unmatched, per-b-object incl. zero-match) in guide/snakemake.md.
1 parent 1b492e3 commit 75d83b4

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

β€Ždocs/guide/snakemake.mdβ€Ž

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ segmentations:
303303
relations:
304304
- a: nuclei_labels
305305
b: cyto_labels
306-
output: nuclei_to_cyto.csv # written into work_dir
306+
output: nuclei_to_cyto.xlsx # written into work_dir
307307
```
308308

309309
```bash
@@ -317,6 +317,19 @@ Every listed segmentation config must share the same `work_dir` (so
317317
script checks this and errors out otherwise. `relations` is optional; omit it
318318
to just chain segmentations without a relation step.
319319

320+
Each `output:` is an Excel workbook (`openpyxl`, part of the `workflow`
321+
extra) with two sheets:
322+
323+
| Sheet | One row per | Columns |
324+
| --- | --- | --- |
325+
| `<a>` | every non-background `a` label, **including unmatched ones** | `<a>_id`, `<b>_id` (blank if unmatched), `overlap_voxels`, `overlap_fraction` (0 if unmatched) |
326+
| `<b>` | every non-background `b` label, **including ones with zero matches** | `<b>_id`, `<a>_count`, `total_overlap_voxels` |
327+
328+
Unlike calling `label_relations()` directly (which only returns matched `a`
329+
labels β€” see below), the workbook always covers every object in both
330+
segmentations, so counts (e.g. "how many nuclei have no matching cell",
331+
"how many cells have zero cilia") aren't silently dropped.
332+
320333
Both lists are ordinary lists, so 3+ segmentations work the same way β€” add
321334
more entries to `segmentations`, then list whichever pairs to relate. There's
322335
no automatic "chain": list every pair explicitly, e.g. for nuclei + cyto +

β€Žworkflow/config/multi.yamlβ€Ž

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Drives `pixi run multi` / `scripts/run_multi.py`: runs several segmentation
22
# configs (in order) against the same work_dir, then relates their labels by
3-
# voxel overlap (patchworks.label_relations) and writes a CSV per pair.
3+
# voxel overlap (patchworks.label_relations) and writes an Excel workbook per
4+
# pair (two sheets: one row per a-object incl. unmatched ones, one row per
5+
# b-object incl. ones with zero matches β€” see docs/guide/snakemake.md).
46
#
57
# All listed segmentation configs must share the same work_dir/image.zarr and
68
# the same tile_shape/level, so the resulting label arrays are directly
@@ -19,10 +21,10 @@ segmentations:
1921
relations:
2022
- a: nuclei_labels
2123
b: cyto_labels
22-
output: nuclei_to_cyto.csv
24+
output: nuclei_to_cyto.xlsx
2325
- a: cilia_labels
2426
b: cyto_labels
25-
output: cilia_to_cell.csv
27+
output: cilia_to_cell.xlsx
2628
- a: cilia_labels
2729
b: nuclei_labels
28-
output: cilia_to_nucleus.csv
30+
output: cilia_to_nucleus.xlsx

0 commit comments

Comments
Β (0)