一键导入
spatial-omics
Spatial transcriptomics and spatial proteomics analysis covering technology-specific workflows, spatial statistics, deconvolution, and niche analysis
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Spatial transcriptomics and spatial proteomics analysis covering technology-specific workflows, spatial statistics, deconvolution, and niche analysis
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Molecular structure analysis, SAR triage, compound library characterization, QSAR modeling, ADMET prediction, chemical space visualization, target engagement assessment, drug perturbation connectivity scoring, and selectivity profiling
Chromatin regulation analysis — ATAC-seq, ChIP-seq, CUT&Tag/CUT&Run, differential binding, motif analysis, and scATAC-seq
Systematic drug repurposing via signature matching, target-based analysis, network proximity, genetic evidence scoring, and clinical evidence mining
Functional enrichment and pathway analysis including GSEA, ORA, ssGSEA, GSVA, and decoupler-based activity inference
Genomic variant analysis — germline/somatic SNV, structural variants, CNV, GWAS, annotation, and filtering
Metabolomics and lipidomics analysis — untargeted/targeted workflows, normalization, annotation, and pathway mapping
| name | spatial-omics |
| description | Spatial transcriptomics and spatial proteomics analysis covering technology-specific workflows, spatial statistics, deconvolution, and niche analysis |
| version | 1.0.0 |
| tags | ["visium","merfish","slide-seq","codex","spatial","squidpy","spatialdata"] |
Method selection and execution guidance for spatial transcriptomics and spatial proteomics technologies.
Identify the spatial platform first — resolution and data structure dictate the analysis approach:
Technology?
├── Visium (10x Genomics)
│ ├── Resolution: ~55 um spots, each covering ~1-10 cells
│ ├── Data: spot x gene count matrix + tissue image + spot coordinates
│ ├── Coordinate type: grid (hexagonal array)
│ └── Load: sc.read_visium() or sd.read_10x_visium()
│
├── MERFISH / seqFISH / Xenium (single-molecule FISH)
│ ├── Resolution: subcellular, single-molecule
│ ├── Data: molecule coordinates → cell x gene matrix after segmentation
│ ├── Coordinate type: generic (continuous coordinates)
│ └── Load: sd.read_xenium() or custom from segmentation output
│
├── Slide-seq / HDST (bead-based capture)
│ ├── Resolution: ~10 um beads (near single-cell)
│ ├── Data: bead x gene count matrix + bead coordinates
│ ├── Coordinate type: generic
│ └── Load: custom AnnData with .obsm["spatial"]
│
└── CODEX / MIBI / IMC (spatial proteomics)
├── Resolution: single-cell (after segmentation)
├── Data: cell x protein intensity matrix + coordinates
├── Coordinate type: generic
└── Load: custom AnnData with .obsm["spatial"]
Building spatial graph (foundation for all spatial stats):
├── Visium → sq.gr.spatial_neighbors(adata, coord_type="grid")
│ Uses hexagonal grid adjacency, not distance
├── All other technologies → sq.gr.spatial_neighbors(adata, coord_type="generic")
│ ├── n_neighs=6 (default, good starting point)
│ └── Or radius-based: radius=float for distance threshold
└── Result stored in adata.obsp["spatial_connectivities"], adata.obsp["spatial_distances"]
Approach?
├── Graph-based clustering
│ ├── Standard → Leiden on spatial graph (sq.gr.spatial_neighbors → sc.tl.leiden)
│ └── Combined expression + spatial → compute joint graph (expression kNN + spatial kNN)
└── Visium-specific
└── BayesSpace (R via rpy2, Bayesian spatial clustering, respects tissue morphology)
Deconvolving multi-cell spots into cell type proportions:
├── cell2location (default, Bayesian, probabilistic)
│ ├── Requires a matched scRNA-seq reference — USER-SUPPLIED, none is
│ │ bundled or downloadable. No reference => report the blocker.
│ ├── Stage 1: Learn reference signatures (RegressionModel)
│ ├── Stage 2: Decompose spatial spots (Cell2location model)
│ └── Returns: adata.obsm with cell type abundance per spot
└── RCTD (R-based, robust non-negative least squares; spacexr via rpy2)
Also needs a user-supplied scRNA-seq reference.
Note: stereoscope is NOT available and cannot be installed. Do not
propose it. Every deconvolution route requires a user-supplied reference.
Testing for spatial expression patterns:
├── Global autocorrelation
│ ├── Moran's I → sq.gr.spatial_autocorr(adata, mode="moran")
│ │ Range: -1 (dispersed) to +1 (clustered), 0 = random
│ └── Geary's C → sq.gr.spatial_autocorr(adata, mode="geary")
│ Range: 0 (clustered) to >1 (dispersed), 1 = random
└── Local autocorrelation (per-spot patterns)
└── Local Moran's I / Getis-Ord G via libpysal (spatial weights) + esda
Build weights from the spot coordinates, not from a raster grid
Spatial niche characterization:
├── Neighborhood enrichment
│ └── sq.gr.nhood_enrichment(adata, cluster_key="leiden")
│ Tests whether cell type pairs co-occur more than expected
├── Co-occurrence analysis
│ └── sq.gr.co_occurrence(adata, cluster_key="leiden")
│ Distance-dependent co-occurrence probability
└── Ligand-receptor in spatial context
└── UNAVAILABLE — sq.gr.ligrec cannot run here (missing package + no
network for its interaction database). Report the blocker; do not
substitute another analysis silently. See references/squidpy-api.md.
For complex experiments with multiple tissue sections, coordinate transformations, or image analysis, use SpatialData as the container:
sd.SpatialData holds images, labels, shapes, points, and annotation tables.sd.get.spatial_element().adata.obsm["spatial"] coordinates preserved.coord_type="grid" for non-Visium data (or vice versa) produces incorrect spatial graphs. Visium uses hexagonal grid; everything else uses generic continuous coordinates.API references for all supported packages:
references/squidpy-api.md — Spatial statistics, neighbor graphs, niche analysis, LR testingreferences/spatialdata-api.md — Universal spatial data container with coordinate transformationsreferences/cell2location-api.md — Bayesian spatial deconvolution from scRNA-seq reference