bio-spatial-transcriptomics-spatial-neighbors
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.
npx skills add majiayu000/claude-skill-registry --skill spatial-neighbors-gptomics-bioskills-2 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Spatial Neighbor Graphs Build spatial neighbor graphs for connectivity-based analyses. ## Required Imports ```python import squidpy as sq import scanpy as sc import numpy as np ``` ## Build K-Nearest Neighbors Graph ```python # Build spatial KNN graph sq.gr.spatial_neighbors(adata, n_neighs=6, coord_type='generic') # Check the graph print(f"Connectivities shape: {adata.obsp['spatial_connectivities'].shape}") print(f"Distances shape: {adata.obsp['spatial_distances'].shape}") ``` ## Build Delaunay Triangulation Graph ```python # Delaunay triangulation (natural neighbors) sq.gr.spatial_neighbors(adata, delaunay=True, coord_type='generic') ``` ## Radius-Based Neighbors ```python # Connect all spots within a radius sq.gr.spatial_neighbors(adata, radius=100, coord_type='generic') ``` ## For Visium Data (Grid Structure) ```python # For Visium hexagonal grid, use n_rings sq.gr.spatial_neighbors(adata, n_rings=1, coord_type='grid') # 6 immediate neighbors sq.gr.spatial_neighbors(adata, n_rings=2, coord_type='grid') # Extended neighborhood ``` ## Access Neighbor Information ```python # Get connectivities as sparse matrix conn = adata.obsp['spatial_connectivities'] print(f'Edges in graph: {
- Required Imports
- Build K-Nearest Neighbors Graph
- Build Delaunay Triangulation Graph
- Radius-Based Neighbors
- For Visium Data (Grid Structure)
- Access Neighbor Information
- Get Neighbors for a Specific Spot
- Build Expression-Based Neighbors
- Combine Spatial and Expression Neighbors
- Visualize Neighbor Graph
- Compute Graph Statistics
- Store Multiple Neighbor Graphs
- Related Skills
What does the bio-spatial-transcriptomics-spatial-neighbors skill do?
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.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill spatial-neighbors-gptomics-bioskills-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
