Xenium Branch — Cell-Level Loading & Validation
Goal
Load Xenium data as a cell-level matrix. Xenium is an imaging-based in situ platform that outputs cell barcodes with platform-provided segmentation — no re-segmentation and no deconvolution needed.
Prerequisites
- Xenium output, one of:
cell_feature_matrix.h5(standard Xenium output; cells × genes)- cell-level h5ad with
obsm['spatial'] transcripts.csv(transcript-level) + segmentation boundaries
- Python:
scanpy
Steps
-
Load cell matrix
sc.read_10x_h5(cell_feature_matrix.h5)— cells × genes, sparse.- Attach coordinates: Xenium outputs have
pxl_col_in_fullres/pxl_row_in_fullresorobsm['spatial'].
-
Validate platform segmentation
- Confirm cell boundaries exist (nucleus or cell segmentation from Xenium pipeline).
- Do NOT re-segment unless the user explicitly asks.
-
QC & sanity check
- Report: number of cells, median genes/cell, median counts/cell.
- Flag: very low counts (possible empty cells), very high counts (possible doublets), abnormal spatial distribution.
Outputs
results/01_loading/<sample>_cells.h5ad— cell-level AnnDataresults/01_loading/QC_plots.png— QC violin plots
Biological Interpretation
- Report total cells and QC stats.
- Note tissue type and expected cell composition.
- Flag any platform QC warnings.
Stop for Review
Present interpretation using the template from the parent spatial-transcriptomics skill. Wait for 通过 / 调整 / 跳过 before proceeding to shared downstream.
Notes
- Xenium segmentation comes with the platform — treat as ground truth unless the user asks otherwise.
- Deconvolution is NOT needed for Xenium — cells are already resolved.


