Python port of cellcall: inference of intercellular networks from single-cell transcriptomics
Project description
py-cellcall
Python port of cellcall: inference of intercellular and intracellular networks from single-cell transcriptomics.
Features
- Pure Python — no R dependency
- Fast — 4.8x speedup over R (379s vs 1768s on 35K genes x 366 cells)
- High parity — Pearson >= 0.998 for expr_mean and expr_l_r_log2_scale
- Compatible API with R cellcall
Install
pip install -e .
Dependencies
numpy>=1.22, pandas>=1.4, scipy>=1.8, statsmodels>=0.13
Quick Start
import pandas as pd
from cellcall.connect_profile import create_nichcon_object, trans_commu_profile
# Load count matrix (genes x cells)
# Column names must encode cell type: "BARCODE_CELLTYPE"
data = pd.read_csv("counts.csv", index_col=0)
# Create CellInter object
obj = create_nichcon_object(
data=data,
source="UMI", # "UMI", "fullLength", "TPM", "CPM"
org="Homo sapiens", # or "Mus musculus"
)
# Run communication analysis
obj = trans_commu_profile(
obj,
pValueCor=0.05,
CorValue=0.1,
topTargetCor=1,
method="weighted", # "weighted", "max", "mean"
use_type="median",
probs=0.75,
)
# Access results
scores = obj.data["expr_l_r_log2_scale"] # Final scaled scores
regulons = obj.data["regulons_matrix"] # TF regulon scores
means = obj.data["expr_mean"] # Mean expression per cell type
Function Map (R -> Python)
| R function | Python function |
|---|---|
CreateNichConObject() |
create_nichcon_object() |
TransCommuProfile() |
trans_commu_profile() |
ConnectProfile() |
connect_profile() |
LR2TF() |
lr2tf() |
getHyperPathway() |
get_hyper_pathway() |
trans2tripleScore() |
trans2triple_score() |
counts2normalized_10X() |
counts2normalized_10x() |
viewPheatmap() |
view_pheatmap() |
plotBubble() |
plot_bubble() |
getForBubble() |
get_for_bubble() |
Output Slots
| Slot | Description |
|---|---|
expr_mean |
Mean expression per cell type |
regulons_matrix |
TF regulon NES scores |
fc_list |
Log2 fold changes per cell type |
expr_r_regulons |
L-R regulon activation scores |
softmax_ligand |
Softmax-normalized ligand expression |
softmax_receptor |
Softmax-normalized receptor expression |
expr_l_r |
Raw L-R communication scores |
expr_l_r_log2 |
Log2-transformed scores |
expr_l_r_log2_scale |
Min-max scaled scores (0-1) |
DistanceKEGG |
KEGG pathway distances |
Visualization
Sankey Diagram (Ligand → Receptor → TF)
GSEA Enrichment Plot
L-R Communication & Regulon Heatmap
Citation
If you use cellcall, please cite:
Liu, T. et al. cellcall: integrated analysis of ligand-receptor and transcription factor activities from single-cell transcriptomics. (2021)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_cellcall-0.1.0.tar.gz.
File metadata
- Download URL: py_cellcall-0.1.0.tar.gz
- Upload date:
- Size: 33.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17dd3f458bd23e262d8e275c9a2fc6d4da25d7f953676669bb572b0d74aa2a0b
|
|
| MD5 |
3d803921c102f462e43bee1ea808701e
|
|
| BLAKE2b-256 |
b3cb9f139b42bedbd570f5b835de1cc266d3745db86eeec820c8dd54af6570c9
|
File details
Details for the file py_cellcall-0.1.0-py3-none-any.whl.
File metadata
- Download URL: py_cellcall-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1de7809466b323e078da1d5646d3105929c91d94457ba3b118e88e0ef5de4bf2
|
|
| MD5 |
60360139790a884548ba7175d480fa36
|
|
| BLAKE2b-256 |
6952c90184292441784ed1873c34e40a0026cc48efd3b54e3f4322db8eee0ff3
|