jinworks / CellChat

R toolkit for inference, visualization and analysis of cell-cell communication from single-cell and spatially resolved transcriptomics
GNU General Public License v3.0
209 stars 26 forks source link

Impact of Subsetting Order on CellChat Analysis #146

Open amberqiong opened 2 months ago

amberqiong commented 2 months ago

Hello,

Thank you for creating such a valuable tool. I have a question regarding the order of subsetting in my analysis. I'm working with 10 different cell types, but I'm only interested in analyzing 4 of them. Should I subset the data first, selecting only the 4 cell types of interest from the Seurat object, and then perform CellChat? Or should I run CellChat on all 10 cell types and then subset the results later? I've noticed some differences in the results. For instance, the left panel shows the analysis with only 4 cell types included in CellChat, while the right panel includes all 10 cell types but analyzes only 4. Which approach is more commonly used?

`gg1 <- rankNet(lipo.cellchat.all, mode = "comparison", measure = "weight", sources.use = c("alpha","beta","delta","pp"), targets.use = c("alpha","beta","delta","pp"), stacked = T, do.stat = TRUE)

gg2 <- rankNet(lipo.cellchat.endocrine, mode = "comparison", measure = "weight", sources.use = c("alpha","beta","delta","pp"), targets.use = c("alpha","beta","delta","pp"), stacked = T, do.stat = TRUE)

gg1+gg2`

togithub.pdf

tmontserrat commented 5 days ago

I have exactly the same question. I've found this old answer: https://github.com/sqjin/CellChat/issues/425#issuecomment-1141245533