diff --git a/README.md b/README.md index 868ab91..6512679 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # 🧬 analysis_template A [cruft](https://cruft.github.io/cruft/) template for notebook-first single-cell and spatial analysis -repos, managed with [pixi](https://pixi.sh). Humans work in notebooks; coding agents follow the -[analysis-workflow](https://github.com/quadbio/analysis-workflow) plugin, which every generated repo enables. +repos, managed with [pixi](https://pixi.sh). Humans and coding agents share one task layout, set out in each +project's `CONVENTIONS.md`; agents also follow the [analysis-workflow](https://github.com/quadbio/analysis-workflow) +plugin, which every generated repo enables. > Building a reusable Python library? Use the [scverse cookiecutter](https://github.com/scverse/cookiecutter-scverse) instead. diff --git a/{{cookiecutter.project_name}}/.gitignore b/{{cookiecutter.project_name}}/.gitignore index 71da4a7..20e0d1e 100644 --- a/{{cookiecutter.project_name}}/.gitignore +++ b/{{cookiecutter.project_name}}/.gitignore @@ -159,9 +159,8 @@ data/** !data/**/.gitkeep # Directories to ignore. Unanchored, so they also match inside every analysis task directory -# (analysis///.../_vN/): the untracked half of a task, anchored to the main checkout. -**/figures/* -!/figures/.gitkeep +# (analysis///.../__vN/): the untracked half of a task, anchored to the main checkout. +figures/ outputs/ logs/ diff --git a/{{cookiecutter.project_name}}/AGENTS.md b/{{cookiecutter.project_name}}/AGENTS.md index 5ce31b0..9ac6838 100644 --- a/{{cookiecutter.project_name}}/AGENTS.md +++ b/{{cookiecutter.project_name}}/AGENTS.md @@ -5,10 +5,12 @@ anything documented there is referenced from here, never restated. ## Workflow -The human and agent lanes, task lifecycle, output paths, `data/` layout, working objects and their -write-back are owned by the [analysis-workflow](https://github.com/quadbio/analysis-workflow) -plugin, enabled in `.claude/settings.json`: load its skill before writing analysis code, outputs or -data. Pull requests are reviewed against [`REVIEW_GUIDE.md`](REVIEW_GUIDE.md). +Task directories, output paths, the `data/` layout and working objects follow +[`CONVENTIONS.md`](CONVENTIONS.md), for humans and agents alike. What only agents do (a worktree, a session and a +PR per task, sign-off on every write-back) comes from the +[analysis-workflow](https://github.com/quadbio/analysis-workflow) plugin, enabled in `.claude/settings.json`: load +its skill before writing analysis code, outputs or data. Pull requests are reviewed against +[`REVIEW_GUIDE.md`](REVIEW_GUIDE.md). ## This repo diff --git a/{{cookiecutter.project_name}}/CONVENTIONS.md b/{{cookiecutter.project_name}}/CONVENTIONS.md new file mode 100644 index 0000000..7baa736 --- /dev/null +++ b/{{cookiecutter.project_name}}/CONVENTIONS.md @@ -0,0 +1,101 @@ +# Conventions + +How analysis is organized in this repo. Humans and coding agents follow the same rules; agents add their own on top +(a worktree, a session and a PR per task, sign-off on every write-back), from the +[analysis-workflow](https://github.com/quadbio/analysis-workflow) plugin. + +> Everything here comes from the analysis template; change it there and pull it with `cruft update`. + +## Start a task + +```bash +pixi run analysis-workflow new analysis///human__v1 --author --notebook 01_ +``` + +This creates the task directory with its `README.md` and a starter notebook in `notebooks/`. Open the notebook, +fill in the README's question and inputs, and work. + +## Tasks + +All analysis lives in task directories, `analysis///__vN/`: + +- `` is there even when the repo has one dataset. Topics, such as `preprocessing/`, `annotation/` or + `spatial/`, can mostly be worked on in any order. +- `` is `human` or `agent`; the README's author line says who: initials, or the model. +- `vN` counts the answers to one question across both lanes: `human_markers_v1` may be followed by + `agent_markers_v2`. `analysis-workflow new` refuses any other version than the next. +- A task is edited freely until its first write-back to a shared object or until other tasks read its outputs (for + an agent's task: its merge). After that it is frozen, and a change is the next version, whose README names the + one it follows. + +| in a task | tracked | holds | +| --- | --- | --- | +| `README.md` | yes | the question, inputs, deliverables, write-back; kept current | +| `notebooks/` | yes | `NN_.ipynb`, numbered in run order; outputs committed, so keep them small | +| `scripts/` | yes | `NN_.py`, numbered in run order; `_common.py` holds the task's paths | +| `results/` | yes | small evidence tables; past ~1 MB they belong in `outputs/` | +| `reports/` | yes | a report | +| `figures/` | no | figures | +| `outputs/` | no | data artifacts | +| `logs/` | no | batch-job logs | + +Every output path comes from `task_paths`: `PATHS = task_paths()` in a notebook, `task_paths(__file__)` in a script; +`PATHS.ensure()` creates the directories. Dataset paths come from `FilePaths`: + +```python +from analysis_workflow import task_paths +from {{ cookiecutter.package_name }} import FilePaths + +PATHS = task_paths().ensure() +working = FilePaths.EXAMPLE_DATASET / "processed" / "working" / "pbmc3k_2026-01-27.zarr" +fig.savefig(PATHS.figures / "umap.pdf") +``` + +## Data + +| `data//` | holds | +| --- | --- | +| `raw/` | bytes as they arrived, never changed | +| `resources/` | curated inputs that are not data: gene lists, marker tables | +| `processed/` | objects other tasks load: working objects in `working/`, others in descriptively named subdirectories | + +A task writes into its own directory. An object other tasks will load goes to `processed/` (for an agent, after +sign-off), and the task README records its path. + +## Working objects + +A working object is an AnnData zarr store, `processed/working/_.zarr`, in which results from many +tasks accumulate. + +- Read only what you need: `ad.io.read_elem(zarr.open_group(path)["obs"])`, or `ad.experimental.read_lazy`. +- Write back only through `commit_adata`, naming the keys you add. It refuses a key that is already there, so + nobody's results get overwritten: + + ```python + from analysis_workflow import commit_adata + + commit_adata(adata, path, keys={"obs": ["leiden_fine"]}) # dry run: shows what it would write + commit_adata(adata, path, keys={"obs": ["leiden_fine"]}, yes=True) # writes + ``` + +- Never write an in-memory object over a working object: it erases what others added since you read it. Changing + or removing a key means a new dated copy. +- Give keys descriptive names, and list each in the task README's Write-back section. +- Labels: one categorical `obs` column, colours in `uns["_colors"]`. +- A result that would grow the object materially (`analyze_anndata_size`) becomes a standalone AnnData on the same + `obs_names`, never a bare `.npy`. + +## Git + +You work in the main checkout. A pull request is optional and encouraged for anything others build on: + +```bash +git switch -c +git add analysis/// && git commit -m "" +git push -u origin +gh pr create # its body starts from the PR template +``` + +It is reviewed against `REVIEW_GUIDE.md`. Switching +branches changes the main checkout that agents' sessions read, `pixi.toml` included: switch back to `main` when you +are done. diff --git a/{{cookiecutter.project_name}}/README.md b/{{cookiecutter.project_name}}/README.md index f3e62f9..3fbc56a 100644 --- a/{{cookiecutter.project_name}}/README.md +++ b/{{cookiecutter.project_name}}/README.md @@ -77,9 +77,17 @@ In Jupyter Lab, check that your kernel appears (look for `{{ cookiecutter.projec ## 📊 Start Your Analysis -- **Demo notebook**: Check out `analysis/ML-2026-01-27_demo_scRNA_workflow.ipynb` for a complete scRNA-seq workflow example using scanpy's PBMC 3k dataset. -- **New notebooks**: Copy `analysis/XX-2026-01-27_sample_notebook.ipynb` as a starting point. Follow the naming convention: `[INITIALS]-[YYYY]-[MM]-[DD]_description.ipynb`. -- **Add your data**: Create folders under `data/` and register paths in `src/{{ cookiecutter.package_name }}/_constants.py`. +Each piece of analysis gets its own task directory. Start one with a notebook in it: + +```bash +pixi run analysis-workflow new analysis///human__v1 --author --notebook 01_ +``` + +- **How it fits together**: [`CONVENTIONS.md`](CONVENTIONS.md): task directories, where outputs go, `data/`, and + writing to a shared working object. +- **Demo**: `analysis/example_dataset/demo/human_scrna_workflow_v1/` runs a complete scRNA-seq workflow on scanpy's + PBMC 3k dataset. +- **Add your data**: create `data//` and register its path in `src/{{ cookiecutter.package_name }}/_constants.py`. --- @@ -149,21 +157,6 @@ Or edit `pixi.toml` directly and run `pixi install`. -
-📓 Data and notebook conventions - -- **Notebook naming**: `[INITIALS]-[YYYY]-[MM]-[DD]_description.ipynb` -- **Data layout and the notebook lane**: the analysis-workflow skill's - [Data](https://github.com/quadbio/analysis-workflow/blob/main/skills/analysis-workflow/SKILL.md#data) and - [Two lanes](https://github.com/quadbio/analysis-workflow/blob/main/skills/analysis-workflow/SKILL.md#two-lanes) -- **Import paths** via the local package: - -```python -from {{ cookiecutter.package_name }} import FilePaths -``` - -
-
🔧 Pre-commit & code quality diff --git a/{{cookiecutter.project_name}}/REVIEW_GUIDE.md b/{{cookiecutter.project_name}}/REVIEW_GUIDE.md index c80850e..6e9f7a2 100644 --- a/{{cookiecutter.project_name}}/REVIEW_GUIDE.md +++ b/{{cookiecutter.project_name}}/REVIEW_GUIDE.md @@ -5,7 +5,8 @@ PR review playbook for **review agents running on GitHub**. Imperative voice. **Scope: review only.** Comment and suggest. Do not push commits or apply fixes. > Everything above "This repo" comes from the analysis template; change it there and pull it with `cruft update`. -> It tells reviewers, who cannot load the analysis-workflow plugin, what to check of its rules. +> It tells reviewers, who cannot load the analysis-workflow plugin, what to check of `CONVENTIONS.md` and the +> plugin's rules. A PR's task directory says its lane: `human_…` or `agent_…`. The code has usually already run. That is not a reason to lower the bar: requiring a rerun in better shape is a normal outcome. Say what to redo, not just what was wrong. @@ -27,27 +28,25 @@ A write to a working object goes through `commit_adata`, gated behind a dry run. - an in-memory AnnData written back over a working object (`write_zarr`/`write_h5ad` onto its path): it erases whatever other sessions added since it was read; -- a recomputed key committed under an existing name: `commit_adata` writes only keys not yet on disk, so it is a - no-op and the PR reports a result the object doesn't hold. Use a new key or a new dated copy; - a replaced SpatialData image, labels, points or shapes element, where a new element name would do. ### 2. Promotions, which leave no diff `data/` is gitignored, so an object written into `data//processed/` appears nowhere in the diff; the task README's `Write-back` section is the only trace. The right subdirectory is not guessable. Check that the README -*says* where it went, that the PR body flags it for sign-off and that it was agreed, while moving it is still cheap. +*says* where it went and, for an agent's PR, that the PR body flags it for sign-off and that it was agreed, while +moving it is still cheap. ### 3. The task contract -Agent work belongs in a task directory `analysis///.../_vN/`. Check that its README's content -is real: the actual input files, the deliverables agreed with the human, a short summary of each PR. An edit to an -earlier task's directory is a finding: analysis moves forward, and a new version names the one it follows. A task is -one branch merged through one or more PRs, so a directory whose earlier PRs (its README lists them) came from this -PR's branch is this task's own, not an earlier one. Writes to `data//results/` or the central `figures/` -are the human lane and are a finding. +Work belongs in a task directory `analysis///.../__vN/`. Check that its README's +content is real: the actual input files, the deliverables, a short summary of each PR. An edit to a frozen task's +directory (one written back from, or merged) is a finding: analysis moves forward, and a new version names the one +it follows. A task is one branch merged through one or more PRs, so a directory whose earlier PRs (its README lists +them) came from this PR's branch is this task's own, not an earlier one. Outputs written outside the task directory, +other than to a shared object, are a finding. -Every key committed to a shared object carries the task's version suffix **and** appears in that README: an -unrecorded key can't be traced back, an unsuffixed one collides with the next version. +Every key committed to a shared object appears in that README: an unrecorded key can't be traced back. ### 4. Scientific correctness @@ -80,9 +79,9 @@ living file that restates another instead of linking to it is a finding, because - Lock files, and anything under `data/`. - Committed notebook outputs: review changed cells' code, never the output blobs. - Absolute paths built from `main_checkout()`: task outputs are anchored there deliberately. -- A task directory's layout and its README's headings: a hook holds them to the plugin's task template. -- Worktree, temp-dir and cwd-relative `data/`/`figures/` path literals in `analysis/` code: a hook blocks them - before the file is written. +- In an `agent_` task: its layout and its README's headings, which a hook holds to the task template; and + worktree, temp-dir and cwd-relative `data/`/`figures/` path literals, which a hook blocks before the file is + written. A `human_` task has no such hook: report these there. ## Drift older than the diff diff --git a/{{cookiecutter.project_name}}/analysis/example_dataset/demo/human_scrna_workflow_v1/README.md b/{{cookiecutter.project_name}}/analysis/example_dataset/demo/human_scrna_workflow_v1/README.md new file mode 100644 index 0000000..01dac55 --- /dev/null +++ b/{{cookiecutter.project_name}}/analysis/example_dataset/demo/human_scrna_workflow_v1/README.md @@ -0,0 +1,57 @@ +# human_scrna_workflow_v1 + +**Date:** 2026-01-27 +**Author:** ML + + + +A demo of a complete scRNA-seq workflow on scanpy's PBMC 3k data, from QC to a working object, marking which +steps to run locally and which on a GPU cluster. + +## Deliverables + + + +| deliverable | where | +| --- | --- | +| UMAP overviews | `figures/` (gitignored) | +| a new working object | Write-back, below | + +## Inputs + + + +- scanpy's PBMC 3k dataset, downloaded to `data/example_dataset/raw/` +- CellTypist's `Immune_All_High.pkl` model + +## Write-back + + + +- `data/example_dataset/processed/working/pbmc3k_2026-01-27.zarr`, a new working object, holding: + - `obsm["X_scVI"]`, `obsm["X_umap"]`: scVI latent space and its UMAP + - `obs["leiden"]`: Leiden clusters at resolution 0.5 + - `obs["cell_type"]`: CellTypist labels, majority-voted + +## Running + + + +`notebooks/01_scrna_workflow.ipynb`, top to bottom; its scVI section is faster on a GPU. + +## Jobs + + + +None. + +## PRs and issues + + + +None. diff --git a/{{cookiecutter.project_name}}/analysis/ML-2026-01-27_demo_scRNA_workflow.ipynb b/{{cookiecutter.project_name}}/analysis/example_dataset/demo/human_scrna_workflow_v1/notebooks/01_scrna_workflow.ipynb similarity index 93% rename from {{cookiecutter.project_name}}/analysis/ML-2026-01-27_demo_scRNA_workflow.ipynb rename to {{cookiecutter.project_name}}/analysis/example_dataset/demo/human_scrna_workflow_v1/notebooks/01_scrna_workflow.ipynb index 59d10dc..b2cd190 100644 --- a/{{cookiecutter.project_name}}/analysis/ML-2026-01-27_demo_scRNA_workflow.ipynb +++ b/{{cookiecutter.project_name}}/analysis/example_dataset/demo/human_scrna_workflow_v1/notebooks/01_scrna_workflow.ipynb @@ -16,10 +16,7 @@ "\n", "**Legend:**\n", "- 💻 **Local** — Fast, good for development, code editing\n", - "- 🚀 **GPU/Euler** — Heavy compute, model fitting, GPU-accelerated\n", - "\n", - "**Changelog:**\n", - "- 2026-01-27: Initial demo notebook" + "- 🚀 **GPU/Euler** — Heavy compute, model fitting, GPU-accelerated" ] }, { @@ -30,16 +27,6 @@ "## Preliminaries" ] }, - { - "cell_type": "markdown", - "id": "2", - "metadata": {}, - "source": [ - "### Dependency notebooks\n", - "\n", - "This is a standalone demo — no dependencies on other notebooks." - ] - }, { "cell_type": "markdown", "id": "3", @@ -72,6 +59,7 @@ "\n", "import matplotlib.pyplot as plt\n", "import scanpy as sc\n", + "from analysis_workflow import task_paths\n", "\n", "# Local analysis package — edit these functions in src/{{ cookiecutter.package_name }}/\n", "from {{ cookiecutter.package_name }} import FilePaths, qc_violin\n", @@ -94,13 +82,15 @@ "metadata": {}, "outputs": [], "source": [ + "PATHS = task_paths().ensure() # this task's figures/, outputs/, results/, ...\n", + "\n", "sc.settings.verbosity = 2\n", "sc.settings.datasetdir = FilePaths.EXAMPLE_DATASET / \"raw\"\n", "sc.settings.set_figure_params(dpi=100, frameon=False)\n", - "sc.settings.figdir = FilePaths.FIGURES / \"example_dataset\"\n", + "sc.settings.figdir = PATHS.figures\n", "\n", - "print(f\"Project root: {FilePaths.ROOT}\")\n", - "print(f\"Data folder: {FilePaths.DATA}\")" + "print(f\"Data folder: {FilePaths.DATA}\")\n", + "print(f\"Task figures: {PATHS.figures}\")" ] }, { @@ -488,7 +478,7 @@ "source": [ "### 💾 Save Results — 💻 Local\n", "\n", - "Save processed data following the template's data organization." + "This notebook starts a new working object: a dated zarr store in `processed/working/` that other tasks load and add keys to with `commit_adata`. It is written without consolidated metadata, so those additions stay visible." ] }, { @@ -497,7 +487,13 @@ "id": "37", "metadata": {}, "outputs": [], - "source": "output_path = FilePaths.EXAMPLE_DATASET / \"processed\" / \"pbmc3k_processed.zarr\"\nadata.write_zarr(output_path)\nprint(f\"Saved to: {output_path}\")" + "source": [ + "output_path = FilePaths.EXAMPLE_DATASET / \"processed\" / \"working\" / \"pbmc3k_2026-01-27.zarr\"\n", + "if output_path.exists(): # other tasks may have added to it since: never write over it\n", + " raise FileExistsError(f\"{output_path} exists; write a new dated copy instead.\")\n", + "adata.write_zarr(output_path, consolidate_metadata=False)\n", + "print(f\"Saved to: {output_path}\")" + ] }, { "cell_type": "markdown", diff --git a/{{cookiecutter.project_name}}/data/example_dataset/README.md b/{{cookiecutter.project_name}}/data/example_dataset/README.md index 73a1fa8..e8ee26d 100644 --- a/{{cookiecutter.project_name}}/data/example_dataset/README.md +++ b/{{cookiecutter.project_name}}/data/example_dataset/README.md @@ -1,4 +1,3 @@ # Dataset structure -`raw/`, `resources/`, `processed/` and `results/`, as described under *Data and notebook -conventions* in the top-level `README.md`. +`raw/`, `resources/` and `processed/`, as described under *Data* in the top-level `CONVENTIONS.md`. diff --git a/{{cookiecutter.project_name}}/data/example_dataset/results/.gitkeep b/{{cookiecutter.project_name}}/data/example_dataset/results/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/{{cookiecutter.project_name}}/figures/.gitkeep b/{{cookiecutter.project_name}}/figures/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/{{cookiecutter.project_name}}/pixi.toml b/{{cookiecutter.project_name}}/pixi.toml index 5f4cfb2..c008bad 100644 --- a/{{cookiecutter.project_name}}/pixi.toml +++ b/{{cookiecutter.project_name}}/pixi.toml @@ -61,7 +61,7 @@ session-info2 = "*" # Local editable package for path helpers {{ cookiecutter.package_name | replace('_', '-') }} = { path = ".", editable = true } -# Task paths and additive write-back for agent-run tasks (README: "Working with coding agents") +# Task directories, task paths and additive write-back (CONVENTIONS.md) analysis-workflow = { git = "https://github.com/quadbio/analysis-workflow" } igraph = ">=1.0.0, <2" celltypist = ">=1.7.1, <2" diff --git a/{{cookiecutter.project_name}}/src/{{cookiecutter.package_name}}/_constants.py b/{{cookiecutter.project_name}}/src/{{cookiecutter.package_name}}/_constants.py index 1b9ff3b..bb24453 100644 --- a/{{cookiecutter.project_name}}/src/{{cookiecutter.package_name}}/_constants.py +++ b/{{cookiecutter.project_name}}/src/{{cookiecutter.package_name}}/_constants.py @@ -1,4 +1,4 @@ -"""Project-wide paths for notebooks and scripts.""" +"""Project-wide paths for notebooks and scripts; a task's own outputs come from ``analysis_workflow.task_paths``.""" from analysis_workflow import main_checkout @@ -12,6 +12,5 @@ class FilePaths: ROOT = main_checkout(__file__) DATA = ROOT / "data" - FIGURES = ROOT / "figures" EXAMPLE_DATASET = DATA / "example_dataset" diff --git a/{{cookiecutter.project_name}}/analysis/XX-2026-01-27_sample_notebook.ipynb b/{{cookiecutter.project_name}}/templates/notebook.ipynb similarity index 68% rename from {{cookiecutter.project_name}}/analysis/XX-2026-01-27_sample_notebook.ipynb rename to {{cookiecutter.project_name}}/templates/notebook.ipynb index 3de5c38..39b2d3c 100644 --- a/{{cookiecutter.project_name}}/analysis/XX-2026-01-27_sample_notebook.ipynb +++ b/{{cookiecutter.project_name}}/templates/notebook.ipynb @@ -4,36 +4,16 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Sample Analysis Notebook\n", + "# \n", "\n", - "This notebook demonstrates the template structure. Delete or modify as needed.\n", - "\n", - "**Changelog**\n", - "- 2026-01-27: Initial template notebook" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "hidePrompt": true - }, - "source": [ - "## Preliminaries" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Dependency notebooks" + "One line on what this notebook does. The task's question, inputs and write-back are in its `README.md`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Link to notebooks/scripts this analysis depends on, e.g.:\n", - "- `XX-2026-01-20_preprocessing.ipynb` — raw data → processed AnnData" + "## Preliminaries" ] }, { @@ -43,13 +23,6 @@ "### Library imports" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "`autoreload` to re-load packages. " - ] - }, { "cell_type": "code", "execution_count": null, @@ -60,22 +33,14 @@ "%autoreload 2" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The actual imports. " - ] - }, { "cell_type": "code", "execution_count": null, - "metadata": { - "hidePrompt": true - }, + "metadata": {}, "outputs": [], "source": [ "import scanpy as sc\n", + "from analysis_workflow import task_paths\n", "\n", "from {{ cookiecutter.package_name }} import FilePaths" ] @@ -91,7 +56,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Define constants, figure settings, etc." + "`PATHS` holds this task's output directories (`PATHS.figures`, `PATHS.outputs`, `PATHS.results`, ...); dataset paths come from `FilePaths`." ] }, { @@ -100,7 +65,10 @@ "metadata": {}, "outputs": [], "source": [ - "sc.settings.set_figure_params(dpi=100, frameon=False)" + "PATHS = task_paths().ensure()\n", + "\n", + "sc.settings.set_figure_params(dpi=100, frameon=False)\n", + "sc.settings.figdir = PATHS.figures" ] }, { @@ -114,7 +82,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Any utility functions you may need in this notebook go here. " + "Utility functions for this notebook go here." ] }, { @@ -124,19 +92,14 @@ "### Data loading" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": "Store data in `data//` (layout in the README) and access paths via `FilePaths`:" - }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "print(f\"Data directory: {FilePaths.DATA}\")\n", - "print(f\"Figures directory: {FilePaths.FIGURES}\")" + "print(f\"Data: {FilePaths.DATA}\")\n", + "print(f\"Outputs: {PATHS.outputs}\")" ] }, { @@ -150,7 +113,27 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Your analysis code goes here. Delete these placeholder cells." + "Your analysis code goes here." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Write-back" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Results for other tasks go into the working object, under keys you name; list them in the README. Run the dry run, check it, then pass `yes=True`:\n", + "\n", + "```python\n", + "from analysis_workflow import commit_adata\n", + "\n", + "commit_adata(adata, WORKING_OBJECT, keys={\"obs\": [\"\"]})\n", + "```" ] } ],