Atera breast contour workflow#
This workflow shows how to go from the raw Atera Xenium export to a
HistoSeg-backed Xenium Explorer annotation export, then into
pyXenium.contour for contour import, Voronoi expansion, and shell-based gene
density profiling.
Notebook:
This page is the workflow summary. The canonical, same-level
pyXenium.contour tutorial is rendered from docs/tutorials/contour.ipynb.
Dataset#
The reference notebook is parameterized for:
Y:\long\10X_datasets\Xenium\Atera\WTA_Preview_FFPE_Breast_Cancer_outs
It expects the standard Xenium export plus these Atera-specific artifacts:
analysis/analysis/clustering/gene_expression_graphclust/clusters.csvWTA_Preview_FFPE_Breast_Cancer_cell_groups.csvcells.parquetcell_feature_matrix.h5transcripts.zarr.zip
What the notebook does#
Reads the Xenium metadata and documents the Atera directory layout.
Bridges numeric GraphClust IDs from
clusters.csvto readable labels and colors fromWTA_Preview_FFPE_Breast_Cancer_cell_groups.csv.Builds a 7-structure default panel:
11q13 Invasive Tumor CellsBasal-like Structured DCIS CellsMacrophagesPlasma CellsEndothelial CellsApocrine CellsLuminal-like Amorphous DCIS Cells
Calls
pyXenium.contour.generate_xenium_explorer_annotations(...), which delegates the actual multi-structure contour generation to HistoSeg.Writes tutorial artifacts under
pyxenium_tutorial_outputs/atera_contour_workflow/and copies the generated export toxenium_explorer_annotations.generated.geojson.Imports the generated GeoJSON into
XeniumSlidewithadd_contours_from_geojson(..., id_key="name", pixel_size_um=0.2125).Derives structure-level analysis contours from the Explorer polygons, expands them with
expand_contours(..., distance=50.0, mode="voronoi"), and prepares shell-density inputs.Runs
ring_densityandsmooth_density_by_distanceover the curated marker panel with cache-first helpers so the long-running transcript steps can be resumed.
Important defaults and caveats#
The legacy
xenium_explorer_annotations.geojsonis treated as a reference artifact and is not overwritten.The notebook writes
xenium_explorer_annotations.generated.geojsonbeside the legacy file.The HistoSeg API keeps
min_cells=500as its package default. The Atera notebook overrides this to250soApocrine Cellsare retained in the 7-group export.read_xenium(..., as_="slide", stream_transcripts=True)is demonstrated directly on the Ateratranscripts.zarr.zip, including the real-world case where streamed chunks do not exposecell_id.Shell profiling is intentionally run on dissolved structure-level analysis contours derived from the Explorer export. This keeps the notebook tractable while preserving the original Explorer polygons for round-tripping and review.
Outputs#
The workflow produces these primary artifacts:
pyxenium_tutorial_outputs/atera_contour_workflow/xenium_explorer_annotations.geojsonpyxenium_tutorial_outputs/atera_contour_workflow/xenium_explorer_annotations.csvpyxenium_tutorial_outputs/atera_contour_workflow/xenium_explorer_annotations_summary.csvpyxenium_tutorial_outputs/atera_contour_workflow/structure_contour_cell_counts.csvpyxenium_tutorial_outputs/atera_contour_workflow/structure_contour_metrics.jsonxenium_explorer_annotations.generated.geojsonCached ring/profile density tables and derived figures under
pyxenium_tutorial_outputs/atera_contour_workflow/density_cache/
Biology readout#
The notebook is organized around program-level shell profiles for:
macrophage markers:
C1QA,CD163,CSF1R,SIGLEC1,C3plasma markers:
IGHA1,IGHA2,JCHAIN,IGHMvascular markers:
CDH5,MMRN2,EPAS1,KDR,FLT1basal DCIS markers:
SOSTDC1,KLK5,ITGB6,DSC3,KRT23apocrine markers:
TAT,MYBPC1luminal amorphous markers:
HSPB8,CLIC6,PIP,ESR1,PGRinvasive or stromal-rim markers:
MMP11,COL11A1,POSTN,COL1A1,COL1A2
The intended summary tables answer three questions:
Which programs are concentrated inside their assigned structures?
Which programs peak in the outward 50 µm shell after Voronoi expansion?
Which sentinel genes show the clearest signed-distance gradients across the contour boundary?