satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.29k stars 912 forks source link

Error from runUMAP #4876

Closed Liang-Wu-01 closed 3 years ago

Liang-Wu-01 commented 3 years ago

Hi, I just update version of seurat to 4.0.3, but when run the runUMAP function, I get following error: Error in x2set(Xsub, n_neighbors, metric, nn_method = nn_sub, n_trees, : Non-finite entries in the input matrix. I am not sure what happened.

my code:

library(dplyr) library(SeuratData) data("pbmc3k")

pbmc3k <- SCTransform(pbmc3k, ncells = 3000, verbose = FALSE) %>% RunPCA(verbose = FALSE,npcs=30) %>% RunUMAP(dims = 1:30)

Warning: The default method for RunUMAP has changed from calling Python UMAP via reticulate to the R-native UWOT using the cosine metric To use Python UMAP via reticulate, set umap.method to 'umap-learn' and metric to 'correlation' This message will be shown once per session 18:40:12 UMAP embedding parameters a = 0.9922 b = 1.112 18:40:12 Read 2700 rows and found 30 numeric columns 18:40:12 Using Annoy for neighbor search, n_neighbors = 30 18:40:12 Building Annoy index with metric = cosine, n_trees = 50 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| **| 18:40:12 Writing NN index file to temp file /tmp/Rtmp7LqWjY/filea87d13b6ebf2 18:40:12 Searching Annoy index using 1 thread, search_k = 3000 18:40:13 Annoy recall = 1.111% 18:40:13 Commencing smooth kNN distance calibration using 1 thread 18:40:13 2700 smooth knn distance failures Error in x2set(Xsub, n_neighbors, metric, nn_method = nn_sub, n_trees, : Non-finite entries in the input matrix

sessionInfo() R version 4.1.0 (2021-05-18) Platform: x86_64-conda-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)

Matrix products: default BLAS/LAPACK: ~/software/anaconda3/lib/libmkl_rt.so.1

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] dplyr_1.0.7 pbmc3k.SeuratData_3.1.4 SeuratData_0.2.1 [4] SeuratObject_4.0.2 Seurat_4.0.3

loaded via a namespace (and not attached): [1] nlme_3.1-152 matrixStats_0.60.0 spatstat.sparse_2.0-0 [4] RcppAnnoy_0.0.19 RColorBrewer_1.1-2 httr_1.4.2 [7] sctransform_0.3.2 tools_4.1.0 utf8_1.2.2 [10] R6_2.5.0 irlba_2.3.2 rpart_4.1-15 [13] KernSmooth_2.23-20 uwot_0.1.10 mgcv_1.8-36 [16] DBI_1.1.1 lazyeval_0.2.2 colorspace_2.0-2 [19] tidyselect_1.1.1 gridExtra_2.3 compiler_4.1.0 [22] cli_3.0.1 plotly_4.9.4.1 scales_1.1.1 [25] lmtest_0.9-38 spatstat.data_2.1-0 ggridges_0.5.3 [28] pbapply_1.4-3 rappdirs_0.3.3 goftest_1.2-2 [31] stringr_1.4.0 digest_0.6.27 spatstat.utils_2.2-0 [34] pkgconfig_2.0.3 htmltools_0.5.1.1 parallelly_1.27.0 [37] fastmap_1.1.0 htmlwidgets_1.5.3 rlang_0.4.11 [40] rstudioapi_0.13 shiny_1.6.0 generics_0.1.0 [43] zoo_1.8-9 jsonlite_1.7.2 ica_1.0-2 [46] magrittr_2.0.1 patchwork_1.1.1 Matrix_1.3-4 [49] Rcpp_1.0.7 munsell_0.5.0 fansi_0.5.0 [52] abind_1.4-5 reticulate_1.20 lifecycle_1.0.0 [55] stringi_1.7.3 MASS_7.3-54 Rtsne_0.15 [58] plyr_1.8.6 grid_4.1.0 parallel_4.1.0 [61] listenv_0.8.0 promises_1.2.0.1 ggrepel_0.9.1 [64] crayon_1.4.1 miniUI_0.1.1.1 deldir_0.2-10 [67] lattice_0.20-44 cowplot_1.1.1 splines_4.1.0 [70] tensor_1.5 pillar_1.6.1 igraph_1.2.6 [73] spatstat.geom_2.2-2 future.apply_1.7.0 reshape2_1.4.4 [76] codetools_0.2-18 leiden_0.3.9 glue_1.4.2 [79] data.table_1.14.0 png_0.1-7 vctrs_0.3.8 [82] httpuv_1.6.1 gtable_0.3.0 RANN_2.6.1 [85] purrr_0.3.4 spatstat.core_2.3-0 polyclip_1.10-0 [88] tidyr_1.1.3 scattermore_0.7 future_1.21.0 [91] assertthat_0.2.1 ggplot2_3.3.5 mime_0.11 [94] xtable_1.8-4 later_1.2.0 survival_3.2-11 [97] viridisLite_0.4.0 tibble_3.1.3 cluster_2.1.2 [100] globals_0.14.0 fitdistrplus_1.1-5 ellipsis_0.3.2 [103] ROCR_1.0-11

