tanaylab / metacell

Metacell - Single-cell mRNA Analysis
https://tanaylab.github.io/metacell
Other
105 stars 29 forks source link

R kernel keeps dying when running mcell_mc_from_coclust_balanced() #48

Open zhenzuo2 opened 3 years ago

zhenzuo2 commented 3 years ago

caught segfault address 0x558cbaa2fc00, cause 'memory not mapped'

Traceback: 1: tgs_graph_cover(edges, min_mc_size, cooling = tgs_clust_cool, burn_in = tgs_clust_burn) 2: mcell_mc_from_coclust_balanced(coc_id = "retina_coc500", mat_id = "retina", mc_id = "retina_mc", K = 30, min_mc_size = 30, alpha = 2) 3: eval(expr, envir, enclos) 4: eval(expr, envir, enclos) 5: withVisible(eval(expr, envir, enclos)) 6: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, error = eHandler, message = mHandler) 7: doTryCatch(return(expr), name, parentenv, handler) 8: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 9: tryCatchList(expr, classes, parentenv, handlers) 10: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call)[1L] prefix <- paste("Error in", dcall, ": ") LONG <- 75L sm <- strsplit(conditionMessage(e), "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w > LONG) prefix <- paste0(prefix, "\n ") } else prefix <- "Error : " msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))}) 11: try(f, silent = TRUE) 12: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)) 13: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, error = eHandler, message = mHandler))) 14: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, debug = debug, last = i == length(out), use_try = stop_on_error != 2L, keep_warning = keep_warning, keep_message = keep_message, output_handler = output_handler, include_timing = include_timing) 15: evaluate(request$content$code, envir = .GlobalEnv, output_handler = oh, stop_on_error = 1L) 16: doTryCatch(return(expr), name, parentenv, handler) 17: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 18: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) 19: doTryCatch(return(expr), name, parentenv, handler) 20: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]]) 21: tryCatchList(expr, classes, parentenv, handlers) 22: tryCatch(evaluate(request$content$code, envir = .GlobalEnv, output_handler = oh, stop_on_error = 1L), interrupt = function(cond) { log_debug("Interrupt during execution") interrupted <<- TRUE}, error = .self$handle_error) 23: executor$execute(msg) 24: handle_shell() 25: kernel$run() 26: IRkernel::main() An irrecoverable exception occurred. R is aborting now ...

zhenzuo2 commented 3 years ago

R version 4.1.0 (2021-05-18) Platform: x86_64-conda-linux-gnu (64-bit) Running under: Red Hat Enterprise Linux Server 7.3 (Maipo)

Matrix products: default BLAS/LAPACK: /storage/chen/home/zz4/miniconda3/lib/libopenblasp-r0.3.15.so

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

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

other attached packages: [1] SingleCellExperiment_1.14.1 SummarizedExperiment_1.22.0 [3] Biobase_2.52.0 GenomicRanges_1.44.0
[5] GenomeInfoDb_1.28.0 IRanges_2.26.0
[7] S4Vectors_0.30.0 BiocGenerics_0.38.0
[9] MatrixGenerics_1.4.0 matrixStats_0.59.0
[11] metacell_0.3.6

loaded via a namespace (and not attached): [1] Rcpp_1.0.6 lattice_0.20-44 tidyr_1.1.3
[4] png_0.1-7 zoo_1.8-9 assertthat_0.2.1
[7] digest_0.6.27 utf8_1.2.1 RSpectra_0.16-0
[10] IRdisplay_1.0 R6_2.5.0 repr_1.1.3
[13] evaluate_0.14 ggplot2_3.3.3 pillar_1.6.1
[16] zlibbioc_1.38.0 rlang_0.4.11 uuid_0.1-4
[19] Rgraphviz_2.36.0 Matrix_1.3-3 pdist_1.2
[22] reticulate_1.20 RCurl_1.98-1.3 igraph_1.2.6
[25] tgstat_2.3.16 munsell_0.5.0 umap_0.2.7.0
[28] DelayedArray_0.18.0 compiler_4.1.0 pkgconfig_2.0.3
[31] askpass_1.1 base64enc_0.1-3 htmltools_0.5.1.1
[34] openssl_1.4.4 tidyselect_1.1.1 GenomeInfoDbData_1.2.6 [37] tibble_3.1.2 tgconfig_0.1.2 fansi_0.5.0
[40] crayon_1.4.1 dplyr_1.0.6 bitops_1.0-7
[43] grid_4.1.0 tgutil_0.1.6 jsonlite_1.7.2
[46] gtable_0.3.0 lifecycle_1.0.0 DBI_1.1.1
[49] magrittr_2.0.1 scales_1.1.1 graph_1.70.0
[52] XVector_0.32.0 dbscan_1.1-8 ellipsis_0.3.2
[55] generics_0.1.0 vctrs_0.3.8 IRkernel_1.2
[58] lpSolveAPI_5.5.2.0-17.7 tools_4.1.0 glue_1.4.2
[61] purrr_0.3.4 yaml_2.2.1 colorspace_2.0-1
[64] cluster_2.1.2 pbdZMQ_0.3-5

zhenzuo2 commented 3 years ago

I got this dead kernel when running mcell_mc_from_coclust_balanced(). It also shows

filtered NA left with NA based on co-cluster imbalance

zhenzuo2 commented 3 years ago

Another issue is mcell_coclust_filt_by_k_deg(). I have to rename cell labels to "1", "2", .... or as.numeric(names(thresh_Kr)) will not work.

akhiadber commented 3 years ago

as.numeric(names(thresh_Kr)) should work with parsable strings, not just "1". However, this issue appears to happen to multiple users lately, possibly related to the R version 4.1.0. I haven't reproduced this issue yet, will write back quickly when we find a workaround. In the meantime, you can try to downgrade R.

zhenzuo2 commented 3 years ago

That is correct. I have no issue with R4.0.5

akhiadber commented 3 years ago

Thanks for the info, will update

akhiadber commented 3 years ago

This issue should be solved now for 4.1.0 as well, please let us know if you encounter any other problems with the current R versions.