Coder Social home page Coder Social logo

saeyslab / nichenetr Goto Github PK

View Code? Open in Web Editor NEW
437.0 15.0 113.0 154.8 MB

NicheNet: predict active ligand-target links between interacting cells

R 99.45% TeX 0.55%
single-cell-omics intercellular-communication ligand-receptor ligand-target data-integration single-cell-rna-seq rna-seq gene-expression network-inference cell-cell-communication

nichenetr's Introduction

nichenetr

R build status Coverage Status DOI DOI

nichenetr: the R implementation of the NicheNet method. 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 nichenetr

Installation typically takes a few minutes, depending on the number of dependencies that has already been installed on your PC. You can install nichenetr (and required dependencies) from github with:

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

devtools::install_github("saeyslab/nichenetr")

nichenetr was tested on both Windows and Linux (most recently tested R version: R 4.3.2)

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. Note that although we provide a pre-built prior model, it is also possible to construct your own model (see vignettes below).

Main functionalities of nichenetr

  • 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
  • Validation of the prior ligand-target model
  • 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 vignette.



Learning to use nichenetr

The following vignettes contain the explanation on how to perform a basic NicheNet analysis on a Seurat 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. This demo analysis takes only a few minutes to run.

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 a Seurat object.

The following vignettes contain explanation on how to do some follow-up analyses after performing the most basic 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 vignettes:

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

FAQ

Check the FAQ page at FAQ NicheNet: vignette("faq", package="nichenetr")

Previous updates

20-06-2023:

  • MultiNicheNet - a multi-sample, multi-condition extension of NicheNet - is now available on biorxiv and Github.
  • MultiNicheNet uses an updated prior model (v2) consisting of additional ligand-receptor interactions from the Omnipath database and from Verschueren et al. (2020). We have now also updated the vignettes of NicheNet to use the new model instead.
  • New functionality: we have included additional functions to prioritize ligands not only based on the ligand activity, but also on the ligand and receptor expression, cell type specificity, and condition specificity. This is similar to the criteria used in Differential NicheNet and MultiNicheNet. See the Prioritizing ligands based on expression values vignette for more information.
  • Due to this more generalizable prioritization scheme, we will no longer provide support for Differential NicheNet.
  • We included code for making a ligand-receptor-target circos plot in the Circos plot visualization vignette.
Deprecated vignettes

Differential NicheNet has been deprecated: we will not longer provide support or code fixes on Differential NicheNet and its vignettes. You may want to consider using the general prioritization scheme instead.

In NicheNet v2, the mouse and human ligand-target models are uploaded separately so symbol conversion is not necessary. If you are still using the NicheNet v1 model, you can check the following vignette on how to convert the model (given in human symbols) to mouse symbols:

12-01-2022: In the Liver Atlas paper from Guilliams et al.: Spatial proteogenomics reveals distinct and evolutionarily conserved hepatic macrophage niches, we used Differential NicheNet, an extension to the default NicheNet algorithm. Differential NicheNet can be used to compare cell-cell interactions between different niches and better predict niche-specific ligand-receptor (L-R) pairs. It was used in that paper to predict ligand-receptor pairs specific for the Kupffer cell niche in mouse and human.

The main difference between the classic NicheNet pipeline and the Differential NicheNet pipeline is that Differential NicheNet also uses the differential expression between the conditions/niches of the ligand-receptor pairs for prioritization in addition to the ligand activities. The classic NicheNet pipeline on the contrary uses only ligand acivity for prioritization (and shows differential expression only in visualizations).

So if you have data of multiple conditions or niches, and you want to include differential expression of the ligand-receptor pairs in the prioritization, we recommend you check out Differential NicheNet (update nichenetr to the 1.1.0 version). At the bottom of this page, you can find the links to two vignettes illustrating a Differential NicheNet analysis. We recommend these vignettes if you want to apply Differential NicheNet on your own data. If you want to see the code used for the analyses used in the Guilliams et al. paper, see https://github.com/saeyslab/NicheNet_LiverCellAtlas.

15-10-2019: Bonnardel, T’Jonck et al. used NicheNet to predict upstream niche signals driving Kupffer cell differentiation Stellate Cells, Hepatocytes, and Endothelial Cells Imprint the Kupffer Cell Identity on Monocytes Colonizing the Liver Macrophage Niche.

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

nichenetr's People

Contributors

browaeysrobin avatar csangara avatar gbrsales avatar koetjen avatar molecules avatar zouter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nichenetr's Issues

lack of ligand-receptor pairs like SIRPA->CD47 and CD28->Siglec-10

Dear developers,
Thank you for the awesome tools and very useful ligand-receptor database
I am trying to combine nichenetr model and ligand-receptor coexpression information to develop a new way to predict cell-to-cell interaction by scRNA dataset.
However, I found that two recently reported ligand receptor pairs like SIRPA->CD47 and CD28->Siglec-10 were not included in the nichenet prior model.
See the reference:
https://www.cell.com/trends/immunology/pdf/S1471-4906(17)30244-2.pdf
https://www.nature.com/articles/s41586-019-1456-0
I was wondering is there a plan to further update prior model by corportating much more newly discovered ligand receptor pairs ? And is there a way to build a customized nichenet-like prior model by using my prefered ligand receptor ?

Thank you
Yao He

Stuck with CircosPlot tutorial

Hello there,
I would like to thank you for your work and helpful tool.
However, i'm having an issue with this tutorial : Circos plot visualization to show active ligand-target links between interacting cells. It just does not work for me.

At

chordDiagram(links_circle, directional = 1,order=order,link.sort = TRUE, link.decreasing = FALSE, grid.col = grid_col,transparency = transparency, diffHeight = 0.005, direction.type = c("diffHeight", "arrows"),link.arr.type = "big.arrow", link.visible = links_circle$weight >= cutoff_include_all_ligands,annotationTrack = "grid", preAllocateTracks = list(track.height = 0.075))

I get this, not being able to go any further :

Error in as.vector(x, mode) : cannot coerce type 'closure' to vector of type 'any'

As it is the tutorial, I come to you to find help. How can I fix this, so that I can continue to work on it.

Thanks in advance

TB

Edit : nevermind, it worked I don't know why it would not before.

manually select ligand target pair

Thanks for this excellent tool, I am following the seurat wrapper, I want to know if there is a way to select part of the ligand target to show in heatmap in a simple way?

Thanks!

Is it possible to construct a prior model from mouse data sources?

Thank you for doing the important work of combining so many human data sources into one accurate ligand-target model! Really impressive!

In https://github.com/saeyslab/nichenetr/blob/master/vignettes/symbol_conversion.md you describe that to work with mouse data human gene symbols need to be converted to mouse gene symbols. As the prior model of NicheNet was based mostly on human data sources, does that not decrease accuracy of Nichenet predictions? I noticed that Nichenet was used in this way (i.e. converting human to mouse gene symbols) in the Kupfer cell interaction paper that you mention in the Readme: https://www.cell.com/immunity/fulltext/S1074-7613(19)30368-1#secsectitle0075? I can also appreciate that Nichenets predictions were validated experimentally in this paper. However, I am also wondering whether NicheNets prediction accuracy would increase if a new ligand-target prior model is constructed from mouse data sources only? How difficult would it be to generate such a model, and do you think it will substantially increase Nichenet's prediction accuracy?

extracting expression data from seurat

Thank you for developing this great tool !

I would also like to use Circos plot for my seurat object

and need help on creating my own "expression data of interacting cells"

are there any simple ways to extract this information from Seurat object?

Thank you : )

For an identified ligand, receptors, and target gene pathway, the gene expression for the ligand and receptors are very low

I preface this by mentioning I found NicheNet to work very well overall, but I don't understand why, in my dataset, a specific ligand and some receptors have extremely low expression, despite them being confidently identified. I hope to know whether this is an expected result based on how NicheNet works, and whether there are any potential problems.

My dataset (processed by Seurat) has 7 clusters, numbered 0-6, and I followed the seurat_wrapper vignette to run NicheNet. My dataset has two conditions, A and B (every cell is either one or the other), clusters 1 and 2 have a relatively higher proportion of cells being condition A (the other clusters also have slightly higher proportion of cells being condition A, but to a much lesser degree than clusters 1 and 2), and I set condition_oi as condition A and condition_reference as condition B. I ran nichenet_seuratobj_aggregate for all (7*7 = 49) pairs of sender/receiver (i.e. 0/0, 0/1 .. 6/5, 6/6) being individual clusters, so 49 runs, and summarized the $ligand_target_matrix, $ligand_activities, and $ligand_receptor_matrix outputs in each run into one table for all the runs.

I tried to pick out the more important ligand->receptor(s)->target_gene(s) pathways by looking at the Pearson_correlation_coefficient_target_gene_prediction_ability, Regulatory_potential, and Prior_interaction_potential histograms for all the data, then deciding on some cutoffs to represent "high" values for each of the three criteria (decided at 0.10, 0.003, and 0.5, respectively; the latter two holds the top 5-10 % of the results), and filtering out the results that have any of the three criteria below the cutoff. This resulted in only two pathways, with one of them being particularly interesting.

