NicheNet Protocol

April 2, 2025 · View on GitHub

This repository contains the R code found in https://www.nature.com/articles/s41596-024-01121-9.

Installation

To install NicheNet and its dependencies, enter the following code in R:

if(!requireNamespace("devtools", quietly = TRUE)) {
  install.packages("devtools") 
}

devtools::install_github("saeyslab/nichenetr")

Installation typically takes a few minutes, depending on the number of dependencies that has already been installed on your PC. nichenetr was tested on both Windows and Linux (most recently tested R version: R 4.3.2).

For the most up-to-date changes on NicheNet, please refer to our main GitHub repository: https://github.com/saeyslab/nichenetr.

Content

Input files

FileMouseHuman
Example seurat objectLink*N/A
Ligand-receptor networkLink*Link
Ligand-target matrixLink*Link
Weighted networksLinkLink
Ligand-TF matrixLinkLink
Signaling networkLinkLink
Gene regulatory networkLinkLink

* Required to run the NicheNet ligand activity analysis and target gene prediction
† Required to create certain visualizations (Steps 16, 30)
‡ Required for Box 1 code

Code files

  • procedure_code.*: code from the Procedure section provided in various file formats. The .html and .md files facilitate viewing on the web, while the .Rmd and .R files allow for easier modification. The code to reproduce Figure 3 is provided at the end of procedure_code.R.
  • box_code.R: code from Boxes 1-3
  • timing.R: code used to time the functions

References

Sang-aram, C., Browaeys, R., Seurinck, R., & Saeys, Y. (2025). Unraveling cell-cell communication with NicheNet by inferring active ligands from transcriptomics data. Nature Protocols. https://doi.org/10.1038/s41596-024-01121-9.

Browaeys, R., Saelens, W., & Saeys, Y. (2020). NicheNet: modeling intercellular communication by linking ligands to target genes. Nature methods, 17(2), 159-162. https://doi.org/10.1038/s41592-019-0667-5.