saeyslab / multinichenetr

MultiNicheNet: a flexible framework for differential cell-cell communication analysis from multi-sample multi-condition single-cell transcriptomics data
GNU General Public License v3.0
117 stars 14 forks source link

contrast table for 4 groups #25

Closed lw157 closed 1 year ago

lw157 commented 1 year ago

Hi, I would like to make a contrast table for 4 groups, A, B, C, D. But I have trouble for the "group" in contrast_tbl.

contrasts_oi = c("'(C-D)-(A+B)','(C-A)+(D-B)'")
contrast_tbl = tibble(contrast =  c("(C-D)-(A+B)","(C-A)+(D-B)"),  group = c("C","C2"))

From the tutorial, the group must be chosen from A, B, C, D. Here I set group "C" for "(C-D)-(A+B)", but for (C-A)+(D-B), what should I set as C2 is not from ABCD.

Liuyang

browaeysrobin commented 1 year ago

Hi @lw157

For the moment, I recommend running this in two separate analyses (so one analysis per contrast, each with "C" as group name).

lw157 commented 1 year ago

Hi @lw157

For the moment, I recommend running this in two separate analyses (so one analysis per contrast, each with "C" as group name).

Thanks a lot, Robin. I will run them separately with same group name.

Just one more question. I found the results (LR pairs) of "dividing by group number" is different from NOT dividing. In this case, should I divide by 4? e.g. ((C-D)-(A-B))/4 (or (C-D)/2-(A-B)/2? ), or just go with (C-D)-(A-B) ?

From multinichenetr tutorials, there is no dividing for the anti-PD1 case, but from limma manual, it seems they suggest to use "divide by group #" (page 47 from https://www.bioconductor.org/packages/release/bioc/vignettes/limma/inst/doc/usersguide.pdf ).

Thanks again.

All best, Liuyang

browaeysrobin commented 1 year ago

Hi @lw157

In the MultiNicheNet code of writing out your contrasts, we use the way described in 9.5.2 (without dividing when comparing equivalent groups), and not the way described in 9.5.4.

lw157 commented 1 year ago

Thanks a lot, Robin. This is really helpful. I will close this post.