The particularly interesting pathway consists of ligand X, receptors Y1 and Y2, and target_gene Z. It is interesting because the pathway is very specific, only appearing in cluster 1 as sender and 4 as receiver, even when doing an extra check with all the cutoffs are completely relaxed. Also, the sender being 1 and receiver being 4, as well as the actual identities of the ligand/receptors/target_gene, are all very in line with our understanding of our dataset.

Our only concern is that, when looking at the Seurat violin plots (VlnPlot) of the genes of the ligand/receptors/target_gene in this pathway (attached), the only plot that seems to make sense is target_gene Z (with cluster 1 being very low and 4 being relatively high). For ligand X, in which based on the NicheNet result cluster 1 is the sole sender, the expression of gene X in cluster 1 is very low. For receptors Y1 and Y2, the expression of genes Y1 and Y2 are very low in all clusters.

Based purely on the NicheNet algorithm, does this result make sense at all? For the tool's general application to real data, can ligand X still be considered as a strong ligand?

The NicheNet output indicates ligand X is a bona fide ligand - could this be a reason why it was determined as a ligand despite having very low expression here?

VlnPlots_of_pathway

Negative values in PCC for ligand prediction

This is more a question rather than an issue. I noticed in the vignettes that you use the PCC metric to rank the predicted ligands. Is there a reason why you select positive scores? Negative (but strong) correlations can be informative too.

Guide to Data Preperation

Hello, is there some sort of guide or tutorial for the how the data input has to look like and the meta information which has to be given ? The tutorial file is not much help here as it is an already prepared r object.

Error in installing nichenetr on Mac

Hi,
Thanks for this very interesting tool, I've been playing around with it (version 0.1.0) for several months now with no issues. However I just tried to upgrade my version of Nichenet to access some new functions and I got the same error message as in #42 . I'm running MacOS Catalina v10.15.3. I tried restarting RStudio/starting a new R session and had the same error.

checking for file ‘/private/var/folders/r5/sjlv78ys79nc00gtf7q_dl4s0q66gc/T/RtmpCjNuta/remotes15849674e2f7e/saeyslab-nichenetr-8b2fffc/DESCRIPTION’ ...
─ preparing ‘nichenetr’:
✓ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ looking to see if a ‘data/datalist’ file should be added
─ building ‘nichenetr_1.0.0.tar.gz’ (720ms)
Warning: invalid uid value replaced by that for user 'nobody'
Warning: invalid gid value replaced by that for user 'nobody'

  • installing source package ‘nichenetr’ ...
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    sh: line 1: 88229 Killed: 9 R_TESTS= '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --slave 2>&1 < '/var/folders/r5/sjlv78ys79nc00gtf7q_dl4s0q66gc/T//Rtmpt09Rt1/file1589d6515623'
    ERROR: lazy loading failed for package ‘nichenetr’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/nichenetr’
  • restoring previous ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/nichenetr’
    Error: Failed to install 'nichenetr' from GitHub:
    (converted from warning) installation of package ‘/var/folders/r5/sjlv78ys79nc00gtf7q_dl4s0q66gc/T//RtmpCjNuta/file158493e102e2e/nichenetr_1.0.0.tar.gz’ had non-zero exit status

Opposing directionality of predicted ligand vs. predicted targets

Hi there,
Thanks for a fantastic tool! I'm applying NicheNet via the nichenet_seuratobj_aggregate() wrapper to a dataset with 2 conditions ("Case" and "Control"). The question I want to ask is, in a given cell type (eg. classical monocytes), what ligands from all senders could be explaining the DE genes in the "Case" CD14 Monocytes?

nichenet_out = nichenet_seuratobj_aggregate(
  seurat_obj = seu_combined, 
  receiver = "CD14 Monocyte", 
  condition_colname = "Status", condition_oi = "Case", condition_reference = "Control", 
  sender = "all",
  ligand_target_matrix = ligand_target_matrix, lr_network = lr_network, weighted_networks = weighted_networks, organism = "human")

TGFB1 is predicted as the "top" ligand and is predicted to act through four receptors.
image
image

While all the predicted target genes are upregulated in the Cases vs. Controls, the ligand (TGFB1) and 2/4 receptors are more highly expressed by the Controls.
image

Additionally, there is no cell type in the dataset where TGFB1 is more highly expressed in Cases than Controls. This issue persists when geneset = "up" is specified.

