'NAs introduced by coercion' error in FindSpatiallyVariableFeatures()
Hi, I'm having a strange error when computing Moran's I on Slide-seq data. FindSpatiallyVariableFeatures() function is failing with this error:
Error in sequence.default(n..1, from = seq.int(s.1, length(df), s.1), : 'from' contains NAs
Calls: FindSpatiallyVariableFeatures ... as.matrix -> as.matrix -> as.matrix.dist -> sequence.default
In addition: Warning messages:
1: In dist(x = pos) : NAs introduced by coercion
2: In sequence.default(n..1, from = seq.int(s.1, length(df), s.1), :
NAs introduced by coercion to integer range
Anyone know how to resolve this and what is causing it? Thanks!
Hi @vukojicic-nevena ,
Thank you for reaching out! We’re always grateful when folks take the time to help make Seurat better 🙂
Unfortunately, with the details provided, we cannot reproduce your issue. To help us better understand and resolve this issue, please ensure that you provide the following information when reporting a bug:
-
Describe your issue:
- A clear and concise description of what the bug is — avoid just pasting in the error message.
-
Reproducing Code Example:
- Provide a minimal reproducible example that demonstrates the issue using one of the datasets available through SeuratData. Paste the code in a code block.
- The code example should make use of
pbmc_smallor one of the datasets available through SeuratData.
-
Error Message:
- If any, paste the full error message (starting from line Traceback) in a code block.
- If no error is raised, consider writing a simple test case that explicitly raises one
-
System Information:
- Run
sessionInfo()and paste the result in a code block.
- Run
Once you’ve gathered these details we will be more than happy to help you resolve the problem.
I have encountered the same problem. test_data2 <- FindSpatiallyVariableFeatures(test_data2, assay = "SCT",
features = variable_top1000,
selection.method = "moransi",
verbose = T) #"markvariogram"
Computing Moran's I |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=13h 16m 23s 警告信息: In dist(x = pos) : NAs introduced by coercion
DEGs<- SpatiallyVariableFeatures(test_data2, method = "moransi",assay = "SCT") Error in xtfrm.data.frame(x) : cannot xtfrm data frames