Metadata-Version: 2.4
Name: py-sigxtalk
Version: 0.1.2
Summary: Python rewrite of SigXTalk: Dissecting crosstalk induced by cell-cell communication
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: scipy>=1.10
Requires-Dist: scikit-learn>=1.3
Requires-Dist: torch>=2.0
Requires-Dist: dhg>=0.9.4
Requires-Dist: liana
Requires-Dist: matplotlib>=3.7
Requires-Dist: seaborn>=0.12
Requires-Dist: anndata>=0.10
Requires-Dist: scanpy>=1.9
Requires-Dist: networkx>=3.0
Provides-Extra: benchmark
Requires-Dist: rpy2>=3.5; extra == "benchmark"
Requires-Dist: lightgbm>=4.0; extra == "benchmark"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: rpy2>=3.5; extra == "dev"
Requires-Dist: lightgbm>=4.0; extra == "dev"
Dynamic: license-file

<p align="center">
  <img src="data/logo.png" width="360px" alt="py-sigxtalk logo">
</p>

<div align="center">

| | |
|---:|:---|
| **Package** | [![PyPI](https://img.shields.io/pypi/v/py-sigxtalk?color=blue)](https://pypi.org/project/py-sigxtalk/) ![Python Versions](https://img.shields.io/pypi/pyversions/py-sigxtalk?color=blue) [![Downloads](https://static.pepy.tech/badge/py-sigxtalk)](https://pepy.tech/project/py-sigxtalk) |
| **Meta** | [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE) [![Stars](https://img.shields.io/github/stars/omicverse/py-SigXTalk?style=social)](https://github.com/omicverse/py-SigXTalk) |

</div>

---

# py-sigxtalk

Python rewrite of **SigXTalk**: Dissecting crosstalk induced by cell-cell communication using single-cell transcriptomic data.

## Installation

```bash
pip install py-sigxtalk
```

## Quick Start

```python
import pysigxtalk as psx

# Load databases
rtf_db, tftg_db = psx.load_databases(species="human")

# Prepare inputs
inputs = psx.prepare_input(exp_mat, target_genes, lr_pairs, rtf_db, tftg_db)

# Run HGNN
pathways = psx.run_hgnn(inputs, epochs=10, device="cpu")

# Calculate PRS
prs_results = psx.compute_prs(inputs.exp_clu, pathways, n_estimators=10)

# Visualize
psx.plot_counts_histogram(prs_results)
psx.plot_counts_bar(prs_results, topk=20)
psx.plot_fid_spe(prs_results, key_tg="CD68")
```

## Benchmark

**Python vs R Correlation (PBMC3k dataset):**

- **Pearson Correlation: 0.9912**

<p align="center">
  <img src="example/figures/benchmark_correlation.png" width="60%" alt="Correlation">
</p>

## Visualization Gallery

**Crosstalk Analysis:**

| Histogram | Bar Chart | Fid/Spe |
|:---------:|:---------:|:-------:|
| ![Histogram](example/figures/01_crosstalk_histogram.png) | ![Bar](example/figures/02_crosstalk_bar.png) | ![Fid/Spe](example/figures/03_fid_spe.png) |

| Alluvial | Ridgeline | Chord |
|:--------:|:---------:|:-----:|
| ![Alluvial](example/figures/04_alluvial.png) | ![Ridgeline](example/figures/05_ridgeline.png) | ![Chord](example/figures/06_chord.png) |

**Network & Heatmaps:**

| CCI Chord | CCI Circle | Signal Contribution |
|:---------:|:----------:|:-------------------:|
| ![CCI Chord](example/figures/07_cci_chord.png) | ![CCI Circle](example/figures/08_cci_circle.png) | ![Signal](example/figures/09_signal_contribution.png) |

| Rec-TG Heatmap | Circular Bar |
|:--------------:|:------------:|
| ![Heatmap](example/figures/10_rec_tg_heatmap.png) | ![Circular](example/figures/11_circular_bar.png) |

## Examples

```
example/
├── quickstart.ipynb              # Full analysis workflow
├── benchmark.ipynb               # Python vs R comparison
├── data/                         # Input data & results
├── figures/                      # Generated figures
└── scripts/                      # Utility scripts
```

## Citation

> Hou, J. et al. Dissecting crosstalk induced by cell-cell communication using single-cell transcriptomic data. Nature Communications (2025).
