sqjin / CellChat

R toolkit for inference, visualization and analysis of cell-cell communication from single-cell data
GNU General Public License v3.0
636 stars 145 forks source link

Error when using netVisual_embeddingZoomIn with merged object #286

Open ccruizm opened 3 years ago

ccruizm commented 3 years ago

Good day!

I am having problems magnifying the view of each pathway group using netVisual_embeddingZoomIn. When running netVisual_embeddingZoomIn(cellchat, type = "structural") i get the error below:

Error in base::colSums(x, na.rm = na.rm, dims = dims, ...): 'x' must be an array of at least two dimensions
Traceback:

1. netVisual_embeddingZoomIn(cellchat, type = "structural")
2. which(colSums(similarity) == 1)
3. colSums(similarity)
4. colSums(similarity)
5. base::colSums(x, na.rm = na.rm, dims = dims, ...)
6. stop("'x' must be an array of at least two dimensions")

I can visualize the clustered pathways using netVisual_embeddingPairwise. Do not understand why I am having that error.

Thanks in advance!

sqjin commented 3 years ago

@ccruizm Can you try to run the source codes of netVisual_embeddingZoomIn to figure out the reason. I have no idea except that I can replicate your error.

LipingChen0607 commented 2 years ago

I also have this error. Could you give me some advice to solve it? Thanks a lot!

sqjin commented 2 years ago

@LipingChen0607 Do you have this issue when running the example data? If not, there may be a bug of this code and I can check it if you share me your cellchat object.

eliascrapa commented 1 year ago

I have the error as well and I found the problem, for pairwise comparison there is netVisual_embeddingPairwiseZoomIn - netVisual_embeddingZoomIn uses 'comparison <- "single"' and that comparison is not in the merged objects.

aboutfanfan commented 9 months ago

I also have the same problem. The merged cellchat object have this error. A single cellchat object runs fine. How to solve it?