Compute spatial statistics for spatial transcriptomics data using Squidpy. Calculate Moran's I, Geary's C, spatial autocorrelation, co-occurrence analysis, and neighborhood enrichment.
SkillScore91Maintained
Automatic
◆Research pack
Last verified 8/2/2026
What it changes
Passed 20 of 22 test cases with the skill, and 17 of 22 without it.
Without skill77%
With skill91%
Checks it passed that the model alone missed
Retrieves output from adata.uns['gearyC']
Accesses results at adata.uns['leiden_ripley']
Calls sq.gr.nhood_enrichment rather than sq.gr.neighborhood_enrichment
and 1 more in the full report
3 fixed17 passed either way2 still failing0 broke
Pass-rate lift
+14 pp
Tokens
+59%
Agent turns
0%
Response time
-45%
Model gemini-3.6-flashMeasured 8/2/2026v120 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 3
Prompt
To evaluate point-pattern spatial clustering at single-cell resolution across clusters in `adata.obs['leiden']`, I want to compute Ripley's L-function in Squidpy. Which mode parameter is specified and where is the result saved?
What was checked, without and with the skill
Checked
Without skill
With skill
Passes mode='L' to sq.gr.ripley
Passed
Passed
Accesses results at adata.uns['leiden_ripley']
Missed
Passed
case-06 · gemini-3.6-flash · 8/2/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md214 linessingle file
Spatial Statistics
Compute spatial statistics and identify spatially variable features.
Required Imports
import squidpy as sq
import scanpy as sc
import pandas as pd
import numpy as np
Compute Spatial Autocorrelation (Moran's I)
# 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']