Any thoughts?

Ligand activity score

This is my first time using NicheNet and I am trying to get a feel for what constitutes a good score for ligand activity. For example, in one analysis, I am getting a top Pearson score of around 0.008, while in another analysis around 0.04. Alternatively, should I concentrate on AUROC, and filter for values > 0.50?

Thanks for your advice.

Making a ligand-receptor-target circos plot

Thanks for this great package!

I would like to make a ligand-receptor-target circos plot as described in the "circos" vignette and as seen in "B":
circos plot with summary

I can make both ligand-target and ligand-receptor circos plots, but it's unclear how to overlay the plots. My question is how do you know which target genes are associated with a particular receptor (i.e., align the target genes and receptors for the receiver cell)?

"Not all cells of interest are in your expression matrix"

Hello,

I am trying to run NicheNet on a Seurat sample. This sample is a merge of two datasets, one of which is epithelial cells alone, and the other epithelial cells plus niche cells. I am trying to see changes in the epithelial cells based on the presence of the niche cells.

I am running the function:

nichenet_output = nichenet_seuratobj_aggregate(
seurat_obj = BLC_Niche_Merge,
receiver = c("0", "4", "3"),
condition_colname = "orig.ident", condition_oi = "BLC_Niche", condition_reference = "BLC_Alone",
sender = c("11", "2", "7", "5"),
ligand_target_matrix = ligand_target_matrix, lr_network = lr_network, weighted_networks = weighted_networks, organism = "human")

Where the sender and receiver numbers correspond to Seurat clusters. I've also added a column to the meta data of "celltype" with the corresponding clusters just in case.

When running the function, I am getting the following error:

Error in FUN(X[[i]], ...) :
Not all cells of interest are in your expression matrix. Please check that the expression matrix contains cells in columns and genes in rows.

which seems to pop up after the "[1] "Define expressed ligands and receptors in receiver and sender cells"" part of the function.

Any idea what might be happening?

Thanks!

Pearson correlation Negative

Hi,

I am using NicheNet on some brain dataset and when I use a certain celltype as receiver (ependymal cell), and any other cell type (Neural stem cell, neuroblast) as sender it seems to run everything smoothly.

But if I try to perfrom NicheNet with Ecell as sender and any other cell type as receiver, I get negative value in pearson coorelation.
Further, The following code snipet :
p_ligand_target_network = vis_ligand_target %>% make_heatmap_ggplot("Prioritized ligands","Predicted target genes", color = "purple",legend_position = "top", x_axis_position = "top",legend_title = "Regulatory potential") + theme(axis.text.x = element_text(face = "italic")) + scale_fill_gradient2(low = "whitesmoke", high = "purple", breaks = c(0,0.006,0.012))

from the following vigentte: https://github.com/saeyslab/nichenetr/blob/master/vignettes/seurat_steps.md

stops working giving me this error:
Error in factor(x, levels = colnames(matrix), ordered = TRUE) :
object 'x' not found

Is it because there's no interaction between Ecell and other cell types with Ecell contributing Ligands and other celltypes being receptor?

Thank you

use with R for Mac

Hello, thank you for making this awesome resource. Some people in my lab have started using it and it has yielded some interesting results. I am hoping to start using it too, however, I am a mac user. When i tried to install the Nichenetr package with the code provided i get the following message:

  • installing source package ‘nichenetr’ ...
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    sh: line 1: 47974 Killed: 9 R_TESTS= '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --slave 2>&1 < '/var/folders/hv/19_cb9rx1rjgdvdzn4_lgddr0000gn/T//Rtmp1GRZaJ/filebb5f2e6f4fec'
    ERROR: lazy loading failed for package ‘nichenetr’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/nichenetr’
    Error: Failed to install 'nichenetr' from GitHub:
    (converted from warning) installation of package ‘/var/folders/hv/19_cb9rx1rjgdvdzn4_lgddr0000gn/T//RtmpbMArs0/fileba62197e2745/nichenetr_1.0.0.tar.gz’ had non-zero exit status

is this because nichenetr does not work with mac or might there be something else going on?

Thanks so much

Problem installing nichenetr

Hello,
I've tried to install nichenetr on r version 4.0.2, but it's not available on this version.
Is there an older version to download and install on r version 4.0.2?

Warning messages: when extracting expressed genes for receiver and sender cells from a Seurat V3 Object using (get_expressed_genes)

Thank you for making such great packages,

I started using nichenetr following the seurat set by step vignette (vignette("ligand_activity_geneset", package="nichenetr") when I ran the function (get_expressed_genes) the following message appeared in the console

"Warning messages:
Seurat object is result from the Seurat single-cell transform workflow. Make sure that this way of defining expressed genes is appropriate for SCT data. The expressed genes are defined based on the SCT slot."

Could you help me understand what it is mean and in what way it affects the results?
thanks

PCC of ligand activity 'contradicts'(?) the regulatory potential scores obtained later

Dear,

Thanks for this amazing tool!
I was trying nichenetr. I based myself on a bulk RNA seq dataset to find potential ligands. I wanted to know which could be the target genes of these ligands in our single cell RNA seq data. As expected, Csf1 showed the most correlation score in the ligand activity analysis. And then I visualize it to see the regulatory potential score for different genes by Csf1 and opther ligands, I see that , for Csf1(which showed highest PCC) has low regulatory potential scores for most genes compared to the regulatory potential of other ligands in the list with relatively low pearson correlation coefficient. Is this a bit contradictory? Or am I missing something in terms how I analyze the output? Kindly advise

To sum up,

When I visualize, the regulatory potential scores between ligands and targets do not seem to match well with the PCC obtained in the first step.

Kindly advice,
Thanks in advance!
Saeed

Could not find function "get_expressed_genes"

Hello,

Thanks for the awesome package and the new Seurat tutorials!

I am trying to run the "get expressed genes" function in the Seurat tutorial, but it is saying that the function cannot be found.

I currently have version 0.1 of NicheNetR installed. Is there a newer version I should have?

aligning ligands-receptor-targets

Thank you for the great work !!

I would like to align top ligands and predicted receptors and targets together and would like to know if there is any easy way of doing this !

As mentioned in ligand-receptor-target circos plot, I've managed to generate two separate circos plots for ligand-target and ligand-receptor but wasn't sure how to overlay the two plots in a right alignment - as there is some overlay in targets in my ligand-target circos plots and thus results in mis-alignment to wrong category of receptors on top!

Thanks!

Calculate correlation scores for multiple ligands?

Hi,
This is not a software issue but I am wondering if there is a way to calculate a score for how the target genes of a group of ligands are enriched in a gene set of interest. My understanding from the FAQ is that the Pearson correlation is calculated for each ligand separately. I would ideally like to show that including x number of ligands produces optimal correlation between target genes and my gene set of interest. Does NicheNet have a way to do that?
Thanks!

Evaluation of ligand activies

Hi,
I would like to know if there is a guideline for setting a cutoff for ligands that were defined by the "predict_ligand_activities" function? For example, if I get activities with Pearson correlation coefficients around 0.01 or even negative ones, should those ligands get excluded from the following analysis?

Thanks in advance

Making a cut off for ligand receptor interaction potential

Hi,

Was wondering how is ligand-receptor interaction potential calculated. During the workflow, would itmake sense to create a cut off for ligand-receptor potential to narrow down to fewer ligand-receptor pairs?
Kindly advise.
Saeed

installation failed

Hello,

Thanks for the awesome package!
I am trying to use this:
图片

But then I get this error: Does not appear to be an R package (no DESCRIPTION).

图片
I don't know why it can't be installed.
I currently have version 3.6.1 of R.
Thanks!

Problem with get_expressed_genes()

Hi!
Thanks for your awesome tool!

I tried to get genes expressed by more than 10% of cells by using "get_expressed_genes()". However, I felt this function returns biologically wrong expressed genes, like some macrophage markers being expressed by T cells. I guess this is caused because get_expressed_genes() looks at "SCT" assay which is based on "corrected" count matrix. (I mean some genes are changed from zero to non-zero.)
Maybe I can avoid this problem by using SCTransform() with "do.correct.umi=FALSE", but I want you to change get_expressed_genes() so that we can choose assays to look at in this function. I think this problem will be solved by using "RNA" assay.

Or, alternatively, getting expressed genes based on expression level in "SCT" assay is also great.

This problem leads to wrapper function for SeuratObject because get_expressed_genes() is also included in this wrapper function, maybe.

Thank you!

Sender/Receiver in Progenitor/Differentiated Clusters

Thank you for this wonderful package!

I have single cell data and am working on better understanding the network between a progenitor cluster that gives rise to a more differentiated cluster. I have performed your basic workflow using the progenitor cluster as the receiver and differentiated cluster as sender and vice versa, with differentially expressed genes as the gene set of interest. When I compare the output of these two analyses, I get very similar receptors and prioritized ligands - is this to be expected? Would this be evidence of bidirectional cross talk? Or, instead, should I be limiting my analysis to one direction?

get_expressed_genes function do not look for SCT assay

Hi,

Thank you for this amazing tool.
For those who follows SCTransform workflow with seurat (without integration) SCT assay with scale.data slot is the go to slot for DEG analysis and visualization of gene expression. In this workflow the scale.data slot for RNA assay will be empty. I think ideally this function should also look for scaled.data slot in SCT assay as well (unless it is not suitable because of some reason that I am ignorant about).
There is a caveat though,
In this workflow, the scale.data for SCT assay will only have limited number genes (default = 3000) if scaling is not applied to all genes during seurat workflow(which is the default setting). But 'SCTransform' function allows scaling to be done with all genes if explicitly mentioned (this is enabled in the development branch of seurat, not very sure about the cran version).

Again, Thank you!
Kind regards,
Saeed

inquiry regarding nichenet computing and error running predict_ligand_activities

when nichenet is applied to find regulatory networks between one cluster to the rest of the clusters in seurat object, does it compute cluster to clusters or group of cells to individual group of cells? more specifically - does it take into consideration that the receiver set of cells is composed of different cell types (clusters) or composed of different individual cells?

also, regardless of that, what does the following error mean:

Error in evaluate_target_prediction(setting, ligand_target_matrix, ligands_position) :
all genes have same response

Circos plot for Seurat single cell tutorial?

Hello,

Thanks again for the awesome package, I am finding some really cool things with it!

I was wondering if you were planning on adding a circos plot tutorial for the Seurat single cell vignette? I was trying to follow the current example utilizing my Seurat NicheNetR analysis, but I think I am a little lost on which of the NicheNet outputs to use for the different steps.

I think an example vignette would be super helpful! Thanks again!

Vignette not loading

Hello,
I am able to install the script, but when I try to implement the vignette command I get a message like this

vignette("ligand_activity_geneset", package="nichenetr")
Warning message:
vignette ‘ligand_activity_geneset’ not found

Could you help resolve this issue, I am in the process of learning about this tool and the vignettes provided would be helpful.
Thanks,
GGopisetty

Nichenetr for proteomics data?

Thank you for your package.
My project is on quantitative proteomics analysis in different cell type of a tissue. But I am not sure if this method is also suit for proteomics data set. The biggest problem is if I can use the ligand_target_matrix directly for proteomics data.

Thanks for your help!

Inconsistency in results

Hi,

I am getting slightly different results from different machines. I attached two plots here, namely A and B. At first I suspected it was the OS's problem as one of them is MacBook while the other is Windows, but I tried again on another Windows machine and another MacBook, and they both got the result A.

I am quite confused as these are ran from the same exact script and same Seurat object. The only difference I could think of is that some packages in tidyverse has different versions between the machines. But could this have caused such a big problem? The top ligand in B (Cd6) is missing from A, which is kinda concerning to me. Thanks a lot.

A:
A_ligand_activity_target_heatmap.pdf

B:
B_ligand_activity_target.pdf

Error with conversion of human to mouse IDs

Hi,

I have utilized the convert_human_to_mouse_symbols() function to convert the human IDs, but discovered that there is a mistake in the conversion of one gene - ASIP. The converted mouse ID is "a" instead of "Asip". Currently I have been just manually changing "a" to "Asip".

Thanks!

Input for `prepare_ligand_target_visualization` is not a sparse matrix

Hello,

I am following the steps in the Perform NicheNet analysis starting from a Seurat object: step-by-step analysis vignette to run nichenetr on my Seurat object.

With the exception of this issue which I think I may have solved by deleting the "SCT" and "instegrated" assays, everything runs well until step 5). When I run the command:

active_ligand_target_links = prepare_ligand_target_visualization(ligand_target_df = active_ligand_target_links_df, ligand_target_matrix = ligand_target_matrix, cutoff = 0.33)

I get this error:

Error in proxy(x, y, margin, method, p = p, drop0 = drop0, digits = digits) : 
  x must be a sparseMatrix

I looked into the prepare_ligand_target_visualization code and I narrowed the error to this part:

distoi = dist(1 - cor(t(ligand_target_vis_filtered)))

The dist function from the proxyC package requires the input matrix to be sparse. The dimensions of ligand_target_vis_filtered are 104 rows by 19 columns, which makes 1,976 cells. Of these, 1,437 (~72%) are zeros - I wonder if this is proportion is considered to be too low for a sparse matrix or if the error arises because another feature of the matrix.

Could you please help with this?

Thank you in advance!

No background genes

Hi,

I am trying to assess if the ligands of one type of cell (A) have an influence on the complete transcriptional program (both expression and inhibition of genes) of another cell type (B). Therefore, from what I understand, for this analysis, I wouldn't have a background genes set. Is it still possible to run NicheNet?

Thank you

Error when running Nichenet on spatial Seurat object

Hi,

I'm trying to run Nichenet on a Seurat object composed of 10X spatial transcriptomic (not single cell) data - similar to https://satijalab.org/seurat/v3.1/spatial_vignette.html. When I try to run get_expressed_genes on my spatial Seurat object I get the following error:

Error in get_expressed_genes: trying to get slot "data" from an object of a basic class ("NULL") with no slots

My Spatial seurat object has two slots, "Spatial" and "SCT". I think the "Spatial" slot replaced the "RNA" slot that is found in single-cell Seurat objects, and this may be the reason for the error as the function is looking for data in the non-existent "RNA" slot? Any advice?

Thank you!

Extract target genes other than the top 20 ligands

Hi,
I am using NicheNet for a single-cell RNA-seq dataset.

Based on the FAQ, the ligands with Pearson score > 0.1 might be interesting. So I applied 0.1 as cut off and overlap these ligands with the output from CellPhoneDB.

Now I want to pull out the targets information of a few overlapped ligands from NicheNet output, although not ranked as top 20.

I used the command as follows:

LigandList=c(a,b,c,d)

active_ligand_target_links_df = LigandList %>% lapply(get_weighted_ligand_target_links,geneset = geneset_oi, ligand_target_matrix = ligand_target_matrix, n = 200) %>% bind_rows() %>% drop_na()

Then I noticed the weight for the same target genes keeps changing with the number of Ligands of interest I put here.

For example: the weight of Foxo3 genes would be 0 and 0 for ligand a, b respectively, if my LigandList= c(a,b,c,d).
but the weight of Foxo3 genes would be 0.004 and 0.001 for ligand a, b respectively, if my LigandList= c(a,b).

It seems the weight is calculated in a relative way?

Could you let me know which would be the correct way to extract the target information?

Thanks!
Yang

Install error

I am wondering if could tell me how to solve this installation problem shown below. Thanks!

error: Failed to install 'nichenetr' from GitHub:
(warnings) cannot remove prior installation of package ‘reshape2’

And I also could not remove this package by remove.packages()

remove.packages("reshape2")
Removing package from ‘C:/Users/Lin/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Error in find.package(pkgs, lib) : there is no package called ‘reshape2’

Opposite analysis

Hi

Im interested in doing a NicheNet analysis with only one sender cell type and multiple receivers, instead of the examples you have displayed on the website.

Any recommendations?

get_expressed_genes() with Integration Workflow

I'm getting the following error when using get_expressed_genes() on a receiver Seurat object that was created using the integration assay:

Seurat object is result from the Seurat integration workflow. Make sure that this way of defining expressed genes is appropriate for your integrated data. The expressed genes are defined based on the integrated slot.

This error comes after I set the default assay to "RNA", which the Seurat team has indicated should be used for analyzing gene expression data (FAQ 4 here: https://satijalab.org/seurat/faq). Should I instead be using the "integrated" assay as the default for NicheNet?

Thanks!

Analysis for mouse (mm10) data

Thank you for your great package and manuals.
I wonder when I apply it to the mouse data, should I download the network source of mouse and reconstruct the model or can I just transfer the gene name from human to mouse.
Thank you in advance!

Cannot use `expressed_genes_receiver` with `assay_oi = 'SCT'`

I am trying to run nichenetr on a Seurat object resulting from the Seurat integration workflow. When I first try to determine which genes are expressed with:

expressed_genes_receiver = get_expressed_genes(receiver, seuratObj, pct = 0.10)

I get this warning:

Seurat object is result from the Seurat integration workflow. Make sure that this way of defining expressed genes is appropriate for your integrated data. The expressed genes are defined based on the integrated slot

My reasoning was then to use the SCT assay instead with:

expressed_genes_receiver = get_expressed_genes(receiver, seuratObj, pct = 0.10, assay_oi = 'SCT')

But then I get this error:

Error in match(x, table, nomatch = 0L) : 
  'match' requires vector arguments

I looked into the get_expressed_genes code and I narrowed the error to this part:

    if (!is.null(assay_oi)) {
        if (!assay_oi %in% Assays(seurat_obj)) {
            stop("assay_oi should be an assay of your Seurat object")
        }
    }

!assay_oi %in% Assays(seurat_obj) cannot be assessed because, I understand, a vector is expected but the output of Assays(seurat_obj) is a list.

My first question is whether my reasoning of forcing the use of the SCT assay is correct.

My second question is if you could please help in overcoming the issue here reported.

Thank you in advance!

Javier

cannot download data from zenodo

I am trying to follow the main vignette "NicheNet’s ligand activity analysis on a gene set of interest", but the first instruction fails with the following error:

ligand_target_matrix = readRDS(url("https://zenodo.org/record/3260758/files/ligand_target_matrix.rds"))
Error in readRDS(url("https://zenodo.org/record/3260758/files/ligand_target_matrix.rds")) :
cannot open the connection to 'https://zenodo.org/record/3260758/files/ligand_target_matrix.rds'
In addition: Warning message:
In readRDS(url("https://zenodo.org/record/3260758/files/ligand_target_matrix.rds")) :
cannot open URL 'https://zenodo.org/record/3260758/files/ligand_target_matrix.rds': HTTP status was '500 Internal Server Error')