yuhanH commented 3 years ago

It looks wired. I cannot reproduce the same error.
Does it work if you don't use pipe %>% and run those steps one by one?

Liang-Wu-01 commented 3 years ago

Hi yuhan. Thanks for your reply. I also had tried not used %>%, but the same error in the runUMAP function. But this error only appeared in the CentOS Linux 7 (Core) system, the window10 did not show any error in the same script.

saketkc commented 3 years ago

Hi @Liang-BGI, just to follow up I am not able to reproduce this error. Are you still facing issues?

no-response[bot] commented 3 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

yanpinlu commented 2 years ago

@ @I'm having the same problem and I'm curious to know how to fix it. The R used is version 4.2, and the operation process is as follows

A_5s <- ReadVelocity(file = "/home/lvelocyto/190706A_drl_count.loom") bm <- as.Seurat(x = A_5s) bm <- SCTransform(object = bm, assay = "spliced") bm <- RunPCA(object = bm, verbose = FALSE) bm <- FindNeighbors(object = bm, dims = 1:20) bm <- FindClusters(object = bm) bm <- RunUMAP(object = bm, dims = 1:20) Warning: The default method for RunUMAP has changed from calling Python UMAP via reticulate to the R-native UWOT using th e cosine metric To use Python UMAP via reticulate, set umap.method to 'umap-learn' and metric to 'correlation' This message will be shown once per session 20:27:33 UMAP embedding parameters a = 0.9922 b = 1.112 20:27:33 Read 11329 rows and found 20 numeric columns 20:27:33 Using Annoy for neighbor search, n_neighbors = 30 20:27:33 Building Annoy index with metric = cosine, n_trees = 50 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| **| 20:27:35 Writing NN index file to temp file /tmp/RtmpoNUZSR/file88363f984c80 20:27:35 Searching Annoy index using 1 thread, search_k = 3000 20:27:37 Annoy recall = 0.2648% 20:27:38 Commencing smooth kNN distance calibration using 1 thread 20:27:38 11329 smooth knn distance failures Error in x2set(Xsub, n_neighbors, metric, nn_method = nn_sub, n_trees, : Non-finite entries in the input matrix @saketkc

tumorscholar commented 8 months ago

Hello @yanpinlu, @saketkc I am facing the same issue, how did you fix?

10:40:19 UMAP embedding parameters a = 0.9922 b = 1.112 Found more than one class "dist" in cache; using the first, from namespace 'spam' Also defined by ‘BiocGenerics’ 10:40:20 Commencing smooth kNN distance calibration using 1 thread with target n_neighbors = 20 10:40:20 741 smooth knn distance failures Error in x2set(Xsub, n_neighbors, metric, nn_method = nn_sub, n_trees, : Non-finite entries in the input matrix