name: spatial-transcriptomics-agent
description: Spatial analyst
keywords:
- spatial
- h5ad
- H&E
- clustering
- SVG
measurable_outcome: For each sample, deliver ≥1 spatial domain map + SVG list + narrative interpretation within 30 minutes.
license: MIT
metadata:
author: LiuLab
version: "1.0.0"
compatibility:
- system: Python 3.9+
allowed-tools:
- run_shell_command
- read_file
- web_fetch
Spatial Transcriptomics Agent
Run STAgent to align histology images with expression matrices, perform clustering/SVG detection, and generate literature-backed spatial reports.
When to Use
- Analysis of Visium/Xenium or similar ST datasets.
- Visual reasoning over spatial plots, H&E images, or cluster maps.
- Automatically generating Scanpy/Squidpy code for new ST workflows.
- Hypothesis generation about spatial gene expression patterns.
Core Capabilities
- Dynamic code generation: Create/execute Python scripts for QC, clustering, SVG detection.
- Visual reasoning: Interpret spatial plots to identify tissue domains and cell neighborhoods.
- Literature retrieval: Pull references that contextualize findings.
- Report generation: Deliver publication-style writeups with plots and SVG tables.
Workflow
- Env setup:
conda env create -f environment.yml && conda activate STAgent.
- Data prep: Supply
expression_path (.h5ad/Spaceranger) + image_path (H&E/IF) and metadata.
- Task selection: Choose tasks such as
cluster, find_svg, annotate_domains, or composite instructions; run python repo/src/main.py --data_path ... --task "...".
- Execute & interpret: Let STAgent generate scripts, run analyses, and interpret results with literature references.
- Package outputs: Save UMAP/spatial plots, SVG tables, QC details, and summary markdown.
Example Usage
User: "Analyze this breast cancer ST dataset, find immune infiltrates."
Agent: loads data, runs `sqidpy.gr.spatial_neighbors`, computes Leiden clusters, plots marker genes (CD3D, CD19), and summarizes which clusters map to tumor core vs. stromal/immune zones.
Guardrails
- Document coordinate systems and any scaling between imaging and expression coordinates.
- Avoid definitive cell-type labels without supporting markers.
- Capture QC parameters for reproducibility.
References
1---2name: stagent3description: <!--4---5<!--6# COPYRIGHT NOTICE7# This file is part of the "Universal Biomedical Skills" project.8# Copyright (c) 2026 MD BABU MIA, PhD <md.babu.mia@mssm.edu>9# All Rights Reserved.10#11# This code is proprietary and confidential.12# Unauthorized copying of this file, via any medium is strictly prohibited.13#14# Provenance: Authenticated by MD BABU MIA1516-->1718---19name: spatial-transcriptomics-agent20description: Spatial analyst21keywords:22 - spatial23 - h5ad24 - H&E25 - clustering26 - SVG27measurable_outcome: For each sample, deliver ≥1 spatial domain map + SVG list + narrative interpretation within 30 minutes.28license: MIT29metadata:30 author: LiuLab31 version: "1.0.0"32compatibility:33 - system: Python 3.9+34allowed-tools:35 - run_shell_command36 - read_file37 - web_fetch38---3940# Spatial Transcriptomics Agent4142Run STAgent to align histology images with expression matrices, perform clustering/SVG detection, and generate literature-backed spatial reports.4344## When to Use45- Analysis of Visium/Xenium or similar ST datasets.46- Visual reasoning over spatial plots, H&E images, or cluster maps.47- Automatically generating Scanpy/Squidpy code for new ST workflows.48- Hypothesis generation about spatial gene expression patterns.4950## Core Capabilities511. **Dynamic code generation:** Create/execute Python scripts for QC, clustering, SVG detection.522. **Visual reasoning:** Interpret spatial plots to identify tissue domains and cell neighborhoods.533. **Literature retrieval:** Pull references that contextualize findings.544. **Report generation:** Deliver publication-style writeups with plots and SVG tables.5556## Workflow571. **Env setup:** `conda env create -f environment.yml && conda activate STAgent`.582. **Data prep:** Supply `expression_path` (`.h5ad`/Spaceranger) + `image_path` (H&E/IF) and metadata.593. **Task selection:** Choose tasks such as `cluster`, `find_svg`, `annotate_domains`, or composite instructions; run `python repo/src/main.py --data_path ... --task "..."`.604. **Execute & interpret:** Let STAgent generate scripts, run analyses, and interpret results with literature references.615. **Package outputs:** Save UMAP/spatial plots, SVG tables, QC details, and summary markdown.6263## Example Usage64```text65User: "Analyze this breast cancer ST dataset, find immune infiltrates."66Agent: loads data, runs `sqidpy.gr.spatial_neighbors`, computes Leiden clusters, plots marker genes (CD3D, CD19), and summarizes which clusters map to tumor core vs. stromal/immune zones.67```6869## Guardrails70- Document coordinate systems and any scaling between imaging and expression coordinates.71- Avoid definitive cell-type labels without supporting markers.72- Capture QC parameters for reproducibility.7374## References75- Source repo: https://github.com/LiuLab-Bioelectronics-Harvard/STAgent76- See local `README.md` for detailed instructions.777879<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->