sqjin/CellChat

comparing dataset error in netAnalysis_signalingChanges_scatter

Leob44 opened this issue · 1 comments

Leob44 commented

Hello,
I am following the comparing dataset vignette on cellchat v2. When I try to apply the function netAnalysis_signalingChanges_scatter I have an error "$<-.data.frame(tmp`, "specificity", value = 0) : replacement has 1 rows, data has 0"

Here is the command I used:

g1 <- netAnalysis_signalingChanges_scatter(cellchat, idents.use = "NK")

I have only two conditions in my merged cellchat object as in the tutorial and "NK" is indeed present in the cellchat@idents$joint

Leob44 commented

I had to go inside the function code. In line 73 of the function, there is:
mat1 <- mat[rownames(mat) %in% signaling, , drop = FALSE]
The rownames of "mat" are not fitting the "signaling" function
print(signaling)
Capture d’écran du 2023-12-04 15-18-44
print(rownames(mat)
Capture d’écran du 2023-12-04 15-20-34

All of this is resulting into an empty intermediate matrix and thus the function can not go further. Still investigating