Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreliable value when using the future package #9488

Open
AlbertoFabbri93 opened this issue Nov 16, 2024 · 0 comments
Open

Unreliable value when using the future package #9488

AlbertoFabbri93 opened this issue Nov 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@AlbertoFabbri93
Copy link

When I run Seurat::FindClusters using the future package I get the following warning:

> breast_cancer_patients_tumor_cells <- FindClusters(
+   breast_cancer_patients_tumor_cells,
+   resolution = seq_res,
+   cluster.name = tumor_cluster_seq_res,
+   random.seed = 5,
+   verbose = TRUE)
Warning: NAs produced by integer overflowModularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 38284
Number of edges: 1432724

Running Louvain algorithm...
Maximum modularity in 10 random starts: 0.9574
Number of communities: 8
Elapsed time: 5 seconds
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 38284
Number of edges: 1432724

Running Louvain algorithm...
Maximum modularity in 10 random starts: 0.9455
Number of communities: 12
Elapsed time: 6 seconds
Warning: UNRELIABLE VALUE: One of the ‘future.apply’ iterations (‘future_lapply-2’) unexpectedly generated random numbers without declaring so. There is a risk that those random numbers are not statistically sound and the overall results might be invalid. To fix this, specify 'future.seed=TRUE'. This ensures that proper, parallel-safe random numbers are produced via the L'Ecuyer-CMRG method. To disable this check, use 'future.seed = NULL', or set option 'future.rng.onMisuse' to "ignore".Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 38284
Number of edges: 1432724

Running Louvain algorithm...
Maximum modularity in 10 random starts: 0.9348
Number of communities: 13
Elapsed time: 6 seconds
Warning: UNRELIABLE VALUE: One of the ‘future.apply’ iterations (‘future_lapply-3’) unexpectedly generated random numbers without declaring so. There is a risk that those random numbers are not statistically sound and the overall results might be invalid. To fix this, specify 'future.seed=TRUE'. This ensures that proper, parallel-safe random numbers are produced via the L'Ecuyer-CMRG method. To disable this check, use 'future.seed = NULL', or set option 'future.rng.onMisuse' to "ignore".Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 38284
Number of edges: 1432724

Running Louvain algorithm...
Maximum modularity in 10 random starts: 0.9243
Number of communities: 13
Elapsed time: 5 seconds
Warning: UNRELIABLE VALUE: One of the ‘future.apply’ iterations (‘future_lapply-4’) unexpectedly generated random numbers without declaring so. There is a risk that those random numbers are not statistically sound and the overall results might be invalid. To fix this, specify 'future.seed=TRUE'. This ensures that proper, parallel-safe random numbers are produced via the L'Ecuyer-CMRG method. To disable this check, use 'future.seed = NULL', or set option 'future.rng.onMisuse' to "ignore".

At the top of my Quarto file I set the future.seed option:

# Replace this future symbols with others because they conflict with the zeallot package
library (future, exclude = c("%->%", "%<-%"));
`%<--%` = future::`%<-%` ;
`%-->%` = future::`%->%` ;
# Parallelize the computation with several worker processes that will run in their own R session
plan("multisession", workers = 6)
# Set the maximum size of the future globals
options(future.globals.maxSize = 6.5 * 2^30)
# Ensure proper random number seeding globally
options(future.seed = TRUE)
> sessionInfo()
R version 4.4.2 (2024-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Stockholm
tzcode source: internal

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

other attached packages:
 [1] conflicted_1.2.0       org.Hs.eg.db_3.19.1    AnnotationDbi_1.66.0   IRanges_2.38.1         S4Vectors_0.42.1      
 [6] Biobase_2.64.0         BiocGenerics_0.50.0    clusterProfiler_4.12.6 pals_1.9               RColorBrewer_1.1-3    
[11] ggforce_0.4.2          clustree_0.5.1         ggraph_2.2.1           ggpubr_0.6.0           patchwork_1.3.0       
[16] Matrix_1.7-1           abind_1.4-8            presto_1.0.0           data.table_1.16.2      Rcpp_1.0.13-1         
[21] glmGamPoi_1.16.0       EBImage_4.46.0         dittoSeq_1.16.0        InSituType_2.0         here_1.0.1            
[26] glue_1.8.0             zeallot_0.1.0          tidyr_1.3.1            tibble_3.2.1           readr_2.1.5           
[31] readxl_1.4.3           ggplot2_3.5.1          dplyr_1.1.4            future_1.34.0          Seurat_5.1.0          
[36] SeuratObject_5.0.2     sp_2.1-4              

loaded via a namespace (and not attached):
  [1] fs_1.6.5                    matrixStats_1.4.1           spatstat.sparse_3.1-0       bitops_1.0-9               
  [5] enrichplot_1.24.4           httr_1.4.7                  tools_4.4.2                 sctransform_0.4.1          
  [9] backports_1.5.0             utf8_1.2.4                  R6_2.5.1                    lazyeval_0.2.2             
 [13] uwot_0.2.2                  withr_3.0.2                 gridExtra_2.3               progressr_0.15.0           
 [17] textshaping_0.4.0           cli_3.6.3                   spatstat.explore_3.3-3      fastDummies_1.7.4          
 [21] scatterpie_0.2.4            labeling_0.4.3              spatstat.data_3.1-2         ggridges_0.5.6             
 [25] pbapply_1.7-2               askpass_1.2.1               systemfonts_1.1.0           yulab.utils_0.1.8          
 [29] gson_0.1.0                  R.utils_2.12.3              DOSE_3.30.5                 dichromat_2.0-0.1          
 [33] parallelly_1.39.0           maps_3.4.2.1                rstudioapi_0.17.1           RSQLite_2.3.7              
 [37] gridGraphics_0.5-1          generics_0.1.3              vroom_1.6.5                 ica_1.0-3                  
 [41] spatstat.random_3.3-2       car_3.1-3                   GO.db_3.19.1                fansi_1.0.6                
 [45] R.methodsS3_1.8.2           lifecycle_1.0.4             yaml_2.3.10                 carData_3.0-5              
 [49] SummarizedExperiment_1.34.0 qvalue_2.36.0               SparseArray_1.4.8           Rtsne_0.17                 
 [53] blob_1.2.4                  grid_4.4.2                  promises_1.3.0              crayon_1.5.3               
 [57] miniUI_0.1.1.1              lattice_0.22-6              cowplot_1.1.3               KEGGREST_1.44.1            
 [61] mapproj_1.2.11              pillar_1.9.0                knitr_1.49                  fgsea_1.30.0               
 [65] GenomicRanges_1.56.2        future.apply_1.11.3         codetools_0.2-20            fastmatch_1.1-4            
 [69] leiden_0.4.3.1              ggfun_0.1.7                 spatstat.univar_3.1-1       treeio_1.28.0              
 [73] vctrs_0.6.5                 png_0.1-8                   spam_2.11-0                 cellranger_1.1.0           
 [77] gtable_0.3.6                cachem_1.1.0                xfun_0.49                   S4Arrays_1.4.1             
 [81] mime_0.12                   tidygraph_1.3.1             survival_3.7-0              SingleCellExperiment_1.26.0
 [85] pheatmap_1.0.12             fitdistrplus_1.2-1          ROCR_1.0-11                 lsa_0.73.3                 
 [89] nlme_3.1-166                ggtree_3.12.0               bit64_4.5.2                 RcppAnnoy_0.0.22           
 [93] GenomeInfoDb_1.40.1         rprojroot_2.0.4             SnowballC_0.7.1             irlba_2.3.5.1              
 [97] KernSmooth_2.23-24          colorspace_2.1-1            DBI_1.2.3                   tidyselect_1.2.1           
[101] bit_4.5.0                   compiler_4.4.2              httr2_1.0.6                 DelayedArray_0.30.1        
[105] plotly_4.10.4               shadowtext_0.1.4            scales_1.3.0                lmtest_0.9-40              
[109] rappdirs_0.3.3              tiff_0.1-12                 stringr_1.5.1               digest_0.6.37              
[113] goftest_1.2-3               fftwtools_0.9-11            spatstat.utils_3.1-1        XVector_0.44.0             
[117] htmltools_0.5.8.1           pkgconfig_2.0.3             jpeg_0.1-10                 umap_0.2.10.0              
[121] sparseMatrixStats_1.16.0    MatrixGenerics_1.16.0       fastmap_1.2.0               rlang_1.1.4                
[125] htmlwidgets_1.6.4           UCSC.utils_1.0.0            shiny_1.9.1                 farver_2.1.2               
[129] zoo_1.8-12                  jsonlite_1.8.9              BiocParallel_1.38.0         mclust_6.1.1               
[133] R.oo_1.27.0                 GOSemSim_2.30.2             RCurl_1.98-1.16             magrittr_2.0.3             
[137] ggplotify_0.1.2             Formula_1.2-5               GenomeInfoDbData_1.2.12     dotCall64_1.2              
[141] munsell_0.5.1               ape_5.8                     viridis_0.6.5               reticulate_1.39.0          
[145] stringi_1.8.4               zlibbioc_1.50.0             MASS_7.3-61                 plyr_1.8.9                 
[149] parallel_4.4.2              listenv_0.9.1               ggrepel_0.9.6               deldir_2.0-4               
[153] Biostrings_2.72.1           graphlayouts_1.2.0          splines_4.4.2               tensor_1.5                 
[157] hms_1.1.3                   locfit_1.5-9.10             igraph_2.1.1                spatstat.geom_3.3-3        
[161] ggsignif_0.6.4              RcppHNSW_0.6.0              reshape2_1.4.4              evaluate_1.0.1             
[165] renv_1.0.11                 BiocManager_1.30.25         tzdb_0.4.0                  tweenr_2.0.3               
[169] httpuv_1.6.15               RANN_2.6.2                  openssl_2.2.2               purrr_1.0.2                
[173] polyclip_1.10-7             scattermore_1.2             broom_1.0.7                 xtable_1.8-4               
[177] tidytree_0.4.6              RSpectra_0.16-2             rstatix_0.7.2               later_1.3.2                
[181] ragg_1.3.3                  viridisLite_0.4.2           aplot_0.2.3                 memoise_2.0.1              
[185] cluster_2.1.6               globals_0.16.3

I saw the other bug reports but none of them seems to have a fix for this.

@AlbertoFabbri93 AlbertoFabbri93 added the bug Something isn't working label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant