bio-spatial-transcriptomics-spatial-statistics
Compute spatial statistics for spatial transcriptomics data using Squidpy. Calculate Moran's I, Geary's C, spatial autocorrelation, co-occurrence analysis, and neighborhood enrichment. Use when computing spatial autocorrelation or co-occurrence statistics.
npx skills add majiayu000/claude-skill-registry --skill spatial-statistics-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 Statistics Compute spatial statistics and identify spatially variable features. ## Required Imports ```python import squidpy as sq import scanpy as sc import pandas as pd import numpy as np ``` ## Compute Spatial Autocorrelation (Moran's I) ```python # Requires spatial neighbors sq.gr.spatial_neighbors(adata, coord_type='generic', n_neighs=6) # Compute Moran's I for all genes (can be slow) sq.gr.spatial_autocorr(adata, mode='moran') # Or for specific genes sq.gr.spatial_autocorr(adata, mode='moran', genes=['GENE1', 'GENE2', 'GENE3']) # Results stored in adata.uns['moranI'] moran_results = adata.uns['moranI'] print(moran_results.head(20)) ``` ## Interpret Moran's I ```python # Moran's I ranges from -1 to 1 # I > 0: positive spatial autocorrelation (similar values cluster) # I = 0: random spatial distribution # I < 0: negative spatial autocorrelation (dissimilar values cluster) # Get significantly spatially variable genes svg = moran_results[moran_results['pval_norm'] < 0.05].sort_values('I', ascending=False) print(f'Found {len(svg)} spatially variable genes (p < 0.05)') print('\nTop 10 spatially variable genes:') print(svg.head(10)[['I', 'pval_norm']]) ``` ## Compute Geary
- Required Imports
- Compute Spatial Autocorrelation (Moran's I)
- Interpret Moran's I
- Compute Geary's C
- Co-occurrence Analysis
- Interpret Co-occurrence
- Neighborhood Enrichment
- Extract Enrichment Z-scores
- Ripley's Statistics
- Centrality Scores
- Interaction Matrix
- Custom Spatial Statistic
- Local Moran's I (LISA)
- Batch Spatial Statistics
What does the bio-spatial-transcriptomics-spatial-statistics skill do?
Compute spatial statistics for spatial transcriptomics data using Squidpy. Calculate Moran's I, Geary's C, spatial autocorrelation, co-occurrence analysis, and neighborhood enrichment. Use when computing spatial autocorrelation or co-occurrence statistics.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill spatial-statistics-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.
