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

Warning message: In size + sum(size_args, na.rm = FALSE) : NAs produced by integer overflow #9316

Closed
Sirin24 opened this issue Sep 16, 2024 · 10 comments

Comments

@Sirin24
Copy link

Sirin24 commented Sep 16, 2024

I faced the following warning messages with ProjectData() step . I would appreciate it if you can help

filtered_obj_sketched <- FindNeighbors(filtered_obj_sketched, dims = 1:30, reduction = "pca")
filtered_obj_sketched <- FindClusters(filtered_obj_sketched, resolution = 2, cluster.name = "unintegrated_clusters_2")
filtered_obj_sketched <- FindClusters(filtered_obj_sketched, resolution = 1, cluster.name = "unintegrated_clusters_1")
filtered_obj_sketched <- FindClusters(filtered_obj_sketched, resolution = 0.5, cluster.name = "unintegrated_clusters_0.5")
filtered_obj_sketched <- RunUMAP(filtered_obj_sketched, dims = 1:30, reduction = "pca", reduction.name = "umap.unintegrated")

filtered_obj_sketched <- FindNeighbors(filtered_obj_sketched, reduction = "integrated.harmony", dims = 1:30)
filtered_obj_sketched <- FindClusters(filtered_obj_sketched, resolution = 2, cluster.name = "harmony_clusters_2")
filtered_obj_sketched <- FindClusters(filtered_obj_sketched, resolution = 1, cluster.name = "harmony_clusters_1")
filtered_obj_sketched <- FindClusters(filtered_obj_sketched, resolution = 0.5, cluster.name = "harmony_clusters_0.5")
filtered_obj_sketched <- RunUMAP(filtered_obj_sketched, reduction = "integrated.harmony", dims = 1:30, return.model = T, reduction.name = "umap.harmony")

filtered_obj_sketched  <- ProjectIntegration(object = filtered_obj_sketched,
                                             sketched.assay = "sketch",
                                             assay = "RNA",
                                             reduction = "pca")
> filtered_obj_sketched <- ProjectData(
+   object = filtered_obj_sketched,
+   assay = "RNA",
+   full.reduction = "pca.full",
+   sketched.assay = "sketch",
+   sketched.reduction = "pca",
+   umap.model = "umap.unintegrated",
+   dims = 1:30,
+   refdata = list(unintegrated_clusters_2_full = "unintegrated_clusters_2",
+                  unintegrated_clusters_1_full = "unintegrated_clusters_1",
+                  unintegrated_clusters_0.5_full = "unintegrated_clusters_0.5")
+ )
Finding sketch neighbors
Finding sketch weight matrix
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Transfering refdata from sketch
Warning messages:
1: In size + sum(size_args, na.rm = FALSE) :
  NAs produced by integer overflow
