Skip to content

feat(benchmarks): synthetic dataset template catalog (TASK 050) - #37

Merged
nceglia merged 1 commit into
mainfrom
feat/task-050-template-catalog
May 8, 2026
Merged

feat(benchmarks): synthetic dataset template catalog (TASK 050)#37
nceglia merged 1 commit into
mainfrom
feat/task-050-template-catalog

Conversation

@nceglia

@nceglia nceglia commented May 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Restructures genevector.benchmarks.synthetic into a unified catalog of named pathology templates: pathology (migrated), paracrine, niche, gradient.
  • Bumps ground-truth schema to v2.0 with unified phenotypes / genes / pairs collections (typed pair kinds and gene roles).
  • Updates genevector.benchmarks.spatial.eval to consume the new schema.
  • Adds docs/synthetic_templates.md (+ 4 rendered example layouts under docs/_images/) and an RST stub wired into the Sphinx toctree.

Templates

Builder Phenotypes Coupling tested
build_paracrine_dataset Source / Target LIG/REC adjacency under spatial intermixing
build_niche_dataset Tumor / T_near / T_far Density-induced niche genes (sigmoid in tumor neighbor fraction)
build_gradient_dataset Tissue 1D axial monotone + peaked gene gradients
build_pathology Full grafiti FOV Composite (existing — migrated to v2.0)

list_templates() discovers all four; shared (adata, ground_truth) contract across the catalog.

Breaking change

ground_truth schema bumped v1.0 → v2.0. The auxiliary keys added_gene_names and t_subtypes are removed; both are reconstructible from gt[\"genes\"] and gt[\"phenotypes\"]. The TASK 029 spatial eval code is updated in this PR.

Test plan

  • pytest tests/test_benchmarks_synthetic_templates.py -v (11 new tests)
  • pytest tests/test_benchmarks_synthetic_overlay.py -v (10, all under v2.0)
  • pytest tests/test_benchmarks_synthetic_layout.py -v (3, untouched)
  • pytest tests/test_benchmarks_spatial_eval.py -v (5 pass, 2 pre-existing xfails)
  • Full local suite: 73 passed, 2 xfailed
  • CI green across Python 3.9 / 3.10 / 3.11 / 3.12
  • Manual review of rendered example figures (docs/_images/template_*.png)

Out of scope / minor deviations from spec

  • Schema dropped added_gene_names / t_subtypes (not in the v2.0 spec; reconstructible).
  • Sphinx project doesn't ship myst-parser, so docs are rendered from docs/source/synthetic_templates.rst (a brief stub that links to the canonical markdown). The markdown at docs/synthetic_templates.md remains the full reference per spec.

🤖 Generated with Claude Code

Restructures genevector.benchmarks.synthetic into a unified catalog of
named pathology templates. Adds three new builders (paracrine, niche,
gradient) alongside the existing build_pathology, all sharing a v2.0
ground-truth schema with `phenotypes`, `genes`, and typed `pairs`
collections.

The new templates are smaller and more focused than build_pathology —
each one cleanly exercises a specific spatial coupling mechanism:
paracrine for ligand-receptor adjacency, niche for density-induced
gene programs, gradient for 1D axial pathologies.

Public API: list_templates() for discovery; build_*_dataset() per
template; shared (adata, ground_truth) contract across all four.

Documents each template in docs/synthetic_templates.md with parameter
descriptions, biological intent, and rendered example layouts.

Breaking: ground_truth schema bumped from v1.0 to v2.0. TASK 029
spatial eval updated to consume new schema.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nceglia
nceglia merged commit 4bab9f1 into main May 8, 2026
4 checks passed
@nceglia
nceglia deleted the feat/task-050-template-catalog branch May 8, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant