CellChat icon indicating copy to clipboard operation
CellChat copied to clipboard

ERROR: netAnalysis_signalingChanges_scatter Error in outgoing[, i] <- centr[[i]][[x.measure]] :

Open FanZhang9 opened this issue 2 years ago • 8 comments

ERROR with the netAnalysis_signalingChanges_scatter

netAnalysis_signalingChanges_scatter(cellchat, idents.use = "Conventional_dendritic")

Merge the following slots: 'data.signaling','net', 'netP','meta', 'idents', 'var.features' , 'DB', and 'LR'. Visualizing differential outgoing and incoming signaling changes from CTL to SP Error in outgoing[, i] <- centr[[i]][[x.measure]] : number of items to replace is not a multiple of replacement length

This is my cellchat object I am trying to compare ; cellchat_mer.rdata.gz

FanZhang9 avatar Sep 13 '22 03:09 FanZhang9

I have fixed this problem by selecting the mutual cell type on 2 data set from the beginning. It taken me 1 day to figure it out.

FanZhang9 avatar Sep 13 '22 08:09 FanZhang9

I got a error when using netAnalysis_signalingChanges_scatter function. After checking my cellchat obj, I found cellchat@netP$centr is null. Actually, my cellchat is a merged cellchat list from chbm and chlm.

names(chlm@netP$centr[[1]]) [1] "outdeg_unweighted" "indeg_unweighted" "outdeg"
[4] "indeg" "hub" "authority"
[7] "eigen" "page_rank" "betweenness"
[10] "flowbet" "info"
names(chbm@netP$centr[[1]]) [1] "outdeg_unweighted" "indeg_unweighted" "outdeg"
[4] "indeg" "hub" "authority"
[7] "eigen" "page_rank" "betweenness"
[10] "flowbet" "info"

Here is my codes to merge cellchat obj. cellchat <- chbm cellchat <- aggregateNet(cellchat) cellchat <- netAnalysis_computeCentrality(cellchat, slot.name = "netP") chbm <- cellchat

cellchat <- chlm cellchat <- aggregateNet(cellchat) cellchat <- netAnalysis_computeCentrality(cellchat, slot.name = "netP") chlm <- cellchat

chbm <- updateCellChat(chbm) chlm <- updateCellChat(chlm) #merge obj. object.list <- list(BM = chbm, LM = chlm) cellchat <- mergeCellChat(object.list, add.names = names(object.list)) After runnning the code, I got the info: Merge the following slots: 'data.signaling','images','net', 'netP','meta', 'idents', 'var.features' , 'DB', and 'LR'.

Hope your help. Any suggestions will be appreciated.

shanshenbing avatar Dec 19 '22 02:12 shanshenbing

This is because your might have cell populations (clusters) that are not shared among both conditions. I had the same, and kept having the same error. If you take them out, the analysis runs smooth.

htejedam avatar Jun 06 '23 12:06 htejedam

Thank you for your advice.

shanshenbing avatar Jun 07 '23 13:06 shanshenbing

You can also lift up the cell identity to be the same (i.e., the union of the cell identities across two condtions)

On Wed, Jun 7, 2023 at 9:08 PM shanshenbing @.***> wrote:

Thank you for your advice.

— Reply to this email directly, view it on GitHub https://github.com/sqjin/CellChat/issues/479#issuecomment-1580781854, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHXF63CF4VSQRRGVPFIIWVTXKB4MXANCNFSM6AAAAAAQLARLAE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

sqjin avatar Jun 08 '23 13:06 sqjin

I believe that does not work, at least not will cellchat. I had the same identity active across all my samples, but if there's samples that contain 0 cells in one of the clusters from that identity, it won't run.

htejedam avatar Jun 08 '23 13:06 htejedam

Hi, I have 4 cellchat object merged together, two objects have 4 cellgroups less than the other two objects. I used liftcellchat function to lift up the cell idents the same among all the 4 cellchat objects. But still I got the error when running netAnalysis_signalingChanges_scatter function. The error is : Error in outgoing[, i] <- centr[[i]][[x.measure]] : number of items to replace is not a multiple of replacement length

Any solution for the issue? Thank you Ting

tingxie2020 avatar Jul 06 '23 22:07 tingxie2020

I got the same problem, and I've tried all the solutions above. Still the error exists.

Chenxinnnnn avatar Oct 19 '23 02:10 Chenxinnnnn