2: In TransferSketchLabels(object = object, sketched.assay = sketched.assay,  :
  umap.unintegrated does not have a stored umap model
filtered_obj_sketched  <- ProjectIntegration(object = filtered_obj_sketched,
                                           sketched.assay = "sketch",
                                           assay = "RNA",
                                           reduction = "integrated.harmony")
> filtered_obj_sketched <- ProjectData(
+   object = filtered_obj_sketched,
+   assay = "RNA",
+   full.reduction = "integrated.harmony.full",
+   sketched.assay = "sketch",
+   sketched.reduction = "integrated.harmony.full",
+   dims = 1:30,
+   refdata = list(harmony_clusters_2_full = "harmony_clusters_2",
+                  harmony_clusters_1_full = "harmony_clusters_1",
+                  harmony_clusters_0.5_full = "harmony_clusters_0.5"),
+   verbose = TRUE
+ )
Finding sketch neighbors
Transfering refdata from sketch
Warning message:
In size + sum(size_args, na.rm = FALSE) : NAs produced by integer overflow

sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Rocky Linux 9.3 (Blue Onyx)

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblas-r0.3.21.so; LAPACK version 3.9.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C 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 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

time zone: UTC
tzcode source: system (glibc)

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

other attached packages:
[1] batchelor_1.20.0 SingleCellExperiment_1.26.0 SummarizedExperiment_1.34.0 Biobase_2.64.0
[5] GenomicRanges_1.56.0 GenomeInfoDb_1.40.1 IRanges_2.38.0 S4Vectors_0.42.0
[9] BiocGenerics_0.50.0 MatrixGenerics_1.16.0 matrixStats_1.3.0 SeuratWrappers_0.3.2
[13] patchwork_1.2.0 ggrepel_0.9.5 ggplot2_3.5.1 SeuratDisk_0.0.0.9021
[17] BPCells_0.2.0 data.table_1.16.0 SCopeLoomR_0.13.0 Seurat_5.1.0
[21] SeuratObject_5.0.2 sp_2.1-4 dplyr_1.1.4

loaded via a namespace (and not attached):
[1] RcppAnnoy_0.0.22 splines_4.4.0 later_1.3.2 tibble_3.2.1
[5] R.oo_1.26.0 polyclip_1.10-7 fastDummies_1.7.4 lifecycle_1.0.4
[9] rprojroot_2.0.4 globals_0.16.3 lattice_0.22-6 hdf5r_1.3.11
[13] MASS_7.3-60.2 magrittr_2.0.3 plotly_4.10.4 rmarkdown_2.28
[17] yaml_2.3.10 remotes_2.5.0 httpuv_1.6.15 sctransform_0.4.1
[21] spam_2.10-0 spatstat.sparse_3.1-0 reticulate_1.37.0 cowplot_1.1.3
[25] pbapply_1.7-2 RColorBrewer_1.1-3 ResidualMatrix_1.14.1 abind_1.4-5
[29] zlibbioc_1.50.0 Rtsne_0.17 purrr_1.0.2 R.utils_2.12.3
[33] rappdirs_0.3.3 GenomeInfoDbData_1.2.12 irlba_2.3.5.1 listenv_0.9.1
[37] spatstat.utils_3.1-0 goftest_1.2-3 RSpectra_0.16-2 spatstat.random_3.3-1
[41] fitdistrplus_1.2-1 parallelly_1.38.0 DelayedMatrixStats_1.26.0 leiden_0.4.3.1
[45] codetools_0.2-20 DelayedArray_0.30.1 scuttle_1.14.0 DT_0.33
[49] tidyselect_1.2.1 farver_2.1.2 UCSC.utils_1.0.0 ScaledMatrix_1.12.0
[53] spatstat.explore_3.3-2 jsonlite_1.8.8 BiocNeighbors_1.22.0 progressr_0.14.0
[57] ggridges_0.5.6 survival_3.7-0 tools_4.4.0 ica_1.0-3
[61] Rcpp_1.0.13 glue_1.7.0 gridExtra_2.3 SparseArray_1.4.8
[65] xfun_0.47 here_1.0.1 withr_3.0.1 BiocManager_1.30.23
[69] fastmap_1.2.0 fansi_1.0.6 digest_0.6.37 rsvd_1.0.5
[73] R6_2.5.1 mime_0.12 colorspace_2.1-1 scattermore_1.2
[77] tensor_1.5 spatstat.data_3.1-2 R.methodsS3_1.8.2 RhpcBLASctl_0.23-42
[81] utf8_1.2.4 tidyr_1.3.1 generics_0.1.3 httr_1.4.7
[85] htmlwidgets_1.6.4 S4Arrays_1.4.1 uwot_0.2.2 pkgconfig_2.0.3
[89] gtable_0.3.5 lmtest_0.9-40 XVector_0.44.0 htmltools_0.5.8.1
[93] dotCall64_1.1-1 scales_1.3.0 png_0.1-8 harmony_1.2.1
[97] spatstat.univar_3.0-0 knitr_1.48 rstudioapi_0.16.0 reshape2_1.4.4
[101] nlme_3.1-165 zoo_1.8-12 stringr_1.5.1 KernSmooth_2.23-24
[105] parallel_4.4.0 miniUI_0.1.1.1 pillar_1.9.0 grid_4.4.0
[109] vctrs_0.6.5 RANN_2.6.2 promises_1.3.0 BiocSingular_1.20.0
[113] beachmat_2.20.0 xtable_1.8-4 cluster_2.1.6 evaluate_0.24.0
[117] cli_3.6.3 compiler_4.4.0 rlang_1.1.4 crayon_1.5.3
[121] future.apply_1.11.2 labeling_0.4.3 plyr_1.8.9 stringi_1.8.4
[125] viridisLite_0.4.2 deldir_2.0-4 BiocParallel_1.38.0 munsell_0.5.1
[129] lazyeval_0.2.2 spatstat.geom_3.3-2 Matrix_1.7-0 RcppHNSW_0.6.0
[133] sparseMatrixStats_1.16.0 bit64_4.0.5 future_1.34.0 shiny_1.9.1
[137] ROCR_1.0-11 igraph_2.0.3 bit_4.0.5

@gnilihzeux
Copy link

I have faced the same issue while ScaleData a merged object. Do you solve this ?

@Sirin24
Copy link
Author

Sirin24 commented Sep 30, 2024

No unfortunately.

@gnilihzeux
Copy link

Eh. The AggregateExpression reports the same issue while scaling the matrix.

@adyzh
Copy link

adyzh commented Oct 11, 2024

Hi @Sirin24, Hi @username,
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. Though usually interger overflows can be solved with as.numeric().

To help us better understand and resolve this issue, please ensure that you provide the following information when reporting a bug:

  1. Describe your issue:
    • A clear and concise description of what the bug is — avoid just pasting in the error message.
  2. 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_small or one of the datasets available through SeuratData.
  3. 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 an error if the
  4. System Information:
    • Run sessionInfo() and paste the result in a code block.
      We’re going to go ahead and close this issue for now, but once you’ve gathered these details, we strongly encourage you repost and we will be more than happy to help you resolve the problem.

@adyzh adyzh closed this as completed Oct 11, 2024
@gnilihzeux
Copy link

Ooops, finally, it seems to be caused by the RStudio environment.

@gnilihzeux
Copy link

Eh, it comes again. @adyzh

I have deliver my data and source code to onedrive links

and

My OS : CentOS 7
My R environment:

R version 4.4.1 (2024-06-14)
Platform: x86_64-conda-linux-gnu
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: ~/miniconda3/envs/scRNA-seq/lib/libopenblasp-r0.3.27.so;  LAPACK version 3.12.0

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

time zone: Asia/Shanghai
tzcode source: system (glibc)

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

other attached packages:
 [1] clustree_0.5.1         ggraph_2.2.1           openxlsx_4.2.7        
 [4] clusterProfiler_4.12.6 ggalluvial_0.12.5      dplyr_1.1.4           
 [7] tidygraph_1.3.1        future_1.34.0          ggplot2_3.5.1         
[10] cowplot_1.1.3          ggsci_3.2.0            Seurat_5.1.0          
[13] SeuratObject_5.0.2     sp_2.1-4              

@JosephEDuke-Cohan
Copy link

Any update? I'm getting the same issue after running SCTransform. Did you find a solution @gnilihzeux

@gnilihzeux
Copy link

Any update? I'm getting the same issue after running SCTransform. Did you find a solution @gnilihzeux

Sorry, not yet.

@AlbertoFabbri93
Copy link

Any update? I'm getting the same issue after running SCTransform. Did you find a solution @gnilihzeux

Same:

# After subsetting a Seurat object it is good to normalize it again
> seurat_object <- SCTransform(
+   seurat_object,
+   vars.to.regress = c("nFeature_RNA", "nCount_RNA"),
+   return.only.var.genes = FALSE,
+   assay = "RNA",
+   new.assay.name = "SCTcells",
+   verbose = FALSE)
Warning: NAs produced by integer overflowWarning: NAs produced by integer overflowWarning: NAs produced by integer overflowWarning: NAs produced by integer overflow

@ycl6
Copy link

ycl6 commented Dec 12, 2024

Hi all, I believe the issue lies with the future package and I have provided a fix via PR here futureverse/future#755.


Edit (15 Dec 2024):

An update from future's developer. He has identified an upstream function in the package parallelly that will be best to implement the fix.

The fix, futureverse/parallelly#123, has been implemented in parallelly (>= 1.40.1-9007).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants