Open mboisvert1 opened 5 months ago
@mboisvert1 This is possible. But you use the function in a wrong way. You can leave 'group' as empty or define it as a vector with the length 5.
I have a similar problem, the compareInteractions() function works fine, but when I use the rankNet() function to compare a cellchat object containing 8 datasets, something different occurs as described below:
gg1 <- rankNet(cellchat,slot.name = "netP",tol = 0.5,
comparison = c(1,3),
mode = "comparison", stacked = T,
thresh = 0.05,
measure = "weight",
return.data = F,
do.flip = F)
=====> run successfully
gg1 <- rankNet(cellchat,slot.name = "netP",tol = 0.5,
comparison = c(1,5),
mode = "comparison", stacked = T,
thresh = 0.05,
measure = "weight",
return.data = F,
do.flip = F)
=====> run successfully
gg1 <- rankNet(cellchat,slot.name = "netP",tol = 0.5,
comparison = c(2,8),
mode = "comparison", stacked = T,
thresh = 0.05,
measure = "weight",
return.data = F,
do.flip = F)
=====> Error in prob.values[, j] <- as.vector(prob.list[[j]][, , pair.name.all[i]]) :
number of items to replace is not a multiple of replacement length
gg1 <- rankNet(cellchat,slot.name = "netP",tol = 0.5,
comparison = c(4,8),
mode = "comparison", stacked = T,
thresh = 0.05,
measure = "weight",
return.data = F,
do.flip = F)
=====> Error in prob.values[, j] <- as.vector(prob.list[[j]][, , pair.name.all[i]]) :
number of items to replace is not a multiple of replacement length
In short, it means that rankNet does not run successfully when the COMPARISON involves 8, but this cellchat object does contain 8 subsets plus a JOINT set
length(cellchat@idents) [1] 9
Is there a solution to this issue? I am getting the same error as @superjmiscool for the same function. I'm using CellChat version 2.1.2
Hi,
I am trying to compare signaling interactions between a group of 5 datasets sharing the same cell types.
I've read in the cell chat objects for each dataset and have merged them using mergeCellChat.
When I run: gg1 <- compareInteractions(cellchat, show.legend = F, group = c(1,4)) gg2 <- compareInteractions(cellchat, show.legend = F, group = c(1,4), measure = "weight") gg1 + gg2
I get the following error: Error in
$<-.data.frame
(*tmp*
, "group", value = c(1, 2)) : replacement has 2 rows, data has 5Is it possible to run the comparative analysis using more than 2 datasets?
Thank you