This repository provides a Python implementation of Spatial Aggregation Index (SAI), a metric for quantifying the spatial proximity and interaction potential between two specific cell types in spatial transcriptomics datasets.
The method is based on nearest-neighbor analysis and incorporates both global and local abundance of cell types, adjusted by weighted distances. It is designed for integration with AnnData objects commonly used in single-cell and spatial omics analysis.
- Computes cell-type specific SAI Score for each cell.
- Handles nearest-neighbor distance calculations using
scikit-learn. - Scales scores by global and local abundances of interacting cell types.
- Log-transformation applied for stabilization.
- Built-in error handling and data validation to ensure robust computation.
- Compatible with Scanpy/AnnData workflow.
Clone this repository:
git clone https://github.com/AI-Lab-Pathology/SAI.git
cd SAI
python setup.py install