nichenetpy
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
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.
- Perform NicheNet analysis starting from an AnnData object: step-by-step analysis
- Perform NicheNet analysis starting from an AnnData object: wrapper
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:
- Prioritization of ligands based on expression values
- Inferring ligand-to-target signaling paths
- Assess how well top-ranked ligands can predict a gene set of interest
- Single-cell NicheNet’s ligand activity analysis
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:
- Model construction
- Using LIANA ligand-receptor databases to construct the ligand-target model
- Model evaluation: target gene and ligand activity prediction
For a comparison between Seurat's FindAllMarkers (which is ported into nichenetpy) and Scanpy's rank_genes_groups, see the following notebook:
FAQ
- Check the FAQ pages at FAQ NicheNetPy and FAQ Nichenet
References
Browaeys, R., Saelens, W. & Saeys, Y. NicheNet: modeling intercellular
communication by linking ligands to target genes. Nat Methods (2019)
Bonnardel et al. Stellate Cells, Hepatocytes, and Endothelial Cells
Imprint the Kupffer Cell Identity on Monocytes Colonizing the Liver
Macrophage Niche. Immunity (2019)
Guilliams et al. Spatial proteogenomics reveals distinct and
evolutionarily conserved hepatic macrophage niches. Cell (2022)
1''' 2**NicheNetPy: the python implementation of the NicheNet method. (ported from [NicheNetR](https://github.com/saeyslab/nichenetr/tree/master))** The goal of 3NicheNet is to study intercellular communication from a computational 4perspective. NicheNet uses human or mouse gene expression data of 5interacting cells as input and combines this with a prior model that 6integrates existing knowledge on ligand-to-target signaling paths. This 7allows to predict ligand-receptor interactions that might drive gene 8expression changes in cells of interest. 9 10We describe the NicheNet algorithm in the following paper: [NicheNet: 11modeling intercellular communication by linking ligands to target 12genes](https://www.nature.com/articles/s41592-019-0667-5). 13 14## Installation of nichenetpy 15 16``` 17pip install nichenetpy 18``` 19 20## Overview of NicheNet 21 22### Background 23 24NicheNet strongly differs from most computational approaches to study 25cell-cell communication (CCC), as summarized conceptually by the figure 26below (**top panel:** current ligand-receptor inference approaches; 27**bottom panel:** NicheNet). Many approaches to study CCC from 28expression data involve linking ligands expressed by sender cells to 29their corresponding receptors expressed by receiver cells. However, 30functional understanding of a CCC process also requires knowing how 31these inferred ligand-receptor interactions result in changes in the 32expression of downstream target genes within the receiver cells. 33Therefore, we developed NicheNet to consider the gene regulatory effects 34of ligands. <br><br> 35<img src="https://github.com/saeyslab/nichenetpy/raw/main/images/comparison_other_approaches_2.jpg" 36width="450" /> <br><br> 37 38At the core of NicheNet is a prior knowledge model, created by 39integrating three types of databases—ligand-receptor interactions, 40signaling pathways, and transcription factor (TF) regulation—to form a 41complete communication network spanning from ligands to their downstream 42target genes (see figure below). Therefore, this model goes beyond 43ligand-receptor interactions and incorporates intracellular signaling 44and transcriptional regulation as well. As a result, NicheNet is able to 45predict which ligands influence the expression in another cell, which 46target genes are affected by each ligand, and which signaling mediators 47may be involved. By generating these novel types of hypotheses, NicheNet 48can drive an improved functional understanding of a CCC process of 49interest. We provide a pre-built prior model, it is 50also possible to construct your own model (see notebooks below). 51 52<img src="https://github.com/saeyslab/nichenetpy/raw/main/images/nichenet_prior_model.png" 53style="width:70.0%" /> 54 55### Main functionalities of nichenetpy 56 57- Assessing how well ligands expressed by a sender cell can predict 58 changes in gene expression in the receiver cell 59- Prioritizing ligands based on their effect on gene expression 60- Inferring putative ligand-target links active in the system under 61 study 62- Inferring potential signaling paths between ligands and target genes 63 of interest: to generate causal hypotheses and check which data 64 sources support the predictions 65- Construction of user-defined prior ligand-target models 66 67Moreover, we provide instructions on how to make intuitive 68visualizations of the main predictions (e.g., via circos plots as shown 69here below). 70 71<br><br> 72<img src="https://github.com/saeyslab/nichenetpy/blob/main/images/circos.png" width="600" /> 73 74As input to NicheNet, users must provide cell type-annotated expression 75data that reflects a cell-cell communication (CCC) event. The input can 76be single-cell or sorted bulk data from human or mouse. As output, 77NicheNet returns the ranking of ligands that best explain the CCC event 78of interest, as well as candidate target genes with high potential to be 79regulated by these ligands. As an intermediate step, we extract the 80three features required for the analysis: a list of potential ligands, a 81gene set that captures the downstream effects of the CCC event of 82interest, and a background set of genes. Further explanation on each 83feature can be found in the introductory notebooks. 84 85<img src="https://github.com/saeyslab/nichenetpy/raw/main/images/figure1.svg" width="600" /> 86 87## Learning to use nichenetpy 88 89A very basic tutorial for people who are unfamiliar with python can be found here. 90 91- [Basic Tutorial](https://github.com/saeyslab/nichenetpy/blob/main/notebooks/basic_tutorial.ipynb) 92 93The following notebooks contain the explanation on how to perform a 94basic NicheNet analysis on an AnnData object. This includes prioritizing 95ligands and predicting target genes of prioritized ligands. We recommend 96starting with the step-by-step analysis, but we also demonstrate the use 97of a single wrapper function. 98 99- [Perform NicheNet analysis starting from an AnnData object: 100 step-by-step 101 analysis](https://github.com/saeyslab/nichenetpy/blob/main/notebooks/steps.ipynb) 102- [Perform NicheNet analysis starting from an AnnData 103 object: wrapper](https://github.com/saeyslab/nichenetpy/blob/main/notebooks/wrapper.ipynb) 104 105Case study on HNSCC tumor which demonstrates the flexibility of 106NicheNet. Here, the gene set of interest was determined by the original 107authors, and the expression data is a matrix rather than an AnnData 108object. 109 110- [NicheNet’s ligand activity analysis on a gene set of 111 interest](https://github.com/saeyslab/nichenetpy/blob/main/notebooks/ligand_activity_geneset.ipynb) 112 113The following notebooks explain how to do some follow-up 114analyses: 115 116- [Prioritization of ligands based on expression 117 values](https://github.com/saeyslab/nichenetpy/blob/main/notebooks/steps_prioritization.ipynb) 118- [Inferring ligand-to-target signaling 119 paths](https://github.com/saeyslab/nichenetpy/blob/main/notebooks/ligand_target_signaling_path.ipynb) 120- [Assess how well top-ranked ligands can predict a gene set of 121 interest](https://github.com/saeyslab/nichenetpy/blob/main/notebooks/target_prediction_evaluation_geneset.ipynb) 122- [Single-cell NicheNet’s ligand activity 123 analysis](https://github.com/saeyslab/nichenetpy/blob/main/notebooks/ligand_activity_single_cell.ipynb) 124 125If you want to make a circos plot visualization of the NicheNet output 126to show active ligand-target links between interacting cells, you can 127check following notebooks: 128 129- [circos visualization](https://github.com/saeyslab/nichenetpy/blob/main/notebooks/circos.ipynb) 130 131People interested in building their own models or benchmarking their own 132models against NicheNet can read the following notebooks: 133 134- [Model construction](https://github.com/saeyslab/nichenetpy/blob/main/notebooks/model_construction.ipynb) 135- [Using LIANA ligand-receptor databases to construct the ligand-target model](https://github.com/saeyslab/nichenetpy/blob/main/notebooks/model_construction_with_liana.ipynb) 136- [Model evaluation: target gene and ligand activity prediction](https://github.com/saeyslab/nichenetpy/blob/main/notebooks/model_evaluation.ipynb) 137 138For a comparison between Seurat's FindAllMarkers (which is ported into nichenetpy) and Scanpy's rank_genes_groups, see the following notebook: 139 140- [Comparison: Seurat vs Scanpy](https://github.com/saeyslab/nichenetpy/blob/main/notebooks/seuratVSscanpy.ipynb) 141 142## FAQ 143 144- Check the FAQ pages at [FAQ NicheNetPy](https://github.com/saeyslab/nichenetpy/blob/main/faq.md) and [FAQ Nichenet](https://github.com/saeyslab/nichenetr/blob/master/vignettes/faq.md) 145 146## References 147 148Browaeys, R., Saelens, W. & Saeys, Y. NicheNet: modeling intercellular 149communication by linking ligands to target genes. Nat Methods (2019) 150<doi:10.1038/s41592-019-0667-5> 151 152Bonnardel et al. Stellate Cells, Hepatocytes, and Endothelial Cells 153Imprint the Kupffer Cell Identity on Monocytes Colonizing the Liver 154Macrophage Niche. Immunity (2019) <doi:10.1016/j.immuni.2019.08.017> 155 156Guilliams et al. Spatial proteogenomics reveals distinct and 157evolutionarily conserved hepatic macrophage niches. Cell (2022) 158<doi:10.1016/j.cell.2021.12.018> 159''' 160 161__version__ = "1.0.1"