Metadata-Version: 2.4
Name: chatspatial
Version: 1.2.0
Summary: ChatSpatial: Natural language-driven spatial transcriptomics analysis via Model Context Protocol (MCP) integration
Author-email: Chen Yang <cafferychen777@tamu.edu>
License: MIT
Project-URL: Homepage, https://github.com/cafferychen777/ChatSpatial
Project-URL: Documentation, https://chatspatial.readthedocs.io
Project-URL: Repository, https://github.com/cafferychen777/ChatSpatial
Project-URL: Issues, https://github.com/cafferychen777/ChatSpatial/issues
Keywords: spatial-transcriptomics,single-cell,mcp,llm,bioinformatics,scanpy,squidpy
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: <3.14,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp>=1.17.0
Requires-Dist: numpy>=1.21.0
Requires-Dist: pandas>=1.3.0
Requires-Dist: scipy>=1.7.0
Requires-Dist: scikit-learn>=1.0.0
Requires-Dist: matplotlib>=3.5.0
Requires-Dist: seaborn>=0.11.0
Requires-Dist: Pillow>=8.0.0
Requires-Dist: scanpy<2.0,>=1.9.0
Requires-Dist: anndata>=0.11.0
Requires-Dist: squidpy>=1.2.0
Requires-Dist: umap-learn>=0.5.0
Requires-Dist: igraph>=0.9.0
Requires-Dist: leidenalg>=0.8.0
Requires-Dist: pydantic<3.0,>=2.0.0
Requires-Dist: click>=8.0.0
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: jinja2>=3.0.0
Requires-Dist: scvi-tools<2.0,>=1.0.0
Requires-Dist: mudata>=0.2.0
Requires-Dist: scvelo>=0.2.5
Requires-Dist: liana
Requires-Dist: cellphonedb<6.0,>=5.0.0
Requires-Dist: fastccc>=0.1.0
Requires-Dist: harmonypy>=0.0.9
Requires-Dist: bbknn>=1.5.0
Requires-Dist: esda>=2.4.0
Requires-Dist: libpysal>=4.6.0
Requires-Dist: gseapy>=1.0.0
Requires-Dist: flashdeconv>=0.1.0
Provides-Extra: full
Requires-Dist: torch<3.0,>=2.0.0; extra == "full"
Requires-Dist: GraphST>=1.1.0; extra == "full"
Requires-Dist: cell2location>=0.1.4; extra == "full"
Requires-Dist: cellrank<3.0,>=2.0.0; extra == "full"
Requires-Dist: palantir>=1.0.0; extra == "full"
Requires-Dist: scanorama>=1.7.0; extra == "full"
Requires-Dist: spatialde>=1.1.3; extra == "full"
Requires-Dist: scikit-misc>=0.5.0; extra == "full"
Requires-Dist: tangram-sc>=1.0.0; extra == "full"
Requires-Dist: singler>=0.4.0; sys_platform != "win32" and extra == "full"
Requires-Dist: singlecellexperiment>=0.4.0; sys_platform != "win32" and extra == "full"
Requires-Dist: celldex>=0.3.0; sys_platform != "win32" and extra == "full"
Requires-Dist: mllmcelltype>=0.1.0; extra == "full"
Requires-Dist: rpy2<3.7,>=3.5.0; extra == "full"
Requires-Dist: anndata2ri>=1.3.0; extra == "full"
Requires-Dist: pysal>=2.6.0; extra == "full"
Requires-Dist: statsmodels>=0.13.0; extra == "full"
Requires-Dist: networkx>=2.6.0; extra == "full"
Requires-Dist: POT>=0.9.0; extra == "full"
Requires-Dist: paste-bio>=1.0.0; extra == "full"
Requires-Dist: infercnvpy>=0.4.0; extra == "full"
Requires-Dist: pydeseq2>=0.4.0; extra == "full"
Requires-Dist: enrichmap; extra == "full"
Requires-Dist: statannotations>=0.2.0; extra == "full"
Requires-Dist: pygam>=0.8.0; extra == "full"
Requires-Dist: scikit-gstat>=1.0.0; extra == "full"
Requires-Dist: adjustText>=0.8.0; extra == "full"
Requires-Dist: splot>=1.1.0; extra == "full"
Requires-Dist: spatialdata>=0.2.0; extra == "full"
Provides-Extra: spatial-domains
Requires-Dist: SpaGCN<2.0,>=1.2.5; extra == "spatial-domains"
Requires-Dist: pybanksy>=1.3.4; extra == "spatial-domains"
Provides-Extra: hpc
Requires-Dist: petsc4py<4.0,>=3.18.0; sys_platform != "win32" and extra == "hpc"
Requires-Dist: slepc4py<4.0,>=3.18.0; sys_platform != "win32" and extra == "hpc"
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio<2.0,>=0.23.0; extra == "dev"
Requires-Dist: black<26.0,>=22.0.0; extra == "dev"
Requires-Dist: mypy<2.0,>=1.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: isort>=5.0.0; extra == "dev"
Requires-Dist: pre-commit<5.0,>=3.0.0; extra == "dev"
Dynamic: license-file

