AnnData
AnnData is a Python package for handling annotated data matrices, storing experimental measurements (X) alongside observation metadata (obs)…
Maintainer FreedomIntelligence · Last updated April 1, 2026
Build spatial neighbor graphs for spatial transcriptomics data using Squidpy. Compute k-nearest neighbors, Delaunay triangulation, and radius-based connectivity for downstream spatial analyses. Use when building spatial neighborhood graphs.
Original source
https://github.com/FreedomIntelligence/OpenClaw-Medical-Skills/tree/main/skills/bio-spatial-transcriptomics-spatial-neighbors
Skill Snapshot
Source Doc
Goal: Construct a spatial KNN graph connecting each spot to its nearest spatial neighbors.
Approach: Use Squidpy's spatial_neighbors with k-nearest neighbors on coordinate distances.
## Check the graph
print(f"Connectivities shape: {adata.obsp['spatial_connectivities'].shape}")
print(f"Distances shape: {adata.obsp['spatial_distances'].shape}")
sq.gr.spatial_neighbors(adata, delaunay=True, coord_type='generic')
Related skills
AnnData is a Python package for handling annotated data matrices, storing experimental measurements (X) alongside observation metadata (obs)…
Arboreto is a computational library for inferring gene regulatory networks (GRNs) from gene expression data using paralleli.
Cell segmentation from multiplexed tissue images. Covers deep learning (Cellpose, Mesmer) and classical approaches for nuclear and whole-cel…
Extract, process, and deduplicate reads using Unique Molecular Identifiers (UMIs) with umi_tools. Use when library prep includes UMIs and ac…