saeyslab / nichenetr

NicheNet: predict active ligand-target links between interacting cells
452 stars 113 forks source link

How to use this with Bulk RNA seq data from two different cell types? #189

Closed BhavanaNayer closed 5 months ago

BhavanaNayer commented 1 year ago

Hi, Thank you for this wonderful tool. I have tried to explore this a bit with single cell data from tissues that contain multiple cell types, but now I am interested in analysing two separate bulk RNA sequencing datasets we have: (1) bulk RNA seq of a purified sorted population of T cells, and (2) bulk RNA seq of a purified sorted population of macrophages. I want to understand if there are ligands expressed by these T cells that can act on macrophage receptors, and then potentially show them in a Circos plot. So the sender cell type is my T cell dataset, and the receiver cell type is the macrophage dataset. Each of these individual T cell and macrophage datasets can be used to obtain differentially expressed genes between a steady state and a treated condition. So I have the DEGs in T cells upon treatment compared to untreated, and then DEGs in macrophages upon a related treatment, compared to untreated. Now I want to know whether the ligand gene expression in the T cells upon treatment, can be matched with receptor gene expression in the macrophages upon the related treatment. Is it possible to set this up with NicheNet? I have only started doing Bioinformatics analysis a few months ago and I'm still learning slowly so any guidance on how to use this tool for this particular scenario would be extremely helpful. Thank you so much in advance!

LuShuYangMing commented 1 year ago

I have the similar problem on the bulk RNA seq data. I transformed these data by Seurat package, and get results by using self rewrited function nichenet_seuratobj_aggregate (to use DESeq2 for DEG analysis). But if I have lots of groups, such as Macrophage->T (A vs B, C vs D ...), I want to see those L-R difference in those groups (A vs B, C vs D ...). All those ligand-receptor tables are the same, but the ligand-target are totally different. How to explain this? Thank you very much for your reply!

csangara commented 1 year ago

@BhavanaNayer Hi, thanks for your interest in our tool, and sorry for the late reply.

NicheNet can be used for this type of data, but I don't know if it's the most appropriate tool if you are just want to match ligand expression and receptor expression together.

NicheNet would ideally be used in case the change in macrophages after treatment was caused by cell-cell communication with T cells. If that is the case, you can use the DEGs of macrophages before and after treatment as your gene set of interest. Then, you can follow the workflow of the seurat_steps vignette and adapt it for bulk data. For example, to filter for expressed genes, instead of using our get_expressed_genes function, you can use the filterByExpr function from edgeR (you might have to adapt some of the parameters if too many genes are filtered out). From that you should be able to get your potential ligands and background expressed genes.

Hope this helps!

csangara commented 1 year ago

@LuShuYangMing The ligand-target tables only contain genes that are in your gene set of interest, so if your DE genes are different between A vs B and C vs D, these resulting targets in the dataframe will also be different. The ligand-receptor tables are will be the same across groups if you if you calculated the expressed ligands and receptors on the entire dataset. Did you try subsetting the data to only contain cells from a certain group when getting the ligands and receptors?

SergioRodLla commented 11 months ago

Hello, I'm trying to follow the vignette seurat_steps_prioritization.md using two bulk RNA-seq datasets of sorted cells like BhavanaNayer indicates in the first post. I was wondering if in the case I want to use DEGs as my genes of interest to prioritize ligand-receptor pairs, could I do it by adapting the steps in this vignette or should I just follow the steps of the basic one (seurat_steps.md) by just setting the expressed genes in the sender and receiver cell as my DEGs? Thank you in advance!

csangara commented 9 months ago

Hi @SergioRodLla, The beginning steps of both vignettes are actually the same, the prioritization vignettes just contain a few extra steps at the end. I think starting off with the seurat_steps.md vignette is a good idea, but I don't really understand what you mean by setting the expressed genes as your DEGs. Which step are you referring to?

SergioRodLla commented 9 months ago

Hi @csangara, Thanks for the reply. I meant that at step 2 of the seurat_steps.md vignette I am using the DEGs from my bulk RNA-seq experiment as geneset_oi, doing like this to get the gene IDs that are included in the ligand_target_matrix.

geneset_oi <- bulk-rna_DEGs_reciever_diet1VSdiet2.df %>% # select condition of interest
  filter(geneID %in% rownames(ligand_target_matrix)) %>%
  pull(geneID)

bulk-rna_DEGs_reciever_diet1VSdiet2.df is a dataframe that contains the DEGs in the potentially receiver cell-type in my condition of interest (2 types of diet) that I want to test for interactions with another cell-type that I set previously as sender. I hope this helps, Sergio

csangara commented 8 months ago

Yes, that makes sense.