STAT: Spatial Transcriptomics Analytical agenT - AI-powered platform for spatial omics analysis
Project description
STAT
Spatial Transcriptomics Analytical agenT
An AI-powered platform for spatial omics analysis with multi-format support, interactive visualization, and intelligent code generation.
Features
- AI Agent: Natural language interface for spatial transcriptomics analysis — ask questions, get results
- Multi-format support: Single-slice, multi-slice, and multi-omics (gene + protein) datasets
- Interactive viewer: Canvas-based spatial visualization with zoom/pan, ROI drawing, and cell overlays
- Skill system: Extensible analysis skills (cell type annotation, deconvolution, spatial domains, etc.)
- Code execution: Agent generates and runs analysis code in a sandboxed environment
- Multi-provider LLM: Works with OpenAI, Anthropic, Google, Deepseek, and Poe
Installation
pip install stat-agent
With all analysis skill dependencies (squidpy, scvi-tools, torch, liana, etc.):
pip install "stat-agent[skills]"
Quick Start
Web Interface
stat-web
# Open http://localhost:8889
Or with the startup script (includes Jupyter Lab):
./start_web.sh
In the web UI:
- Enter path to your dataset directory
- Configure LLM (API key, model)
- Click "Load Dataset"
- Ask questions in the chat panel: "Annotate cell types", "Find spatially variable genes", "Show BRCA1 expression"
Data Format
STAT auto-detects your data layout. Place files in a single directory:
Single-slice:
dataset/
├── tissue.h5ad # Required: AnnData with x, y coordinates in obs
└── he.tif # Optional: H&E image (pixel coords = cell coords)
Multi-slice:
dataset/
├── tissue_slice_0.h5ad
├── he_slice_0.tif
├── tissue_slice_1.h5ad
└── he_slice_1.tif
Multi-omics:
dataset/
├── tissue.h5ad # Gene expression
├── tissue_protein.h5ad # Protein expression
├── he.tif
└── protein_CD3.tif
Key: Cell coordinates (x, y) in adata.obs map directly to image pixels (x, y). No coordinate transformation needed.
Built-in Skills
| Skill | Description |
|---|---|
| Cell Type Annotation (GPT) | Unsupervised clustering + LLM-based annotation |
| Cell Type Annotation (scANVI) | Transfer learning from scRNA-seq reference |
| Deconvolution (RCTD) | Spot-level cell type deconvolution |
| Spatial Domains (SpaGCN) | Graph-based spatial domain identification |
| SVG (SpatialDE) | Spatially variable gene detection |
| Neighborhood Enrichment | Cell type co-localization analysis |
| Cell Communication (LIANA+) | Ligand-receptor interaction analysis |
| Cell Communication (CellPhoneDB) | Permutation-based interaction testing |
| GO Enrichment | Gene Ontology pathway analysis |
| Niche Detection (Harmonics) | Spatial niche identification |
| Integration (Harmony) | Multi-slice batch correction |
| Alignment (STalign) | Spatial slice alignment |
Architecture
User Query → QueryPlanner → SkillFilter → LLM Matching → SkillVerifier → Code Generation → Execution
- QueryPlanner: Determines target slices, breaks complex queries into steps
- SkillFilter: Programmatic filtering by modality, data level, number of slices
- SkillVerifier: Checks prerequisites, requests missing information
- SpatialAgent: Generates analysis code using skill instructions + session context
- CodeExecutor: Sandboxed execution with state change detection
Project Structure
stat_agent/
├── core/ # Data layer
│ ├── session.py # Multi-slice/multi-omics session
│ ├── data_slice.py # Single data slice wrapper
│ └── roi_manager.py # ROI geometry management
├── agent/ # Agent pipeline
│ ├── spatial_agent_core.py
│ ├── conversation_orchestrator.py
│ ├── pipeline_executor.py
│ ├── query_planner.py
│ ├── skill_registry.py
│ ├── skill_filter.py
│ ├── skill_verifier.py
│ ├── llm_backend.py
│ └── memory.py
└── functions/
└── io.py # Data loading
.claude/skills/ # Skill definitions (SKILL.md + helper libs)
web_interface.py # Flask backend + API endpoints
static/ # Frontend (JS + CSS)
templates/ # HTML templates
License
BSD-3-Clause
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stat_agent-0.1.19.tar.gz.
File metadata
- Download URL: stat_agent-0.1.19.tar.gz
- Upload date:
- Size: 305.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5addf4ac00d01833ec21ab8fc17f418b93121719bad380f74540fb2789107f20
|
|
| MD5 |
61772b040f382f92d8c3d5bae62619d2
|
|
| BLAKE2b-256 |
a3254c12b37b2911e496da48cc4141a25844e13d97e65198c32efcf6806708bb
|
Provenance
The following attestation bundles were made for stat_agent-0.1.19.tar.gz:
Publisher:
publish.yml on chenyhvvvv/STAT-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stat_agent-0.1.19.tar.gz -
Subject digest:
5addf4ac00d01833ec21ab8fc17f418b93121719bad380f74540fb2789107f20 - Sigstore transparency entry: 1310034251
- Sigstore integration time:
-
Permalink:
chenyhvvvv/STAT-agent@bb1ef7c97c12bcc93384affd20c6f47ba92b16cd -
Branch / Tag:
refs/tags/v0.1.19 - Owner: https://github.com/chenyhvvvv
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bb1ef7c97c12bcc93384affd20c6f47ba92b16cd -
Trigger Event:
release
-
Statement type:
File details
Details for the file stat_agent-0.1.19-py3-none-any.whl.
File metadata
- Download URL: stat_agent-0.1.19-py3-none-any.whl
- Upload date:
- Size: 337.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cdc48b8830f900ab2b71da829158e5670ae0be3d33fbafebf662bcc6967d73e
|
|
| MD5 |
556650d388c0cbe8fd0ec801bc2ed875
|
|
| BLAKE2b-256 |
58bab64f575310d46f4c32712815374edd39ab2d78dfdc24785e8153048b3a4a
|
Provenance
The following attestation bundles were made for stat_agent-0.1.19-py3-none-any.whl:
Publisher:
publish.yml on chenyhvvvv/STAT-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stat_agent-0.1.19-py3-none-any.whl -
Subject digest:
2cdc48b8830f900ab2b71da829158e5670ae0be3d33fbafebf662bcc6967d73e - Sigstore transparency entry: 1310034343
- Sigstore integration time:
-
Permalink:
chenyhvvvv/STAT-agent@bb1ef7c97c12bcc93384affd20c6f47ba92b16cd -
Branch / Tag:
refs/tags/v0.1.19 - Owner: https://github.com/chenyhvvvv
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bb1ef7c97c12bcc93384affd20c6f47ba92b16cd -
Trigger Event:
release
-
Statement type: