Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Differential number of interactions or interaction strength among different cell types Issue #697

Open
monikaramos opened this issue Sep 19, 2023 · 0 comments

Comments

@monikaramos
Copy link

Hi there!

amazing package, thank you so much for developing this cell-cell communication tool.

I am trying to recreate this plot from the cell-cell comparison vignette where selected cell types are shown for differences in cell communication as measured by number of interactions or interaction strength across conditions:
image

However, in my data, when I do the following suggest code, all of the resultant interaction strengths are 0.0 no matter the cell types I subset to. Is this accurate? I ensured I am calculating the weight in the cellchat object before plotting.

Below is my code. Any help is greatly appreciated, thank you in advance!

group.cellType <- c("B_Cells","Tumor","Tumor_EMT")
group.cellType <- factor(group.cellType, levels = c("B_Cells","Tumor","Tumor_EMT"))
object.list <- lapply(object.list, function(x) {mergeInteractions(x, group.cellType)})
weight.max <- getMaxWeight(object.list, slot.name = c("idents", "net", "net"), attribute = c("idents","count", "count.merged"))
par(mfrow = c(1,2), xpd=TRUE)
for (i in 1:length(object.list)) {

  • netVisual_circle(object.list[[i]]@net$count.merged, weight.scale = T, label.edge= T, edge.weight.max = weight.max[3], edge.width.max = 12, title.name = paste0("Number of interactions - ", names(object.list)[i]))
  • }

cellchat <- mergeCellChat(object.list, add.names = names(object.list))
Merge the following slots: 'data.signaling','images','net', 'netP','meta', 'idents', 'var.features' , 'DB', and 'LR'.
par(mfrow = c(1,2), xpd=TRUE)
netVisual_diffInteraction(cellchat, weight.scale = T, measure = "count.merged", label.edge = T)
netVisual_diffInteraction(cellchat, weight.scale = T, measure = "weight.merged", label.edge = T)

image
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant