jinworks / CellChat

R toolkit for inference, visualization and analysis of cell-cell communication from single-cell and spatially resolved transcriptomics
GNU General Public License v3.0
195 stars 21 forks source link

netP is empty #125

Closed guoxiaofa closed 2 months ago

guoxiaofa commented 2 months ago

Hi Suoqin Jin, Thank you for developing such wonderful tools. While following the protocol for CellChat version v2.1, I encountered an issue where cellchat@netP appears to be empty. This has led to errors when executing the code: cellchat <- netAnalysis_computeCentrality(cellchat, slot.name = "net") netAnalysis_signalingRole_network(cellchat, signaling = pathways.show, width = 8, height = 2.5, font.size = 10) The error is

_Error in netAnalysis_signalingRole_network(cellchat, signaling = pathways.show, :

Please run netAnalysis_computeCentrality to compute the network centrality scores!_

the code I generate cellchat object are: cellchat <- CellChat::subsetData(cellchat) # This step is necessary even if using the whole database future::plan("multisession", workers = nmultiprocess) # do parallel cat( "Identify over-expressed ligands or receptors in one cell group ... \nThis step may run for a long time ..." ) cellchat <- CellChat::identifyOverExpressedGenes(cellchat) cellchat <- CellChat::identifyOverExpressedInteractions(cellchat) cellchat <- CellChat::computeCommunProb(cellchat,raw.use = TRUE) cellchat <- CellChat::aggregateNet(cellchat) saveRDS(cellchat,file.path(out_dir,paste(out_file_prefix,"cellchat_obj.rds",sep="")))

Nessetti commented 3 weeks ago

Hi! I'm having the same error, what did you do to resolve this?

guoxiaofa commented 3 weeks ago

Hi! I'm having the same error, what did you do to resolve this?

Firstly, you should run the computeCommunProbPathway function, which is different from the computeCommunProb function.