Skip to content

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

Open
@evanbio

Description

@evanbio

🧠 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions