Installation

This guide provides different ways to install spMetaTME, whether you are using it as a library in your Python scripts or as a standalone CLI tool.

Prerequisites

Before installing spMetaTME, ensure your system meets these requirements:

Python

  • Version: Python 3.9 or higher (3.10+ recommended).

  • Package Manager: pip or uv (recommended for faster dependency resolution).


Standard Installation

Using pip

To install spMetaTME directly from PyPI:

pip install spmetatme

Installing from Source

If you want to contribute to the package or use the latest developmental version, you can install it from GitHub.

  1. Clone the repository:

    git clone https://github.com/SurajRepo/spmetatme.git
    cd spmetatme
    
  2. Install in editable mode:

    pip install -e .
    

Verifying Installation

Once installed, you can verify that the CLI is working by checking the version:

spmetatme --version

Or by listing the available metabolic models for inference:

spmetatme infer --list-models

Troubleshooting

R Dependency Issues

If spatial clustering fails, ensure R is correctly installed and accessible in your system’s PATH. You can verify this by typing R --version in your terminal.

GPU Support

spMetaTME uses PyTorch. If you have an NVIDIA GPU but it’s not being utilized, check your PyTorch installation:

import torch
print(torch.cuda.is_available())

If this returns False, you may need to install the version of torch that matches your CUDA version. See pytorch.org for instructions.