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
304 stars 52 forks source link

Tutorial update - multiple datasets with different cell type compositions #22

Open mcrewcow opened 1 year ago

mcrewcow commented 1 year ago

Hi Suoqin,

Recently I have been working with the datasets where it is not the case you describe in the tutorial: I have unique population in both the conditions studied.

Here is the example:

table(FDs$cell.type, FDs$stage)

          FD125 FD59

AC/HC 949 267 Amacrine 138 0 Bipolar 361 0 Glia 620 0 Horizontal 359 0 Müller glia 222 0 PR 2953 0 Progenitors 2166 551 RGC 534 1116 T1A 0 438 T1B 0 284

So currently the tutorial does not cover this part.

What I did in that case was:

cellchat_FD125 <- liftCellChat(cellchat_FD125, c('AC/HC','Amacrine','Bipolar',
                                                 'Glia','Horizontal','Müller glia','PR',
                                                 'Progenitors','RGC','T1A','T1B'))
cellchat_FD59 <- liftCellChat(cellchat_FD59, c('AC/HC','Amacrine','Bipolar',
                                                 'Glia','Horizontal','Müller glia','PR',
                                                 'Progenitors','RGC','T1A','T1B'))
object.list <- list(FD59 = cellchat_FD59, FD125 = cellchat_FD125)
cellchat <- mergeCellChat(object.list, add.names = names(object.list), cell.prefix = TRUE)

So I simply combined both annotation from the conditions. I bet it will make this opportunity clear if you could update the tutorial on the unique cell types part.

Thanks!

sqjin commented 12 months ago

@mcrewcow Thanks for the suggestion. Will update the tutorial.