Metadata-Version: 2.4
Name: laris
Version: 0.9.0
Summary: LARIS enables accurate and efficient ligand and receptor interaction analysis in spatial transcriptomics
Project-URL: Documentation, https://genecell.github.io/LARIS/
Project-URL: Source, https://github.com/genecell/LARIS
Project-URL: Homepage, https://genecell.github.io/LARIS/
Project-URL: Bug Tracker, https://github.com/genecell/LARIS/issues
Author-email: Min Dai <dai@broadinstitute.org>, Tivadar Török <ttorok@broadinstitute.org>, Dawei Sun <dsun@broadinstitute.org>
Maintainer-email: Min Dai <dai@broadinstitute.org>, Tivadar Török <ttorok@broadinstitute.org>, Vallari Shende <vshende@broadinstitute.org>
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: bioinformatics,cell-communication,ligand-receptor,single-cell,spatial-transcriptomics
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.9
Requires-Dist: anndata>=0.8.0
Requires-Dist: cosg>=1.0.3
Requires-Dist: matplotlib>=3.4.0
Requires-Dist: numpy>=1.20.0
Requires-Dist: pandas>=1.3.0
Requires-Dist: scanpy>=1.9.1
Requires-Dist: scikit-learn>=0.24.0
Requires-Dist: scipy>=1.7.0
Requires-Dist: seaborn>=0.11.0
Requires-Dist: statsmodels>=0.13.2
Requires-Dist: tqdm
Requires-Dist: typing-extensions
Provides-Extra: dev
Requires-Dist: pre-commit; extra == 'dev'
Description-Content-Type: text/markdown

# LARIS: Ligand And Receptor Interaction in Spatial transcriptomics data


LARIS is a Python package for analyzing ligand-receptor interactions in spatial transcriptomics data. It identifies spatially-specific cell-cell communication patterns by integrating gene expression, spatial information, and cell type annotations.

### Features

- **Spatial LR interaction strength**: Calculate ligand-receptor interaction scores using spatial adjacency information
- **Spatial specificity**: Identify LR pairs with significant spatial variable patterns
- **Inference at cell type level**: Compute sender-receiver cell type interaction scores
- **Spatial neighborhoods**: Analyze interactions in the context of spatial cell type neighborhoods

### 📦 Installation

For the development version in GitHub, you could install via:
```bash
pip install git+https://github.com/genecell/LARIS.git
```

You could simply install LARIS via `pip` in your conda environment (future):
```bash
pip install laris
```

### Quick Start

```python
import laris as la
import scanpy as sc
import pandas as pd

# Load your spatial transcriptomics data
adata = sc.read_h5ad('spatial_data.h5ad')

# Define ligand-receptor pairs
lr_df = pd.DataFrame({
    'ligand': ['Tgfb1', 'Vegfa', 'Cxcl12'],
    'receptor': ['Tgfbr1', 'Kdr', 'Cxcr4']
})

# Step 1: Calculate LR integration scores
lr_adata = la.tl.prepareLRInteraction(
    adata, 
    lr_df,
    number_nearest_neighbors=15,
    use_rep_spatial='X_spatial'
)

# Step 2: Identify spatially-specific LR interactions and infer the LR interaction at cell type level
laris_results, celltype_results = la.tl.runLARIS(
    lr_adata,
    adata,
    n_nearest_neighbors=15,
    n_repeats=100,
    n_top_lr=1000,
    by_celltype=True,
    groupby='cell_type'
)

# View top spatially-specific LR pairs
print(laris_results.head(10))

# View top cell type-specific interactions
print(celltype_results.head(10))

# Filter for specific cell type pairs
endothelial_to_tumor = celltype_results[
    (celltype_results['sending_celltype'] == 'Endothelial') &
    (celltype_results['receiving_celltype'] == 'Tumor')
]
print(endothelial_to_tumor.head(10))
```

