bio-spatial-transcriptomics-spatial-visualization
Installation
SKILL.md
Version Compatibility
Reference examples tested with: squidpy 1.4+, scanpy 1.10+, anndata 0.10+, matplotlib 3.8+
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 Visualization
"Plot expression / clusters / a score on my tissue section" -> Render per-feature values at their real spatial coordinates, optionally over the histology image, without inventing structure the assay did not measure.
- Spot/capture fork (Visium, Visium HD, Slide-seq):
scanpy.pl.spatialorsquidpy.pl.spatial_scatterWITH the dataset'sscalefactorsand aspot_size/sizeset to the real capture diameter. - Imaging/FOV fork (Xenium, MERFISH/MERSCOPE, CosMx):
squidpy.pl.spatial_scatterwithshape=Nonefor the cell/molecule point cloud, or polygon shapes for segmentation overlays, or a platform viewer (Xenium Explorer, napari, Vitessce, TissUUmaps).
Governing Principle
Plotting differs by the platform-class fork, and rendering choices can manufacture pattern that is not in the data.