①
gg1 <- netVisual_heatmap(cellchat)
#> Do heatmap based on a merged object
gg2 <- netVisual_heatmap(cellchat, measure = "weight")
#> Do heatmap based on a merged object
gg1 + gg2
#Error in grid.Call.graphics(C_downvppath, name$path, name$name, strict): Viewport 'Relative values_heatmap_body_1_1' was not found
分開跑后發(fā)現(xiàn)是gg1 + gg2出問題
存成pdf即可解決
②
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)
}
#> Signaling role analysis on the aggregated cell-cell communication network from all signaling pathways
#> Signaling role analysis on the aggregated cell-cell communication network from all signaling pathways
patchwork::wrap_plots(plots = gg)
#Error in netAnalysis_signalingRole_scatter(object.list[[i]], title = names(object.list)[i], : Please run `netAnalysis_computeCentrality` to compute the network centrality scores!
這個就比較明顯,netAnalysis_computeCentrality一下就行,需要兩個cellchat對象分開跑然后merge,不然報錯
cellchat.NL <- netAnalysis_computeCentrality(cellchat.NL, slot.name = "netP")
cellchat.LS <- netAnalysis_computeCentrality(cellchat.LS, slot.name = "netP")
object.list <- list(NL = cellchat.NL, LS = cellchat.LS)
cellchat <- mergeCellChat(object.list, add.names = names(object.list))
③
par(mfrow = c(1,2), xpd=TRUE)
netVisual_diffInteraction(cellchat, weight.scale = T)
netVisual_diffInteraction(cellchat, weight.scale = T, measure = "weight")
#Error in i set edge attr(x, attr(value, "name"), index = value, value = attr(value, : Length of new attribute value must be 1 or 25.the number of target edges, not 22
翻了下網(wǎng)上應(yīng)該是igraph包version的問題,換個鏡像解決了