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

addGroupCoverages: Error in rawToChar(bytes): embedded nul in string #2249

Open
danli349 opened this issue Dec 19, 2024 · 2 comments
Open

addGroupCoverages: Error in rawToChar(bytes): embedded nul in string #2249

danli349 opened this issue Dec 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@danli349
Copy link

Hello

How should I solve this problem?

projHeme4 <- addGroupCoverages(ArchRProj = projHeme3, groupBy = "Clusters")
ArchR logging to : ArchRLogs/ArchR-addGroupCoverages-18c6270fa3c2-Date-2024-12-19_Time-11-39-24.379498.log
If there is an issue, please report to github with logFile!

C1 (1 of 15) : CellGroups N = 3

C2 (2 of 15) : CellGroups N = 2

C3 (3 of 15) : CellGroups N = 5

C4 (4 of 15) : CellGroups N = 4

C5 (5 of 15) : CellGroups N = 2

C6 (6 of 15) : CellGroups N = 4

C7 (7 of 15) : CellGroups N = 5

C8 (8 of 15) : CellGroups N = 5

C9 (9 of 15) : CellGroups N = 5

C10 (10 of 15) : CellGroups N = 5

C11 (11 of 15) : CellGroups N = 5

C12 (12 of 15) : CellGroups N = 5

C13 (13 of 15) : CellGroups N = 5

C14 (14 of 15) : CellGroups N = 5

C15 (15 of 15) : CellGroups N = 5

2024-12-19 11:39:30.054384 : Creating Coverage Files!, 0.094 mins elapsed.

2024-12-19 11:39:30.059389 : Batch Execution w/ safelapply!, 0.094 mins elapsed.

Error in rawToChar(bytes): embedded nul in string: 'R_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\nR_zmq_msg_send errno: 4 strerr
Traceback:

