agentleFS
cafferychen777cafferychen777/ChatSpatial/.agents/skills/spatial-analysis/SKILL.md

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

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. MEKXH/golem★ 203same name
    2. 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.

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
  1. Distinctive:

    Do you have a reference dataset for cell type annotation?

    line 55
  2. Very specific:

    Use preprocess_data tool with appropriate parameters.

    line 70
  3. Very specific:

    Use find_markers to identify domain-specific genes.

    line 94
  4. Very specific:

    Use visualize_data with plot_type="feature" to examine spatial patterns.

    line 95
  5. Distinctive:

    When analyzing multiple samples:

    line 99
  6. Very specific:

    Use visualize_data tool with appropriate plot_type.

    line 121
  7. Distinctive:

    No histology: Rely purely on expression patterns

    line 137
  8. Distinctive:

    After establishing spatial structure, users may want:

    line 150

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 answers

Standard 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 user

Key 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:

ScenarioRecommended MethodReason
Visium with histologySpaGCNUses image features
Visium without histologySTAGATE/LeidenGraph-based
Single-cell resolutionGraphSTHandles high resolution
Quick explorationLeiden/LouvainFast, interpretable
Need fine structureHigher resolution (1.5-2.0)More clusters
Need broad domainsLower 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 quality

Step 6: Visualization and Reporting

Essential visualizations:

  1. Spatial scatter colored by clusters/domains
  2. UMAP embedding for global structure
  3. Marker gene expression patterns
  4. 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:

  1. Spatial domains with biological interpretation
  2. Marker genes for each domain
  3. Visualizations showing spatial organization
  4. Quality metrics confirming data validity

Downstream Analysis Pointers

After establishing spatial structure, users may want:

  • Cell type composition → use /cell-composition skill
  • Cell-cell communication → use /cell-interaction skill
  • Developmental trajectories → use /cell-dynamics skill
  • Publication figures → use /publication-ready skill

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.