Open BatLaB-cell opened 3 years ago
@BatLaB-cell This is unexpected. Yes, you need to run netAnalysis_computeCentrality code for each cell chat objects I merged before merging.
Can you run the source codes to examine the reason for such error? Please check the 'Help' section in the README file in this github.
@sqjin how can I run the source codes?
I have similar problem for 2 samples. Where can I find the source codes?
I tried to change the color for each cell type by color.use
and the color has been changed but is not consistent with cell type. How can I make it? Thanks.
I tried to change the color for each cell type by
color.use
and the color has been changed but is not consistent with cell type. How can I make it? Thanks.
I have settled this question when I scanned your source code of netAnalysis_signalingRole_scatter
function. It needs to add a line to revise the type of labels
variate (from chr
to factor
). When I added this line, it works. df$labels = factor(df$labels,levels = levels(object@idents))
.
@snow55 Thank you for providing the solution. I am wondering whether you see the line df$labels <- factor(df$labels, levels = names(incoming.cells))
in your code. I have it in my local computer.
Dear cell chat users,
after using mergeCellChat encompassing different cellchat objects (C1,C2,C3,C4), I successfully run the downstream analysis with netVisual_diffInteraction for instance.
My issue arrives when I run the following codes:
num.link <- sapply(object.list, function(x) {rowSums(x@net$count) + colSums(x@net$count)-diag(x@net$count)}) weight.MinMax <- c(min(num.link), max(num.link)) # control the dot size in the different datasets gg <- list() for (i in 1:length(object.list)) { gg[[i]] <- netAnalysis_signalingRole_scatter(object.list[[i]], title = names(object.list)[i], weight.MinMax = weight.MinMax) }
I get the following error:
Error in netAnalysis_signalingRole_scatter(object.list[[i]], title = names(object.list)[i], : Please run
netAnalysis_computeCentrality
to compute the network centrality scores!I can't see this line in the tutorial for multiple dataset analysis.
Does it mean I need to run this
netAnalysis_computeCentrality
code for each cell chat objects I merged before merging?If yes, I tried to run individually
cellchat.C1 <- netAnalysis_computeCentrality(cellchat.C1, slot.name = "netP")
but it ended with the following error:
Error in if (nrow(adjmatrix) != ncol(adjmatrix)) { : argument is of length zero.
Could you help me please?
Thank you