Skip to main content

pytest pypi codecov

NicheNetPy: the python implementation of the NicheNet method. (ported from NicheNetR) The goal of NicheNet is to study intercellular communication from a computational perspective. NicheNet uses human or mouse gene expression data of interacting cells as input and combines this with a prior model that integrates existing knowledge on ligand-to-target signaling paths. This allows to predict ligand-receptor interactions that might drive gene expression changes in cells of interest.

We describe the NicheNet algorithm in the following paper: NicheNet: modeling intercellular communication by linking ligands to target genes.

Installation of nichenetpy

pip install nichenetpy

To compute personalized PageRank with scikit-network as in nichenetpy 1.x (ppr_implementation="scikit-network"), install the optional extra:

pip install nichenetpy[sknetwork]

Overview of NicheNet

Background

NicheNet strongly differs from most computational approaches to study cell-cell communication (CCC), as summarized conceptually by the figure below (top panel: current ligand-receptor inference approaches; bottom panel: NicheNet). Many approaches to study CCC from expression data involve linking ligands expressed by sender cells to their corresponding receptors expressed by receiver cells. However, functional understanding of a CCC process also requires knowing how these inferred ligand-receptor interactions result in changes in the expression of downstream target genes within the receiver cells. Therefore, we developed NicheNet to consider the gene regulatory effects of ligands.



At the core of NicheNet is a prior knowledge model, created by integrating three types of databases—ligand-receptor interactions, signaling pathways, and transcription factor (TF) regulation—to form a complete communication network spanning from ligands to their downstream target genes (see figure below). Therefore, this model goes beyond ligand-receptor interactions and incorporates intracellular signaling and transcriptional regulation as well. As a result, NicheNet is able to predict which ligands influence the expression in another cell, which target genes are affected by each ligand, and which signaling mediators may be involved. By generating these novel types of hypotheses, NicheNet can drive an improved functional understanding of a CCC process of interest. We provide a pre-built prior model, it is also possible to construct your own model (see notebooks below).

Main functionalities of nichenetpy

  • Assessing how well ligands expressed by a sender cell can predict changes in gene expression in the receiver cell
  • Prioritizing ligands based on their effect on gene expression
  • Inferring putative ligand-target links active in the system under study
  • Inferring potential signaling paths between ligands and target genes of interest: to generate causal hypotheses and check which data sources support the predictions
  • Construction of user-defined prior ligand-target models

Moreover, we provide instructions on how to make intuitive visualizations of the main predictions (e.g., via circos plots as shown here below).



As input to NicheNet, users must provide cell type-annotated expression data that reflects a cell-cell communication (CCC) event. The input can be single-cell or sorted bulk data from human or mouse. As output, NicheNet returns the ranking of ligands that best explain the CCC event of interest, as well as candidate target genes with high potential to be regulated by these ligands. As an intermediate step, we extract the three features required for the analysis: a list of potential ligands, a gene set that captures the downstream effects of the CCC event of interest, and a background set of genes. Further explanation on each feature can be found in the introductory notebooks.

Learning to use nichenetpy

A very basic tutorial for people who are unfamiliar with python can be found here.

The following notebooks contain the explanation on how to perform a basic NicheNet analysis on an AnnData object. This includes prioritizing ligands and predicting target genes of prioritized ligands. We recommend starting with the step-by-step analysis, but we also demonstrate the use of a single wrapper function.

Case study on HNSCC tumor which demonstrates the flexibility of NicheNet. Here, the gene set of interest was determined by the original authors, and the expression data is a matrix rather than an AnnData object.

The following notebooks explain how to do some follow-up analyses:

If you want to make a circos plot visualization of the NicheNet output to show active ligand-target links between interacting cells, you can check following notebooks:

People interested in building their own models or benchmarking their own models against NicheNet can read the following notebooks:

For a comparison between Seurat's FindAllMarkers (which is ported into nichenetpy) and Scanpy's rank_genes_groups, see the following notebook:

Documentation

Documentation is available at NicheNetPy docs

FAQ

References

Browaeys, R., Saelens, W. & Saeys, Y. NicheNet: modeling intercellular communication by linking ligands to target genes. Nat Methods (2019) doi:10.1038/s41592-019-0667-5

Bonnardel et al. Stellate Cells, Hepatocytes, and Endothelial Cells Imprint the Kupffer Cell Identity on Monocytes Colonizing the Liver Macrophage Niche. Immunity (2019) doi:10.1016/j.immuni.2019.08.017

Guilliams et al. Spatial proteogenomics reveals distinct and evolutionarily conserved hepatic macrophage niches. Cell (2022) doi:10.1016/j.cell.2021.12.018

Metadata

Release files for nichenetpy 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nichenetpy 2.0.0
File Size Uploaded Provenance Actions
nichenetpy-2.0.0.tar.gz 108.9 kB With provenance Details for nichenetpy-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nichenetpy 2.0.0
File Interpreter ABI Platform Actions
nichenetpy-2.0.0-py3-none-any.whl Python 3 none any Details for nichenetpy-2.0.0-py3-none-any.whl

Total release size: 114.3 kB

Release files / nichenetpy-2.0.0.tar.gz

Download URL nichenetpy-2.0.0.tar.gz
Size 108.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2bf29afbe82ff7e85e884d8560c33c121e1073d0e1080cd781b2fb742dd6c008
BLAKE2b-256 checksum
How to use checksums
59eeca80119a173909eec42367f18f03803e872f509ff6b6c4aa59ba1c82b835
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / nichenetpy-2.0.0-py3-none-any.whl

Download URL nichenetpy-2.0.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3cedf2afb8a7167c1b40ada396872ec45441cead7fa6c79f015f6f8d2d751d40
BLAKE2b-256 checksum
How to use checksums
1df5dd804c53aa632a7283ec885e1ac7f27ed477a2ee5e6ace7e6ac332716780
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for nichenetpy 2.0.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nichenetpy-2.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page