-
Notifications
You must be signed in to change notification settings - Fork 1
Fix workflow catalog table and revise documentation #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5d8cf06
56c91c7
cef5840
b8b286c
0d39576
4ac0071
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,10 +18,12 @@ SpaceBlocks/ | |||||
| │ └── schemas/*.yaml config + sample-sheet validation | ||||||
| ├── config/ config.yaml, README.md (config reference), sample sheets | ||||||
| ├── docs/ this documentation site (MkDocs) | ||||||
| ├── .test/ tiny synthetic decoupled dataset for CI | ||||||
| ├── demos/ full public-data runs (data fetched, not committed) | ||||||
| ├── .test/ tiny synthetic decoupled dataset for CI | ||||||
| ├── demos/ full public-data runs (data fetched, not committed) | ||||||
| ├── tools/ stand-alone helper scripts | ||||||
| └── profiles/default/ SLURM profile (retries, resources) | ||||||
| ├── profiles/ execution profiles (retries, resources) | ||||||
| │ ├── default/config.yaml local profile | ||||||
| │ └── slurm/config.yaml SLURM profile | ||||||
| ``` | ||||||
|
|
||||||
| ## The Blocks | ||||||
|
|
@@ -99,14 +101,14 @@ For what every file is and why it is useful, see [Outputs](outputs.md); the tree | |||||
| ## Key design decisions | ||||||
|
|
||||||
| - **HeadBlock/CoreBlock split.** A technology-specific set of rules (HeadBlock) produces a standardized unfiltered AnnData file (contract); the common CoreBlocks consume it for the analyses. Inclusion of new platform/s only requires the development of a new HeadBlock, and the CoreBlock does not need to be changed, unless it has to be expanded. | ||||||
| - **`validate_input` is a DAG gate.** The division in ensured by a validation rule, which can pass or give a hard/soft failure. | ||||||
| - **`validate_input` is a DAG gate.** The division is ensured by a validation rule, which can pass or produce a hard/soft failure. | ||||||
| - A `.json` is written if the contract structure is validated. | ||||||
| - A hard failure prevents the `.json` from being written, and thus the CoreBlock from running. | ||||||
| - Soft issues (missing region annotation, no mito genes, no image) are recorded, but do not necessarily prevent CoreBlocks from running (config file has a paramter for soft-passing). | ||||||
| - Soft issues (missing region annotation, no mito genes, no image) are recorded, but do not necessarily prevent CoreBlocks from running (the config file has a parameter for soft-passing). | ||||||
| - **Coherent naming.** Head rules carry a 3-letter technology code (`_vhd`, `_x5k`) so the organization is easy to follow and heads can coexist. | ||||||
| - **`qc_sweep` rule is diagnostic only** — it never filters, clusters, or writes an h5ad. | ||||||
| - **External annotation takes over.** When enabled, it becomes the primary annotation everywhere. The [Configuration](configuration.md) allows flexibility to retain all cells or remove externally unannotated ones. | ||||||
| - **Config-driven colours** — regions, sample metadata, and cell types, applied consistently across every plot, with a grey fallback for undefined levels. This allows precise and consitent color representations through the analyses. | ||||||
| - **Config-driven colours** — regions, sample metadata, and cell types are applied consistently across every plot, with a grey fallback for undefined levels. This allows precise and consistent colour representations throughout the analyses. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| - **Retries scale memory.** `mem_mb` grows with the attempt number, so an OOM-killed job is resubmitted with more RAM. | ||||||
|
|
||||||
| ## Extending SpaceBlocks | ||||||
|
|
@@ -117,7 +119,7 @@ The aim of SpaceBlocks is to allow for long-term maintainable and extensible Spa | |||||
|
|
||||||
| If you wished to run SpaceBlocks but your platform is not listed among the available SpaceBlocks HeadBlocks, there are two options available: | ||||||
| 1. Running SpaceBlocks in `mode: decoupled` (**easier, recommended**). | ||||||
| 2. Writting a new SpaceBlocks HeadBlock. | ||||||
| 2. Writing a new SpaceBlocks HeadBlock. | ||||||
|
|
||||||
| See [public data end-to-end example runs](demos.md) for demonstrations about how to run SpaceBlocks in decoupled mode. | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,17 +2,17 @@ | |||||
|
|
||||||
| SpaceBlocks lets you overlay manual **region annotations** (tumour, healthy, necrosis, …) onto your samples. You draw them once in [QuPath](https://qupath.github.io/), export them as GeoJSON, and the pipeline folds them into `obs["region_annotation"]`. | ||||||
|
|
||||||
| This is an **optional but recommended step** (without it every cell is `Unlabeled`) because it unlocks the region-aware analyses (neighbourhood, per-region co-occurrence, region-level pseudobulk). | ||||||
| This is an **optional but recommended step** because it unlocks the region-aware analyses (neighbourhood, per-region co-occurrence, region-level pseudobulk). Without it, every cell will be `Unlabeled`. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| Choosing QuPath means anatomopathologists and researchers without bioinformatics skills can annotate the histology directly, while the annotations stay easy to fold back into the AnnData objects. | ||||||
|
|
||||||
| [Napari](https://napari.org/) is a possible alternative for writting the GeoJSON files, but it is a Python application aimed at programmers. | ||||||
| [Napari](https://napari.org/) is a possible alternative for writing the GeoJSON files, but it is a Python application aimed at programmers. | ||||||
|
|
||||||
| ## 1. Get the image to annotate | ||||||
|
|
||||||
| | Mode | How to obtain the image | | ||||||
| | --- | --- | | ||||||
| | `visiumhd` / `xenium5k` (a Headblock runs) | `snakemake qupath_images` writes one image per sample under `Samples/{sample}/QuPath_image/` (a hires PNG for Visium HD, a morphology TIFF for Xenium 5K). | | ||||||
| | `visiumhd` / `xenium5k` (a Headblock runs) | `snakemake qupath_images` writes one image per sample under `Samples/{sample}/QuPath_image/` (a Hi-Res PNG for Visium HD, a morphology TIFF for Xenium 5K). | | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| | `decoupled` (no Headblock) | There is no `qupath_images` target — the image is instead **embedded in the contract h5ad** you provided (`uns["spatial"]`). Annotate the regions when you build the contract externally (see [Preparing inputs for decoupled mode](demos.md#preparing-inputs-for-decoupled-mode)). | | ||||||
|
|
||||||
| ## 2. Annotate in QuPath | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -11,7 +11,7 @@ Inputs/outputs are summarised; the `.smk` files and `config["resources"]` are th | |||||
|
|
||||||
| ## HeadBlocks | ||||||
|
|
||||||
| HeadBlocks are *optional* technology-specific modules, selected in `config["mode"]`. Each | ||||||
| HeadBlocks are *optional*, technology-specific modules selected in `config["mode"]`. Each | ||||||
| one produces the standardized **contract h5ad** the CoreBlocks start from; the rules within | ||||||
| a headBlock carry a 3-letter technology suffix (`_vhd`, `_x5k`, `_ate`, `_mer`) so the organization stays | ||||||
| easy to follow. | ||||||
|
|
@@ -20,7 +20,7 @@ The pipeline can also run in `mode: decoupled`, without any headBlock — the Co | |||||
| consume pre-existing contract h5ads directly. | ||||||
|
|
||||||
| !!! tip "Annotate your regions first" | ||||||
| Whichever headBlock you use, run the `qupath_images` target **first**: it produces the | ||||||
| Whichever HeadBlock you use, run the `qupath_images` target **first**: it produces the | ||||||
| per-sample annotation images, which you annotate in QuPath and export as GeoJSON *before* | ||||||
| launching the rest of the run. The contract builders (`prepare_input_*`) pick those | ||||||
| GeoJSONs up automatically (and fall back to `Unlabeled` regions if none are present). | ||||||
|
|
@@ -212,7 +212,7 @@ Using the shared expression ranges from the integrated exploration, produces per | |||||
|
|
||||||
| ## Resources & retries | ||||||
|
|
||||||
| No rule uses `localrule`, so nothing runs on the scheduler's head node. | ||||||
| No rule uses `localrule`, so nothing runs on the scheduler's head node as long as the selected profile has configured remote execution (e.g. see `profiles/slurm`) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| Every compute rule draws `mem_mb` / `runtime` / `threads` from `config["resources"]` (with a `default` fallback). | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.