How to deal with inter-tumor heterogeneity

Hi, first thanks for developing such a awesome tool! I want to use Nichnetr to analyze my scRNA data from liver cancer, and I'm following the HNSCC guide.
In their initial paper, there is significant inter-patient heterogeneity (or to say, batch effect) in the malignant cells, but in this tutorial it does not take this into consideration. It only requires a gene is "expressed", but ignores which patient it comes from. So after the estimation of ligand activity (without considering the patient origin of cells), it's likely that a CAF ligand with "high activity" is expressed in patient 01, 03, but the p-EMT genes are mostly expressed in patient 02, 04. And such result could be misleading because interaction cannot cross different patients.
I wonder if there is some step I wrongly understand, if not, do you have some advice on dealing with such situation (inter-tumor or inter patient heterogeneity)? Any suggestion will be appreciated.

Thanks!
Yang

Receptors of ligand-to-target signaling paths

Dear authors,
Thanks for this wonderful package!
I'm confused about the receptors of ligand-to-target signaling paths. There are some receptors existed in the inferred ligand-to-target signaling paths, and the ligand is sometimes directed targeted the target genes without receptor. Is it due to biological regulation or technical limitation that couldn't predicted the receptors between the liagand and its target genes?
Thank you so much!

weighted_networks$lr_sig missing

Hi,

Thanks for developing this great package.

I am trying to use it to interrogate my Seurat object using nichenet_seuratobj_aggregate(). Unfortunately, I run into trouble when I try to use the weighted_network object. I cannot download it using the provided link, as a matter of fact none of the objects can be downloaded using the zenodo server.

> weighted_networks = readRDS(url("https://zenodo.org/record/3260758/files/weighted_networks.rds"))
Error in readRDS(url("https://zenodo.org/record/3260758/files/weighted_networks.rds")) : 
  cannot open the connection
In addition: Warning message:
In readRDS(url("https://zenodo.org/record/3260758/files/weighted_networks.rds")) :
  InternetOpenUrl failed: 'The operation timed out'

I can download the files using my browser but then the weighted_networks is missing the weighted_networks$lr_sig column. Do you have any suggestions?

> weighted_networks_lr = weighted_networks$lr_sig %>% inner_join(lr_network %>% distinct(from,to), by = c("from","to"))
Error in UseMethod("inner_join") : 
  no applicable method for 'inner_join' applied to an object of class "NULL"
In addition: Warning message:
Unknown or uninitialised column: `lr_sig`. 

Problem with large datasets?

Hi there, first: thank you for this awesome package! I really think this is a tool that allows for potentially much more meaningful interpretation of single cell data.

I am running into an issue with larger data sets though. When I follow the vignette starting from a Seurat object, all would be working fine as long as I keep the cell number below 50-60k cells. When running anything above 90k cells (my full dataset would be more than 150k cells), the "get_expressed_genes" command for the receiver runs into the following issue:

expressed_genes_receiver = get_expressed_genes(receiver, Nichenet.CD3, pct = 0.10)
Error in asMethod(object) :
Cholmod error 'problem too large' at file ../Core/cholmod_dense.c, line 105

I have googled the error, and it seems to be a very generic error message, so I do not really know how I could fix that. Thank you in advance for any help!

PS: I am running on an iMac Pro, Xeon W 3.2Ghz, 64GB RAM, MacOS 10.14.6, R 3.6.2.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.