BodenmillerGroup / imcRtools

An R package for handling and analysing imaging mass cytometry data
https://bodenmillergroup.github.io/imcRtools/
21 stars 10 forks source link

Memory Issue with minDistToCells #124

Closed jonhsussman closed 3 weeks ago

jonhsussman commented 7 months ago

Hello,

I have been getting this memory issue with minDistToCells. Each image is 100k-400k cells and there are 800k cells in total in the dataset. I have a suspicion that this may be some sort of version/package issue since I've used this function several months ago without any issue on even larger images and datasets. Do you have any idea on what has changed recently that could be inducing this error?

sce <- minDistToCells(sce, x_cells = sce$cell_type_coarse == "Macrophages", coords = c("x_coord","y_coord"), img_id = "sample_id", return_neg=F) Error: BiocParallel errors 1 remote errors, element index: 4 0 unevaluated and other errors first remote error: Error: cannot allocate vector of size 1216.0 Gb

Session info is as follows: `sessionInfo() R version 4.3.3 (2024-02-29) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Red Hat Enterprise Linux 9.1 (Plow)

Matrix products: default BLAS: /cm/shared/apps_chop/R/4.3.3/lib64/R/lib/libRblas.so LAPACK: /cm/shared/apps_chop/R/4.3.3/lib64/R/lib/libRlapack.so; LAPACK version 3.11.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: America/New_York tzcode source: system (glibc)

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

other attached packages: [1] imcRtools_1.9.2 SpatialExperiment_1.12.0 SingleCellExperiment_1.24.0 [4] SummarizedExperiment_1.32.0 Biobase_2.62.0 GenomicRanges_1.54.1
[7] GenomeInfoDb_1.38.8 IRanges_2.36.0 S4Vectors_0.40.2
[10] BiocGenerics_0.48.1 MatrixGenerics_1.14.0 matrixStats_1.2.0

loaded via a namespace (and not attached): [1] RColorBrewer_1.1-3 rstudioapi_0.16.0 magrittr_2.0.3 ggbeeswarm_0.7.2
[5] magick_2.8.3 farver_2.1.1 zlibbioc_1.48.2 RTriangle_1.6-0.13
[9] vctrs_0.6.5 memoise_2.0.1 DelayedMatrixStats_1.24.0 RCurl_1.98-1.14
[13] terra_1.7-71 svgPanZoom_0.3.4 htmltools_0.5.8 S4Arrays_1.2.1
[17] BiocNeighbors_1.20.2 raster_3.6-26 Rhdf5lib_1.25.2 SparseArray_1.2.4
[21] rhdf5_2.46.1 KernSmooth_2.23-22 htmlwidgets_1.6.4 cachem_1.0.8
[25] igraph_2.0.3 mime_0.12 lifecycle_1.0.4 pkgconfig_2.0.3
[29] Matrix_1.6-5 R6_2.5.1 fastmap_1.1.1 GenomeInfoDbData_1.2.11
[33] shiny_1.8.1 digest_0.6.35 colorspace_2.1-0 ps_1.7.6
[37] beachmat_2.18.1 fansi_1.0.6 nnls_1.5 polyclip_1.10-6
[41] abind_1.4-5 compiler_4.3.3 proxy_0.4-27 remotes_2.5.0
[45] bit64_4.0.5 withr_3.0.0 tiff_0.1-12 BiocParallel_1.36.0
[49] DBI_1.2.2 viridis_0.6.5 pkgbuild_1.4.4 HDF5Array_1.30.1
[53] ggforce_0.4.2 cytomapper_1.14.0 MASS_7.3-60.0.1 concaveman_1.1.0
[57] DelayedArray_0.28.0 classInt_0.4-10 rjson_0.2.21 units_0.8-5
[61] tools_4.3.3 vipor_0.4.7 beeswarm_0.4.0 httpuv_1.6.15
[65] glue_1.7.0 callr_3.7.6 EBImage_4.44.0 rhdf5filters_1.14.1
[69] promises_1.2.1 sf_1.0-16 grid_4.3.3 generics_0.1.3
[73] gtable_0.3.4 tzdb_0.4.0 class_7.3-22 tidyr_1.3.1
[77] data.table_1.15.2 hms_1.1.3 tidygraph_1.3.1 sp_2.1-3
[81] utf8_1.2.4 XVector_0.42.0 stringr_1.5.1 ggrepel_0.9.5
[85] pillar_1.9.0 vroom_1.6.5 later_1.3.2 dplyr_1.1.4
[89] tweenr_2.0.3 lattice_0.22-6 bit_4.0.5 tidyselect_1.2.1
[93] locfit_1.5-9.9 scuttle_1.12.0 gridExtra_2.3 svglite_2.1.3
[97] shinydashboard_0.7.2 graphlayouts_1.1.1 pheatmap_1.0.12 DT_0.32
[101] stringi_1.8.3 fftwtools_0.9-11 codetools_0.2-19 ggraph_2.2.1
[105] tibble_3.2.1 cli_3.6.2 xtable_1.8-4 systemfonts_1.0.6
[109] munsell_0.5.0 processx_3.8.4 Rcpp_1.0.12 png_0.1-8
[113] parallel_4.3.3 ggplot2_3.5.0 readr_2.1.5 jpeg_0.1-10
[117] sparseMatrixStats_1.14.0 bitops_1.0-7 viridisLite_0.4.2 e1071_1.7-14
[121] scales_1.3.0 purrr_1.0.2 crayon_1.5.2 rlang_1.1.3
[125] distances_0.1.10`

SchulzDan commented 6 months ago

Hi @jonhsussman, sorry for the late reply, Is this still an issue? Not sure what the limit was that we tested this on, would have to find out. Best, Daniel