Metadata-Version: 2.4
Name: slot-toolkit
Version: 1.0.1
Summary: A package for Subcellular Location Optimal Transport (SLOT) algorithm.
Author-email: Devinjzhu <zhuj21@mail.tsinghua.edu.cn>
License: MIT License
        
        Copyright (c) 2025 LifeomicsAI
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/Lifeomics/SLOT
Project-URL: Repository, https://github.com/Lifeomics/SLOT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anndata>=0.10
Requires-Dist: h5py>=3.11
Requires-Dist: matplotlib>=3.9
Requires-Dist: numba>=0.60
Requires-Dist: numpy>=1.21
Requires-Dist: pandas>=2.2
Requires-Dist: scanpy>=1.10
Requires-Dist: scikit-learn>=1.5
Requires-Dist: scipy>=1.14
Requires-Dist: seaborn>=0.13
Requires-Dist: tqdm>=4.66
Requires-Dist: umap-learn>=0.5
Requires-Dist: natsort>=8.4
Requires-Dist: networkx>=3.3
Requires-Dist: pynndescent>=0.5
Requires-Dist: statsmodels>=0.14
Requires-Dist: goatools>=1.4
Dynamic: license-file

# Subcellular Location Optimal Transport (SLOT)

[![PyPI version](https://img.shields.io/pypi/v/slot-toolkit.svg)](https://pypi.org/project/slot-toolkit/)
[![Python](https://img.shields.io/pypi/pyversions/slot-toolkit.svg)](https://pypi.org/project/slot-toolkit/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

SLOT is an optimal-transport–based machine learning framework for quantifying and modeling the spatial–temporal localization of intracellular molecules.

## Introduction
By integrating subcellular-resolution spatial transcriptomics (mRNA) and proteomics (protein) datasets, SLOT systematically aligns and compares molecular distributions across cellular compartments and temporal stages. The framework infers relocation trajectories and quantifies dynamic shifts in subcellular localization patterns. As a comprehensive computational toolbox, SLOT enables systematic modeling of subcellular molecular spatial polarity, supporting pattern detection, spatial-location clustering investigations and spatiotemporal dynamic analysis. 

![SLOT Framework Overview](resource/home.jpg)

## Features

- Spatial localization polarity quantification
- Location patterns matching
- Subcellular location clustering
- Spatial-temporal co-localization detection

## Installation

### Prerequisites

- Python 3.10 or higher

### Install from PyPI (Recommended)

```bash
pip install slot-toolkit
```

### Install from Source

1. Clone the repository:
    ```bash
    git clone https://github.com/Lifeomics/SLOT.git
    cd SLOT
    ```

2. Create a conda environment and activate it:
    ```bash
    conda create --name SLOT_env python=3.10
    conda activate SLOT_env
    ```

3. Install SLOT and its dependencies:
    ```bash
    pip install .
    ```

    For development / editable install (changes to source take effect immediately):
    ```bash
    pip install -e .
    ```

Installation typically takes 1–2 minutes.

## Quick Start

```python
import SLOT

# Load your spatial omics data
adata = SLOT.data.load_data("path/to/data.h5ad")

# Compute SLOT polarity scores
scores = SLOT.model.compute_slot_score(adata)

# Cluster subcellular localization patterns
SLOT.cluster.run_clustering(adata)

# Visualize results
SLOT.plot.bindingplot(adata)
```

## [Tutorials](/tutorial)

| Tutorial | Description |
|----------|-------------|
| [Tutorial 1: SLOT Score](/tutorial/tutorial1_slot_score.ipynb) | Identify spatial polarity proteins at subcellular resolution |
| [Tutorial 2: SLOT Cluster](/tutorial/tutorial2_slot_cluster.ipynb) | Cluster subcellular localization patterns |
| [Tutorial 3: Pattern Matching](/tutorial/tutorial3_slot_pattern_match.ipynb) | Match and compare spatial distribution patterns |

The processed data used in tutorials are available at [XenoSTAR](http://xenostar.ncpsb.org.cn).

## Citation

If you use SLOT in your research, please cite our paper (coming soon).

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
