Skip to content

❗️R session crashes on preprocess_cds() with both full and subset data #753

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

Open
evanbio opened this issue Apr 23, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@evanbio
Copy link

evanbio commented Apr 23, 2025

🧠 Summary

Using preprocess_cds() causes RStudio to crash with no error, showing “R Session Aborted” dialog.

This occurs both on full dataset (~20k genes × 40k cells) and even when subsetting to 5k genes × 2k cells.

Issue persists even after reinstalling monocle3 from GitHub.

🔬 Reproducible Example

library(monocle3)

expression_matrix <- readRDS(url("https://depts.washington.edu:/trapnell-lab/software/monocle3/celegans/data/cao_l2_expression.rds"))
cell_metadata <- readRDS(url("https://depts.washington.edu:/trapnell-lab/software/monocle3/celegans/data/cao_l2_colData.rds"))
gene_annotation <- readRDS(url("https://depts.washington.edu:/trapnell-lab/software/monocle3/celegans/data/cao_l2_rowData.rds"))

cds <- new_cell_data_set(expression_matrix,
                         cell_metadata = cell_metadata,
                         gene_metadata = gene_annotation)

# This line causes R session to crash
cds <- preprocess_cds(cds, num_dim = 100)

Even this crashes:

cds_small <- cds[1:5000, sample(1:ncol(cds), 2000)]
cds_small <- preprocess_cds(cds_small, num_dim = 30)

🖥 Session Info
R version 4.5.0 (2025-04-11 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26100)

Matrix products: default
LAPACK version 3.12.1

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.utf8
[2] LC_CTYPE=Chinese (Simplified)_China.utf8
[3] LC_MONETARY=Chinese (Simplified)_China.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.utf8

time zone: Asia/Shanghai
tzcode source: internal

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

other attached packages:
[1] dplyr_1.1.4.9000 monocle3_1.3.7
[3] SingleCellExperiment_1.29.2 SummarizedExperiment_1.37.0
[5] GenomicRanges_1.59.1 GenomeInfoDb_1.43.4
[7] IRanges_2.41.3 S4Vectors_0.45.4
[9] MatrixGenerics_1.19.1 matrixStats_1.5.0
[11] Biobase_2.67.0 BiocGenerics_0.53.6
[13] generics_0.1.3 irlba_2.3.5.1
[15] Matrix_1.7-3 evanverse_0.1.0

loaded via a namespace (and not attached):
[1] tidyselect_1.2.1 blob_1.2.4
[3] Biostrings_2.75.4 fastmap_1.2.0
[5] XML_3.99-0.18 digest_0.6.37
[7] lifecycle_1.0.4 KEGGREST_1.47.1
[9] RSQLite_2.3.9 magrittr_2.0.3
[11] compiler_4.5.0 rlang_1.1.6
[13] tools_4.5.0 igraph_2.1.4
[15] data.table_1.17.0 S4Arrays_1.7.3
[17] bit_4.6.0 DelayedArray_0.33.6
[19] plyr_1.8.9 abind_1.4-8
[21] purrr_1.0.4 grid_4.5.0
[23] xtable_1.8-4 colorspace_2.1-1
[25] future_1.40.0 ggplot2_3.5.2
[27] globals_0.17.0 scales_1.3.0
[29] MASS_7.3-65 cli_3.6.4
[31] crayon_1.5.3 reformulas_0.4.0
[33] rstudioapi_0.17.1 httr_1.4.7
[35] minqa_1.2.8 DBI_1.2.3
[37] cachem_1.1.0 splines_4.5.0
[39] assertthat_0.2.1 parallel_4.5.0
[41] AnnotationDbi_1.69.1 BiocManager_1.30.25
[43] XVector_0.47.2 vctrs_0.6.5
[45] boot_1.3-31 jsonlite_2.0.0
[47] bit64_4.6.0-1 GSEABase_1.69.1
[49] listenv_0.9.1 tidyr_1.3.1
[51] annotate_1.85.0 glue_1.8.0
[53] parallelly_1.43.0 nloptr_2.2.1
[55] codetools_0.2-20 gtable_0.3.6
[57] UCSC.utils_1.3.1 lme4_1.1-37
[59] munsell_0.5.1 tibble_3.2.1
[61] pillar_1.10.2 graph_1.85.3
[63] GenomeInfoDbData_1.2.14 R6_2.6.1
[65] Rdpack_2.6.4 lattice_0.22-7
[67] rbibutils_2.3 png_0.1-8
[69] memoise_2.0.1 Rcpp_1.0.14
[71] SparseArray_1.7.7 nlme_3.1-168
[73] pkgconfig_2.0.3

@evanbio evanbio added the bug Something isn't working label Apr 23, 2025
@evanbio
Copy link
Author

evanbio commented Apr 23, 2025

🔎 Additional Observation (2025-04-23 update)
Just to add a quick note:

I tested the same workflow under a different R version and found that:

✅ Using R 4.3.2, preprocess_cds() runs smoothly, even on larger datasets.

❌ In contrast, with R 4.5.0, it consistently crashes at the PCA step (irlba::irlba), even on smaller subsets.

I'm not entirely sure where the incompatibility lies (e.g., ABI changes, Matrix versioning, etc.), but this might help narrow down the issue.

Thanks again for maintaining this great package!

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