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)
Metadata
Release files for py-CellCall 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py_cellcall-0.1.0.tar.gz | 33.2 MB | Without provenance | Details for py_cellcall-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| py_cellcall-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for py_cellcall-0.1.0-py3-none-any.whl |
Total release size: 50.5 MB
Release files / py_cellcall-0.1.0.tar.gz
| Download URL | py_cellcall-0.1.0.tar.gz |
|---|---|
| Size | 33.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17dd3f458bd23e262d8e275c9a2fc6d4da25d7f953676669bb572b0d74aa2a0b
|
|
BLAKE2b-256 checksum How to use checksums |
b3cb9f139b42bedbd570f5b835de1cc266d3745db86eeec820c8dd54af6570c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.13
|
Release files / py_cellcall-0.1.0-py3-none-any.whl
| Download URL | py_cellcall-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1de7809466b323e078da1d5646d3105929c91d94457ba3b118e88e0ef5de4bf2
|
|
BLAKE2b-256 checksum How to use checksums |
6952c90184292441784ed1873c34e40a0026cc48efd3b54e3f4322db8eee0ff3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.13
|
Security for py-CellCall 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.