# ChatSpatial

**MCP server for spatial transcriptomics analysis via natural language**

[![CI](https://github.com/cafferychen777/ChatSpatial/actions/workflows/ci.yml/badge.svg)](https://github.com/cafferychen777/ChatSpatial/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/chatspatial)](https://pypi.org/project/chatspatial/)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Docs](https://img.shields.io/badge/docs-available-blue)](https://cafferychen777.github.io/ChatSpatial/)

---

### Before
```python
import scanpy as sc
import squidpy as sq
adata = sc.read_h5ad("data.h5ad")
sc.pp.filter_cells(adata, min_genes=200)
sc.pp.normalize_total(adata)
sc.pp.log1p(adata)
sc.pp.highly_variable_genes(adata)
sc.tl.pca(adata)
sc.pp.neighbors(adata)
# ... 40 more lines
```


### After
```text
"Load my Visium data and identify
 spatial domains"
```

```
Loaded 3,456 spots, 18,078 genes
Identified 7 spatial domains
Generated visualization
```


---

## Quick Start

**Using Claude Code / Codex / OpenCode?** Just paste this:
```
Install ChatSpatial following https://github.com/cafferychen777/ChatSpatial/blob/main/INSTALLATION.md
```


Manual installation

```bash
# Install uv (recommended - handles complex dependencies)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create environment and install
python3 -m venv venv && source venv/bin/activate
uv pip install chatspatial

# Configure (use your venv Python path)
claude mcp add chatspatial /path/to/venv/bin/python -- -m chatspatial server
```


> **Works with any MCP-compatible client** — not just Claude. Use with [OpenCode](https://opencode.ai/), Codex, or any client supporting [Model Context Protocol](https://modelcontextprotocol.io/). Configure your preferred LLM (Qwen, DeepSeek, Doubao, etc.) as the backend.

See [Installation Guide](INSTALLATION.md) for detailed setup including virtual environments and all MCP clients.

---

## Use

```text
Load /path/to/spatial_data.h5ad and show me the tissue structure
```

```text
Identify spatial domains using SpaGCN
```

```text
Find spatially variable genes and create a heatmap
```

---

## Capabilities

| Category | Methods |
|----------|---------|
| **Spatial Domains** | SpaGCN, STAGATE, GraphST, Leiden, Louvain |
| **Deconvolution** | FlashDeconv, Cell2location, RCTD, DestVI, Stereoscope, SPOTlight, Tangram, CARD |
| **Cell Communication** | LIANA+, CellPhoneDB, CellChat, FastCCC |
| **Cell Type Annotation** | Tangram, scANVI, CellAssign, mLLMCelltype, scType, SingleR |
| **Trajectory & Velocity** | CellRank, Palantir, DPT, scVelo, VeloVI |
| **Spatial Statistics** | Moran's I, Local Moran, Geary's C, Getis-Ord Gi*, Ripley's K, Neighborhood Enrichment |
| **Enrichment** | GSEA, ORA, Enrichr, ssGSEA, Spatial EnrichMap |
| **Spatial Genes** | SpatialDE, SPARK-X |
| **Integration** | Harmony, BBKNN, Scanorama, scVI |
| **Other** | CNV Analysis, Spatial Registration |

**60+ methods** across 15 categories. **Supports** 10x Visium, Xenium, Slide-seq v2, MERFISH, seqFISH.

---

## Documentation

| Guide | Description |
|-------|-------------|
| [Installation](INSTALLATION.md) | Virtual environment setup, all platforms |
| [Quick Start](docs/quickstart.md) | 5-minute first analysis |
| [Examples](docs/examples.md) | Step-by-step workflows |
| [Methods Reference](docs/advanced/methods-reference.md) | All 20 tools with parameters |
| [Full Docs](https://cafferychen777.github.io/ChatSpatial/) | Complete reference |

---

## Citation

If you use ChatSpatial in your research, please cite:

```bibtex
@article{Yang2026.02.26.708361,
  author = {Yang, Chen and Zhang, Xianyang and Chen, Jun},
  title = {ChatSpatial: Schema-Enforced Agentic Orchestration for Reproducible and Cross-Platform Spatial Transcriptomics},
  elocation-id = {2026.02.26.708361},
  year = {2026},
  doi = {10.64898/2026.02.26.708361},
  publisher = {Cold Spring Harbor Laboratory},
  URL = {https://www.biorxiv.org/content/early/2026/03/01/2026.02.26.708361},
  journal = {bioRxiv}
}
```


**MIT License** · [GitHub](https://github.com/cafferychen777/ChatSpatial) · [Issues](https://github.com/cafferychen777/ChatSpatial/issues)

