Metadata-Version: 2.4
Name: spmetatme
Version: 0.1
Summary: spMetaTME spMetaTME: A spatial atlas of tumour microenvironment metabolism and interactions
Author-email: Suraj Verma <verma.surajcool@gmail.com>
Maintainer-email: Suraj Verma <verma.surajcool@gmail.com>
License: MIT
Project-URL: bugs, https://github.com/SurajRepo/spmetatme/issues
Project-URL: changelog, https://github.com/SurajRepo/spmetatme/blob/master/changelog.md
Project-URL: homepage, https://github.com/SurajRepo/spmetatme
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer
Provides-Extra: test
Requires-Dist: coverage; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: ruff; extra == "test"
Requires-Dist: ty; extra == "test"
Requires-Dist: ipdb; extra == "test"
Dynamic: license-file

# spMetaTME

![PyPI version](https://img.shields.io/pypi/v/spmetatme.svg)
[![Documentation Status](https://readthedocs.org/projects/spmetatme/badge/?version=latest)](https://spmetatme.readthedocs.io/en/latest/?version=latest)

spMetaTME: Leveraging self-supervised graph neural networks to decode spatial metabolic communities and metabolic interactions for unveiling tumour heterogeneity within the tumour microenvironment

* PyPI package: https://pypi.org/project/spmetatme/
* Free software: MIT License
* Documentation: https://spmetatme.readthedocs.io.

## Create environment
```
pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu126
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.7.0+cu126.html
pip install torch_geometric

```

## Unified CLI Usage
The `spmetatme` package provides a unified command line interface for your analysis pipeline.

*   Detailed Instructions: [CLI Guide](CLI_GUIDE.md)
*   Manual: `spmetatme --help`

### 1. Infer Fluxes (Basic Example)
```bash
spmetatme infer --input data/BC_515_Section_1.h5ad --model-species human --metabolic-model breast_cancer
```

### 2. Pretrain (Basic Example)
```bash
spmetatme pretrain --training-list data/*.h5ad --metabolic-model breast_cancer --repo-id MyRepo/v1
```

## Docker Usage
We provide a full-featured Docker image that includes all dependencies (including R's `mclust` for domain identification).

*   Detailed Instructions: [Docker Guide](DOCKER_GUIDE.md)

### Using the Docker Helper (Windows)
```cmd
# Run inference
run_docker.cmd infer --input data/BC_515_Section_1.h5ad --model-species human --metabolic-model breast_cancer

# Run pretraining
run_docker.cmd pretrain --training-list data/*.h5ad --metabolic-model breast_cancer --repo-id MyRepo/v1
```

### Manual Docker Command (Linux / Mac)
```bash
docker run --rm -it --gpus all -v $(pwd):/app spmetatme infer --input data/BC_515_Section_1.h5ad --model-species human --metabolic-model breast_cancer
```
### Please cite
Verma, S., Doan, L. M. T., Kang, J. H., Colombo, G., Serganov, I., Zappasodi, R., Occhipinti, A., & Angione, C. spMetaTME: A spatial atlas of tumour microenvironment metabolism and interactions.
