bio-spatial-transcriptomics-spatial-neighbors

Builds spatial neighbor graphs for Visium and single-cell data using squidpy and scanpy.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/ya-way/cytoclaw-skills --skill bio-spatial-transcriptomics-spatial-neighbors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bio-spatial-transcriptomics-spatial-neighbors
Source: https://github.com/ya-way/cytoclaw-skills/tree/main/workspace/skills/bio-spatial-transcriptomics-spatial-neighbors
Command: npx skills add https://github.com/ya-way/cytoclaw-skills --skill bio-spatial-transcriptomics-spatial-neighbors

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build and analyze spatial neighbor graphs for spatial transcriptomics data, enabling cells/spots to be connected by spatial proximity for downstream analyses.

Core Features & Use Cases

  • KNN, Delaunay, and radius-based neighbor graphs computed from spatial coordinates, stored in AnnData as spatial_connectivities and spatial_distances.
  • Supports Visium and single-cell layouts with generic coord_type, grid, and custom radii for flexible tissue architectures.
  • Use Case: Construct a neighbor graph to study spatial autocorrelation, tissue domains, and neighborhood structure across spots.

Quick Start

Provide your AnnData object and desired neighbor method, and the agent will build and store the spatial neighbor graph for downstream analysis.

Frequently Asked Questions about bio-spatial-transcriptomics-spatial-neighbors

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a spatial neighbor graph for Visium data in scanpy?

Spatial neighbor graphs connect cells or spots by physical proximity, enabling downstream analyses of spatial autocorrelation, tissue domains, and neighborhood structure across spots in spatial transcriptomics data.

What is the difference between KNN, Delaunay, and radius-based spatial graphs?

You provide an AnnData object and specify a neighbor method such as coord_type, grid, or custom radii to compute spatial connectivity, which stores the output matrices in adata.obsp for immediate downstream spatial analyses.

Does this spatial neighbor graph construction work with single-cell spatial data?

Yes, building spatial neighbor graphs requires both squidpy and scanpy to be installed, as these dependencies handle the underlying spatial coordinate processing and AnnData object manipulation.

Why compute spatial neighbors before running spatial autocorrelation analysis?

Limitations of spatial neighbor graphs include dependency on accurate spatial coordinates and appropriate radius selection, as incorrect parameters can artificially disconnect spots or create irrelevant tissue neighborhood structures.