spatial-analysis
Skill45 starsChanged 3 months agoMITView on GitHub
Perform complete spatial transcriptomics analysis workflow to understand tissue architecture. Use when user wants to analyze spatial data from Visium, Xenium, MERFISH, Slide-seq, or other platforms. Triggers: "analyze spatial data", "what's the tissue structure", "spatial transcriptomics analysis", "load and analyze", "identify spatial domains", "cluster spatial data".
2 other projects use a version of this.
Adopted by
Most recently taken up by
- TerraLabAI/geoai-skillstheir own version, first seen Nov 1, 2026
- MEKXH/golemtheir own version, first seen Oct 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- MEKXH/golem★ 203same name
- TerraLabAI/geoai-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- cell-compositionSkill
- cell-dynamicsSkill
- cell-interactionSkill
- differential-analysisSkill
- functional-analysisSkill
- publication-readySkill
- spatial-patternsSkill
- troubleshootSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 55
Do you have a reference dataset for cell type annotation?
- Very specific: line 70
Use preprocess_data tool with appropriate parameters.
- Very specific: line 94
Use find_markers to identify domain-specific genes.
- Very specific: line 95
Use visualize_data with plot_type="feature" to examine spatial patterns.
- Distinctive: line 99
When analyzing multiple samples:
- Very specific: line 121
Use visualize_data tool with appropriate plot_type.
- Distinctive: line 137
No histology: Rely purely on expression patterns
- Distinctive: line 150
After establishing spatial structure, users may want:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spatial Analysis
Overview
This skill guides complete spatial transcriptomics analysis from raw data to biological insights. The fundamental question: What is the spatial organization of this tissue?
Workflow Decision Tree
START: User provides spatial data
│
├─ Q: What platform?
│ ├─ Visium/Visium HD → spot-based, may have histology
│ ├─ Xenium/MERFISH/CosMx → single-cell resolution, imaging-based
│ ├─ Slide-seq → spot-based, no histology
│ └─ Unknown → check adata.uns for platform info
│
├─ Q: Single sample or multiple?
│ ├─ Single → proceed to standard workflow
│ └─ Multiple → include integration step (Harmony recommended)
│
└─ Execute workflow based on answersStandard Workflow
Step 1: Data Loading and Understanding
1. Load data using load_data tool
2. Examine dataset profile:
- n_cells, n_genes
- Available annotations (adata.obs columns)
- Spatial coordinates availability
- Tissue image availability
3. Understand the biological context from userKey questions to ask user:
- What tissue/organ is this?
- What is your biological question?
- Do you have a reference dataset for cell type annotation?
Step 2: Quality Control and Preprocessing
Platform-specific QC thresholds:
| Metric | Visium | Xenium/MERFISH | Slide-seq |
|--------|--------|----------------|-----------|
| min_genes | 200 | 50 | 100 |
| min_cells | 3 | 3 | 3 |
| max_mito% | 20% | 10% | 15% |
| HVG count | 2000-3000 | 500-1000 | 1500-2000 |Use preprocess_data tool with appropriate parameters.
Step 3: Spatial Domain Identification
Method Selection Guide:
| Scenario | Recommended Method | Reason |
| Visium with histology | SpaGCN | Uses image features |
| Visium without histology | STAGATE/Leiden | Graph-based |
| Single-cell resolution | GraphST | Handles high resolution |
| Quick exploration | Leiden/Louvain | Fast, interpretable |
| Need fine structure | Higher resolution (1.5-2.0) | More clusters |
| Need broad domains | Lower resolution (0.3-0.5) | Fewer clusters |
Use identify_spatial_domains tool.
Step 4: Validation and Refinement
Checklist:
- Do spatial domains match histological regions (if available)?
- Are marker genes for each domain biologically meaningful?
- Is the number of domains reasonable for the tissue?
Use find_markers to identify domain-specific genes.
Use visualize_data with plot_type="feature" to examine spatial patterns.
Step 5: Multi-Sample Integration (if applicable)
When analyzing multiple samples:
1. Load all samples individually
2. Use integrate_samples with method selection:
- harmony: Fast, good for batch correction (recommended default)
- scvi: Deep learning, better for complex batches
- bbknn: K-nearest neighbor based
- scanorama: Panoramic stitching approach
3. Re-run clustering on integrated data
4. Validate integration qualityStep 6: Visualization and Reporting
Essential visualizations:
- Spatial scatter colored by clusters/domains
- UMAP embedding for global structure
- Marker gene expression patterns
- Violin plots for key genes
Use visualize_data tool with appropriate plot_type.
Platform-Specific Guidance
Visium
- Resolution: ~55μm spots, ~1-10 cells per spot
- Typical workflow: Full analysis → deconvolution for cell composition
- Histology integration: Use SpaGCN or include image features
Xenium/MERFISH
- Resolution: Single-cell
- Typical workflow: Full analysis → direct cell type annotation
- Large datasets: May need subsampling or chunked processing
Slide-seq
- Resolution: ~10μm beads
- No histology: Rely purely on expression patterns
- Bead-specific QC important
Output Expectations
A complete spatial analysis should provide:
- Spatial domains with biological interpretation
- Marker genes for each domain
- Visualizations showing spatial organization
- Quality metrics confirming data validity
Downstream Analysis Pointers
After establishing spatial structure, users may want:
- Cell type composition → use
/cell-compositionskill - Cell-cell communication → use
/cell-interactionskill - Developmental trajectories → use
/cell-dynamicsskill - Publication figures → use
/publication-readyskill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

