CellChat
CellChat copied to clipboard
netVisual_diffInteraction: Error in quantile.default(abs(net), probs = 1 - top)
Hi, thanks for the wonderful tool.
I am using v1.0.0, though I could not find the newest 1.1.0.
I have many cell types so I wanted to subset some and draw the circle plot. When I run the following without specifying cells, everything was fine.
par(mfrow = c(1,2), xpd=TRUE) netVisual_diffInteraction(cellchat, weight.scale = T)
However, when I specify the cells,
par(mfrow = c(1,2), xpd=TRUE) netVisual_diffInteraction(cellchat, weight.scale = T,sources.use = c(1,2,6,7,9),targets.use = c(1,2,6,7,9))
it throws error:
"Error in quantile.default(abs(net), probs = 1 - top) :
missing values and NaN's not allowed if 'na.rm' is FALSE"
I tried to search in the existing issues and found other users also had the problem but you claimed to have fixed it in Feb. I reinstalled CellChat (still v1.0.0) but the problem remained. Could you help please?
@zqun1 It should work now. I suggest you check out the new function subsetCellChat
to focus on a subset groups.
@sqjin Hi Suoqin, I updated CellChat to the newest version 1.1.0, and rerun my code. It still got an error but the error is different: "
"
Error in polygon(p[1, ], p[2, ], border = color, lwd = width, lty = lty) :
invalid value specified for graphical parameter "lwd"
".
I found other users also faced this error for netVisual_aggregate
before and got solved. If you need my source data, I can also email you.
I suggest you check out the new function subsetCellChat to focus on a subset groups.
Do you mean you suggest I subset my interest cells, i.e. c(1,2,6,7,9)? This method is feasible but generates extra data variables. Anyway, the lwd bug should be fixed, isn't it? Thank you in advance!
I am having the same error message after updating to CellChat v1.1.0
@zqun1 Yes, please share me the data and I will take a look. @lizanyu
@zqun1 Yes, please share me the data and I will take a look. @lizanyu
@zqun1 I just shared my repository with you! Thanks for your help!
@zqun1 Yes, please share me the data and I will take a look. @lizanyu
I also have this problem
when I do
netVisual_diffInteraction(cellchat, weight.scale = T, comparison = c('Normal', 'Tumor'), targets.use = 'CC')
there have error
Error in quantile.default(abs(net), probs = 1 - top) : missing values and NaN's not allowed if 'na.rm' is FALSE
I have the same issue when I tried to show the cell types of interest but not all cell types. Here is the error:
Error in quantile.default(abs(net), probs = 1 - top) :
missing values and NaN's not allowed if 'na.rm' is FALSE
I will take a look at your source and see if I can modify it.
I have the same issue when I tried to show the cell types of interest but not all cell types. Here is the error:
Error in quantile.default(abs(net), probs = 1 - top) : missing values and NaN's not allowed if 'na.rm' is FALSE
@zqun1 Yes, please share me the data and I will take a look. @lizanyu
I also have this problem when I do
netVisual_diffInteraction(cellchat, weight.scale = T, comparison = c('Normal', 'Tumor'), targets.use = 'CC')
there have errorError in quantile.default(abs(net), probs = 1 - top) : missing values and NaN's not allowed if 'na.rm' is FALSE
I found that the NA data could be generated from line 47-48. Add net[is.na(net)] <- 0 behind them could solve this problem.
@sdzxzh I can't find the reference code so I'm not sure how you added "net[is.na(net)] <- 0" to fix the error. Could you elaborate on this?
My current code is:
cells <- "Microglia" par(mfrow = c(1,2), xpd=TRUE) netVisual_diffInteraction(cellchatM, weight.scale = T, sources.use = cells)
and I get the same error code described previously.
Error in quantile.default(abs(net), probs = 1 - top) : missing values and NaN's not allowed if 'na.rm' is FALSE
@
@sdzxzh I can't find the reference code so I'm not sure how you added "net[is.na(net)] <- 0" to fix the error. Could you elaborate on this?
My current code is:
cells <- "Microglia" par(mfrow = c(1,2), xpd=TRUE) netVisual_diffInteraction(cellchatM, weight.scale = T, sources.use = cells)
and I get the same error code described previously.
Error in quantile.default(abs(net), probs = 1 - top) : missing values and NaN's not allowed if 'na.rm' is FALSE
Fix it now.
Many thanks for your dedication @sqjin, it works with the last update!