1. .batchlapply(args)
2. do.call(.safelapply, args)
3. (function (..., threads = 1, preschedule = FALSE) 
 . {
 .     if (tolower(.Platform$OS.type) == "windows") {
 .         threads <- 1
 .     }
 .     if (threads > 1) {
 .         .requirePackage("parallel", source = "cran")
 .         o <- mclapply(..., mc.cores = threads, mc.preschedule = preschedule)
 .         errorMsg <- list()
 .         for (i in seq_along(o)) {
 .             if (inherits(o[[i]], "try-error")) {
 .                 capOut <- utils::capture.output(o[[i]])
 .                 capOut <- capOut[!grepl("attr\\(\\,|try-error", 
 .                   capOut)]
 .                 capOut <- head(capOut, 10)
 .                 capOut <- unlist(lapply(capOut, function(x) substr(x, 
 .                   1, 250)))
 .                 capOut <- paste0("\t", capOut)
 .                 errorMsg[[length(errorMsg) + 1]] <- paste0(c(paste0("Error Found Iteration ", 
 .                   i, " : "), capOut), "\n")
 .             }
 .         }
 .         if (length(errorMsg) != 0) {
 .             errorMsg <- unlist(errorMsg)
 .             errorMsg <- head(errorMsg, 50)
 .             errorMsg[1] <- paste0("\n", errorMsg[1])
 .             stop(errorMsg)
 .         }
 .     }
 .     else {
 .         o <- lapply(...)
 .     }
 .     o
 . })(X = 1:65, FUN = function (i = NULL, cellGroups, kmerBias = NULL, 
 .     kmerLength = 6, genome = NULL, ArrowFiles = NULL, cellsInArrow = NULL, 
 .     availableChr = NULL, chromLengths = NULL, covDir = NULL, 
 .     tstart = NULL, subThreads = 1, verbose = TRUE, logFile = NULL) 
 . {
 .     prefix <- sprintf("Group %s (%s of %s) :", names(cellGroups)[i], 
 .         i, length(cellGroups))
 .     cellGroupi <- cellGroups[[i]]
 .     namei <- make.names(names(cellGroups)[i])
 .     covFile <- file.path(covDir, paste0(namei, ".insertions.coverage.h5"))
 .     rmf <- .suppressAll(file.remove(covFile))
 .     .logDiffTime(sprintf("%s Creating Group Coverage File : %s", 
 .         prefix, basename(covFile)), tstart, verbose = verbose, 
 .         logFile = logFile)
 .     tableGroupi <- table(cellGroupi)
 .     .logThis(cellGroupi, paste0(prefix, " cellGroupi"), logFile = logFile)
 .     .logMessage(paste0("Number of Cells = ", length(cellGroups[[i]])), 
 .         logFile = logFile)
 .     o <- tryCatch({
 .         o <- h5closeAll()
 .         o <- h5createFile(covFile)
 .     }, error = function(e) {
 .         rmf <- .suppressAll(file.remove(covFile))
 .         o <- h5closeAll()
 .         o <- h5createFile(covFile)
 .     })
 .     if (file.exists(covFile)) {
 .         .logMessage("Coverage File Exists!", logFile = logFile)
 .     }
 .     else {
 .         .logMessage("Coverage File Does Not Exist!", logFile = logFile)
 .     }
 .     o <- h5closeAll()
 .     o <- h5createGroup(covFile, paste0("Coverage"))
 .     .logMessage("Added Coverage Group", logFile = logFile)
 .     o <- h5closeAll()
 .     o <- h5createGroup(covFile, paste0("Metadata"))
 .     .logMessage("Added Metadata Group", logFile = logFile)
 .     o <- h5closeAll()
 .     o <- h5write(obj = "ArrowCoverage", file = covFile, name = "Class")
 .     .logMessage("Added ArrowCoverage Class", logFile = logFile)
 .     o <- h5closeAll()
 .     o <- h5createGroup(covFile, paste0("Coverage/Info"))
 .     .logMessage("Added Coverage/Info", logFile = logFile)
 .     o <- h5closeAll()
 .     o <- h5write(as.character(cellGroupi), covFile, "Coverage/Info/CellNames")
 .     .logMessage("Added Coverage/Info/CellNames", logFile = logFile)
 .     nFragDump <- 0
 .     nCells <- c()
 .     for (k in seq_along(availableChr)) {
 .         .logDiffTime(sprintf("%s Processed Fragments Chr (%s of %s)", 
 .             prefix, k, length(availableChr)), tstart, verbose = FALSE, 
 .             logFile = logFile)
 .         it <- 0
 .         for (j in seq_along(ArrowFiles)) {
 .             cellsInI <- sum(cellsInArrow[[names(ArrowFiles)[j]]] %in% 
 .                 cellGroupi)
 .             if (cellsInI > 0) {
 .                 it <- it + 1
 .                 if (it == 1) {
 .                   fragik <- .getFragsFromArrow(ArrowFiles[j], 
 .                     chr = availableChr[k], out = "GRanges", cellNames = cellGroupi)
 .                 }
 .                 else {
 .                   fragik <- c(fragik, .getFragsFromArrow(ArrowFiles[j], 
 .                     chr = availableChr[k], out = "GRanges", cellNames = cellGroupi))
 .                 }
 .             }
 .         }
 .         matchRG <- as.vector(S4Vectors::match(mcols(fragik)$RG, 
 .             names(tableGroupi)))
 .         fragik <- rep(fragik, tableGroupi[matchRG])
 .         nCells <- c(nCells, unique(mcols(fragik)$RG))
 .         covk <- coverage(IRanges(start = c(start(fragik), end(fragik)), 
 .             width = 1), width = chromLengths[availableChr[k]])
 .         nFragDump <- nFragDump + length(fragik)
 .         rm(fragik)
 .         chrLengths <- paste0("Coverage/", availableChr[k], "/Lengths")
 .         chrValues <- paste0("Coverage/", availableChr[k], "/Values")
 .         lengthRle <- length(covk@lengths)
 .         o <- h5createGroup(covFile, paste0("Coverage/", availableChr[k]))
 .         o <- .suppressAll(h5createDataset(covFile, chrLengths, 
 .             storage.mode = "integer", dims = c(lengthRle, 1), 
 .             level = 0))
 .         o <- .suppressAll(h5createDataset(covFile, chrValues, 
 .             storage.mode = "integer", dims = c(lengthRle, 1), 
 .             level = 0))
 .         o <- h5write(obj = covk@lengths, file = covFile, name = chrLengths)
 .         o <- h5write(obj = covk@values, file = covFile, name = chrValues)
 .         gc()
 .     }
 .     if (length(unique(cellGroupi)) != length(unique(nCells))) {
 .         .logMessage(paste0("Not all cells (", length(unique(cellGroupi)), 
 .             ") were found for coverage creation (", length(unique(nCells)), 
 .             ")!"), logFile = logFile)
 .         stop("Not all cells (", length(unique(cellGroupi)), ") were found for coverage creation (", 
 .             length(unique(nCells)), ")!")
 .     }
 .     out <- list(covFile = covFile, nCells = length(cellGroupi), 
 .         nFragments = nFragDump)
 .     return(out)
 . }, cellGroups = new("SimpleCharacterList", elementType = "character", 
 .     elementMetadata = NULL, metadata = list(), listData = list(
 .         C1._.PECN_NEG_5 = c("PECN_NEG_5#ACGCACGGTTCTTTAG-1", ...)), covDir = "/mnt/d/R/seurat/Amish_Juan_PECN/Save-ProjHeme4/GroupCoverages/Clusters", 
 .     threads = 10L, verbose = TRUE, tstart = structure(1734626364.39807, class = c("POSIXct", 
 .     "POSIXt")), logFile = "ArchRLogs/ArchR-addGroupCoverages-18c6270fa3c2-Date-2024-12-19_Time-11-39-24.379498.log", 
 .     subThreads = 1)
4. mclapply(..., mc.cores = threads, mc.preschedule = preschedule)
5. warning(gettextf("%d function calls resulted in an error", has.errors), 
 .     domain = NA)
6. .signalSimpleWarning("50 function calls resulted in an error", 
 .     base::quote(mclapply(..., mc.cores = threads, mc.preschedule = preschedule)))
7. withRestarts({
 .     .Internal(.signalCondition(simpleWarning(msg, call), msg, 
 .         call))
 .     .Internal(.dfltWarn(msg, call))
 . }, muffleWarning = function() NULL)
8. withOneRestart(expr, restarts[[1L]])
9. doWithOneRestart(return(expr), restart)
10. (function (cnd) 
  . {
  .     if (getOption("warn") >= 2 || getOption("warn") < 0) {
  .         return()
  .     }
  .     watcher$capture_plot_and_output()
  .     if (on_warning$capture) {
  .         cnd <- sanitize_call(cnd)
  .         watcher$push(cnd)
  .     }
  .     if (on_warning$silence) {
  .         invokeRestart("muffleWarning")
  .     }
  . })(structure(list(message = "50 function calls resulted in an error", 
  .     call = mclapply(..., mc.cores = threads, mc.preschedule = preschedule)), class = c("simpleWarning", 
  . "warning", "condition")))
11. watcher$capture_plot_and_output()
12. capture_output()
13. sink_con()
14. read_con(con)
15. rawToChar(bytes)
16. .handleSimpleError(function (cnd) 
  . {
  .     watcher$capture_plot_and_output()
  .     cnd <- sanitize_call(cnd)
  .     watcher$push(cnd)
  .     switch(on_error, continue = invokeRestart("eval_continue"), 
  .         stop = invokeRestart("eval_stop"), error = invokeRestart("eval_error", 
  .             cnd))
  . }, "embedded nul in string: 'R_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerror: Interrupted system call\\nR_zmq_msg_send errno: 4 strerr", 
  .     base::quote(rawToChar(bytes)))

ArchR-addGroupCoverages-18c6270fa3c2-Date-2024-12-19_Time-11-39-24.379498.log

Thanks a lot

@danli349 danli349 added the bug Something isn't working label Dec 19, 2024
@rcorces
Copy link
Collaborator

rcorces commented Dec 19, 2024

Hi @danli349! Thanks for using ArchR! Lately, it has been very challenging for me to keep up with maintenance of this package and all of my other
responsibilities as a PI. I have not been responding to issue posts and I have not been pushing updates to the software. We are actively searching to hire
a computational biologist to continue to develop and maintain ArchR and related tools. If you know someone who might be a good fit, please let us know!
In the meantime, your issue will likely go without a reply. Most issues with ArchR right not relate to compatibility. Try reverting to R 4.1 and Bioconductor 3.15.
Newer versions of Seurat and Matrix also are causing issues. Sorry for not being able to provide active support for this package at this time.

@danli349
Copy link
Author

@rcorces
I solved this problem by reinstalling the new version ArchR

devtools::install_github("GreenleafLab/ArchR", ref="release_1.0.3", repos = BiocManager::repositories())

Thanks

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

2 participants