bio-spatial-transcriptomics-spatial-data-io
Installation
SKILL.md
Version Compatibility
Reference examples tested with: spatialdata 0.2+, spatialdata-io 0.1.5+, squidpy 1.4+, scanpy 1.10+, anndata 0.10+
Before using code patterns, verify installed versions match. If versions differ:
- Python:
pip show <package>thenhelp(module.function)to check signatures
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Spatial Data I/O
"Load my spatial data" -> Parse a platform's output bundle into one coordinate frame holding the expression matrix, coordinates, images, and (for imaging) the molecule table and segmentation shapes.
- Imaging/in-situ (Xenium, MERSCOPE/MERFISH, CosMx, seqFISH):
spatialdata_io.{xenium, merscope, cosmx}-> SpatialData with a per-transcriptpointstable AND a derived per-celltablesmatrix. - Sequencing/capture (Visium, Visium HD, Slide-seq/Curio, Stereo-seq):
squidpy.read.visiumorspatialdata_io.{visium, visium_hd, curio, stereoseq}-> spot/bin matrix + coordinates; NO molecule table.
Governing Principle
The single most consequential I/O fact is that the two platform classes emit different primary objects, and one class emits two of them that are easy to confuse.