CellChat icon indicating copy to clipboard operation
CellChat copied to clipboard

error reporting for rankSimilarity

Open zh-zhang1984 opened this issue 3 years ago • 8 comments

Hi, thank you for your excellent package; but I CANNOT successfully solve the following issues:

cellchat <- computeNetSimilarityPairwise(cellchat, type = "functional")
cellchat <- netEmbedding(cellchat, type = "functional",
                         umap.method = "uwot")
cellchat <- netClustering(
  cellchat, type = "functional")
netVisual_embeddingPairwise(
  cellchat, type = "functional", label.size = 3.5)
rankSimilarity(cellchat, type = "functional")
Compute the distance of signaling networks between datasets 1 2 
Error in data1[i, ] : subscript out of bounds

The previous lines works well , but the last line of rankSimilarity reported error, do you have any hints for this?

zh-zhang1984 avatar Aug 07 '21 04:08 zh-zhang1984

@zh-zhang1984 I am sorry I have no idea on this error. I can take a look if you can share me your object. You can also run the source codes line by line to figure out the reason.

sqjin avatar Aug 14 '21 05:08 sqjin

Then I decompose the function and found the rowname of Y is NULL:

> Y <- methods::slot(cellchat, slot.name)$similarity[[type]]$dr[[comparison.name]]
> Y
            [,1]        [,2]
 [1,] -2.4558424  3.90435387
 [2,] -2.2896808  0.96898676
 [3,] -2.7028822  4.67414261
 [4,] -1.7700657  0.87971998
 [5,] -2.4533371  4.19529177
 [6,] -2.3673338  3.28581263
 [7,] -1.3741516  0.95044757
 [8,] -2.6882185  2.34379078
 [9,] -2.3985704  2.57968689
[10,] -2.2128395 -4.13564967

> rownames(Y)
NULL

Is there any hints for this bug?

zh-zhang1984 avatar Oct 08 '21 09:10 zh-zhang1984

@zh-zhang1984 I have no idea on this error. I can take a look if you can share me your object or provide a small example to replicate your error.

sqjin avatar Oct 09 '21 02:10 sqjin

Zhongheng Zhang has shared a OneDrive file with you. To view it, click the link below. https://1drv.ms/u/s!AnooFyHsUDdzghVsIZ-IzFCsSXJg [https://r1.res.office365.com/owa/prem/images/dc-generic_20.png]https://1drv.ms/u/s!AnooFyHsUDdzghVsIZ-IzFCsSXJg cellchat.rdshttps://1drv.ms/u/s!AnooFyHsUDdzghVsIZ-IzFCsSXJg

enclosed is the cellchat object that report this error; thank you, Zhongheng


From: Suoqin Jin @.> Sent: Saturday, October 9, 2021 2:09 AM To: sqjin/CellChat @.> Cc: Zhongheng Zhang @.>; Mention @.> Subject: Re: [sqjin/CellChat] error reporting for rankSimilarity (#259)

@zh-zhang1984https://github.com/zh-zhang1984 I have no idea on this error. I can take a look if you can share me your object or provide a small example to replicate your error.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/sqjin/CellChat/issues/259#issuecomment-939205756, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFLCMAD5P44M3PDEESAYJLLUF6P67ANCNFSM5BW7VIDQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

zh-zhang1984 avatar Oct 09 '21 07:10 zh-zhang1984

Hi, thank you for your excellent package; but I CANNOT successfully solve the following issues:

cellchat <- computeNetSimilarityPairwise(cellchat, type = "functional")
cellchat <- netEmbedding(cellchat, type = "functional",
                         umap.method = "uwot")
cellchat <- netClustering(
  cellchat, type = "functional")
netVisual_embeddingPairwise(
  cellchat, type = "functional", label.size = 3.5)
rankSimilarity(cellchat, type = "functional")
Compute the distance of signaling networks between datasets 1 2 
Error in data1[i, ] : subscript out of bounds

The previous lines works well , but the last line of rankSimilarity reported error, do you have any hints for this?

张老师,我也发生了相同的问题,我发现 rankSimilarity()中,有一个提取rowname的函数: Y <- methods::slot(object, slot.name)$similarity[[type]]$dr[[comparison.name]] 这个提取出来的Y的rowname为 NULL,这个是不对的,所以我在后面自己加了一条代码,给Y的rowname进行了赋值,应该就可以跑通了; rownames(Y) <- rownames(cellchat@netP[["similarity"]]$functional$matrix$1-2) group <- sub(".*--", "", rownames(Y)) 麻烦问一下,这个问题您是怎么解决呢?谢谢 ~

HopeStar2018 avatar Feb 10 '22 09:02 HopeStar2018

image

我相信我找到出错的原因了。我看了 netEmbedding/netClustering/netVisual_embedding的源代码,我发现netVisual_embedding这里,少了一个if else。

I believe I have found the reason for the mistake. I watched netEmbedding/netClustering/netVisual_embedding source code, I found netVisual_embedding here, less an if the else.

image

yudalang3 avatar Oct 18 '23 13:10 yudalang3

图像

我相信我找到出错的原因了。我看了 netEmbedding/netClustering/netVisual_embedding的源代码,我发现netVisual_embedding这里,少了一个if else。

我相信我已经找到了错误的原因。我看了netEmbedding/netClustering/netVisual_embedding源代码,我在这里找到了netVisual_embedding,而不是其他。

图像

Can you share the changed function file? Thank you!

aboutfanfan avatar Nov 24 '23 08:11 aboutfanfan

@aboutfanfan I think the current codes in CellChat is correct.

sqjin avatar Nov 24 '23 15:11 sqjin