CellChat icon indicating copy to clipboard operation
CellChat copied to clipboard

Error when using netVisual_embeddingZoomIn with merged object

Open ccruizm opened this issue 3 years ago • 5 comments

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!

ccruizm avatar Sep 10 '21 09:09 ccruizm

@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.

sqjin avatar Sep 21 '21 21:09 sqjin

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

LipingChen0607 avatar Jul 07 '22 08:07 LipingChen0607

@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.

sqjin avatar Jul 07 '22 23:07 sqjin

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.

eliascrapa avatar May 15 '23 20:05 eliascrapa

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

aboutfanfan avatar Jan 14 '24 15:01 aboutfanfan