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

plotBrowserTrack Error in .logError(e, fn = ".groupRegionSumArrows", info = .sampleName(ArrowFiles[i]), : Exiting See Error Above #2248

Open
danli349 opened this issue Dec 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@danli349
Copy link

Hello:

When I try to do plotBrowserTrack using a specific sample,

Samples <- projHeme$Sample
Samples2 <- Samples[!duplicated(Samples)]
for(i in 1:length(Samples2)){
    idxSample <- BiocGenerics::which(projHeme3$Sample %in% Samples2[i])
    cellsSample <- projHeme3$cellNames[idxSample]
    tmp <- projHeme3[cellsSample, ]
    p <- plotBrowserTrack(
        ArchRProj = tmp, 
        groupBy = "Clusters2", 
        geneSymbol = markerGenes, 
        upstream = 50000,
        downstream = 20000)
    for(j in 1:length(p)){
        pdf(paste0("plotBrowserTrack_",markerGenes[j],"_cluster_by_RNA_", Samples2[i], "_only.pdf",sep=""))
        grid::grid.newpage()
        grid::grid.draw(p[[j]])
        dev.off()
        }
    }

I got this error:

ArchR logging to : ArchRLogs/ArchR-plotBrowserTrack-8ec10712fc1-Date-2024-12-18_Time-17-22-06.038219.log
If there is an issue, please report to github with logFile!

2024-12-18 17:22:06.195084 : Validating Region, 0.003 mins elapsed.

GRanges object with 2 ranges and 2 metadata columns:
      seqnames            ranges strand |     gene_id      symbol
         <Rle>         <IRanges>  <Rle> | <character> <character>
  [1]     chr4 89274473-89294619      - |       12578      Cdkn2a
  [2]     chr7 89954654-89980976      - |       13626         Eed
  -------
  seqinfo: 21 sequences from mm10 genome
2024-12-18 17:22:06.258429 : Adding Bulk Tracks (1 of 2), 0.004 mins elapsed.

Getting Region From Arrow Files 1 of 1


************************************************************
2024-12-18 17:22:07.963247 : ERROR Found in .groupRegionSumArrows for PECN_POS_4 
LogFile = ArchRLogs/ArchR-plotBrowserTrack-8ec10712fc1-Date-2024-12-18_Time-17-22-06.038219.log

<subscriptOutOfBoundsError in `[<-`(`*tmp*`, , uniqueGroups[i], value = Matrix::rowSums(mat[,     which(cellGroups == uniqueGroups[i]), drop = FALSE])): subscript out of bounds>

************************************************************

Error in .logError(e, fn = ".groupRegionSumArrows", info = .sampleName(ArrowFiles[i]), : Exiting See Error Above
Traceback:

1. lapply(seq_along(region), function(x) {
 .     plotList <- list()
 .     if ("bulktrack" %in% tolower(plotSummary)) {
 .         .logDiffTime(sprintf("Adding Bulk Tracks (%s of %s)", 
 .             x, length(region)), t1 = tstart, verbose = verbose, 
 .             logFile = logFile)
 .         plotList$bulktrack <- .bulkTracks(ArchRProj = ArchRProj, 
 .             region = region[x], tileSize = tileSize, groupBy = groupBy, 
 .             threads = threads, minCells = minCells, pal = pal, 
 .             ylim = ylim, baseSize = baseSize, borderWidth = borderWidth, 
 .             tickWidth = tickWidth, facetbaseSize = facetbaseSize, 
 .             normMethod = normMethod, geneAnnotation = geneAnnotation, 
 .             title = title, useGroups = useGroups, tstart = tstart, 
 .             logFile = logFile) + theme(plot.margin = unit(c(0.35, 
 .             0.75, 0.35, 0.75), "cm"))
 .     }
 .     if ("sctrack" %in% tolower(plotSummary)) {
 .         .logDiffTime(sprintf("Adding SC Tracks (%s of %s)", x, 
 .             length(region)), t1 = tstart, verbose = verbose, 
 .             logFile = logFile)
 .         plotList$sctrack <- .scTracks(ArchRProj = ArchRProj, 
 .             region = region[x], tileSize = tileSize, groupBy = groupBy, 
 .             threads = threads, minCells = 5, maxCells = scCellsMax, 
 .             pal = pal, baseSize = baseSize, borderWidth = borderWidth, 
 .             tickWidth = tickWidth, scTileSize = scTileSize, facetbaseSize = facetbaseSize, 
 .             geneAnnotation = geneAnnotation, title = title, useGroups = useGroups, 
 .             tstart = tstart, logFile = logFile) + theme(plot.margin = unit(c(0.35, 
 .             0.75, 0.35, 0.75), "cm"))
 .     }
 .     if ("featuretrack" %in% tolower(plotSummary)) {
 .         if (!is.null(features)) {
 .             .logDiffTime(sprintf("Adding Feature Tracks (%s of %s)", 
 .                 x, length(region)), t1 = tstart, verbose = verbose, 
 .                 logFile = logFile)
 .             plotList$featuretrack <- .featureTracks(features = features, 
 .                 region = region[x], facetbaseSize = facetbaseSize, 
 .                 hideX = TRUE, title = "Peaks", logFile = logFile) + 
 .                 theme(plot.margin = unit(c(0.1, 0.75, 0.1, 0.75), 
 .                   "cm"))
 .         }
 .     }
 .     if ("looptrack" %in% tolower(plotSummary)) {
 .         if (!is.null(loops)) {
 .             .logDiffTime(sprintf("Adding Loop Tracks (%s of %s)", 
 .                 x, length(region)), t1 = tstart, verbose = verbose, 
 .                 logFile = logFile)
 .             plotList$looptrack <- .loopTracks(loops = loops, 
 .                 region = region[x], facetbaseSize = facetbaseSize, 
 .                 hideX = TRUE, hideY = TRUE, title = "Loops", 
 .                 logFile = logFile) + theme(plot.margin = unit(c(0.1, 
 .                 0.75, 0.1, 0.75), "cm"))
 .         }
 .     }
 .     if ("genetrack" %in% tolower(plotSummary)) {
 .         .logDiffTime(sprintf("Adding Gene Tracks (%s of %s)", 
 .             x, length(region)), t1 = tstart, verbose = verbose, 
 .             logFile = logFile)
 .         plotList$genetrack <- .geneTracks(geneAnnotation = geneAnnotation, 
 .             region = region[x], facetbaseSize = facetbaseSize, 
 .             title = "Genes", logFile = logFile) + theme(plot.margin = unit(c(0.1, 
 .             0.75, 0.1, 0.75), "cm"))
 .     }
 .     plotSummary <- tolower(plotSummary)
 .     names(sizes) <- plotSummary
 .     sizes <- sizes[order(plotSummary)]
 .     plotSummary <- plotSummary[order(plotSummary)]
 .     sizes <- sizes[tolower(names(plotList))]
 .     if (!is.null(useMatrix)) {
 .         suppressWarnings(.combinedFeaturePlot(plotList = plotList, 
 .             log2Norm = log2Norm, featureMat = featureMat, feature = region[x]$symbol[[1]], 
 .             useMatrix = useMatrix, pal = pal, sizes = sizes, 
 .             baseSize = baseSize, facetbaseSize = facetbaseSize, 
 .             borderWidth = borderWidth, tickWidth = tickWidth))
 .     }
 .     else {
 .         .logThis(names(plotList), sprintf("(%s of %s) names(plotList)", 
 .             x, length(region)), logFile = logFile)
 .         .logThis(sizes, sprintf("(%s of %s) sizes", x, length(region)), 
 .             logFile = logFile)
 .         .logDiffTime("Plotting", t1 = tstart, verbose = verbose, 
 .             logFile = logFile)
 .         tryCatch({
 .             suppressWarnings(ggAlignPlots(plotList = plotList, 
 .                 sizes = sizes, draw = FALSE))
 .         }, error = function(e) {
 .             .logMessage("Error with plotting, diagnosing each element", 
 .                 verbose = TRUE, logFile = logFile)
 .             for (i in seq_along(plotList)) {
 .                 tryCatch({
 .                   print(plotList[[i]])
 .                 }, error = function(f) {
 .                   .logError(f, fn = names(plotList)[i], info = "", 
 .                     errorList = NULL, logFile = logFile)
 .                 })
 .             }
 .             .logError(e, fn = "ggAlignPlots", info = "", errorList = NULL, 
 .                 logFile = logFile)
 .         })
 .     }
 . })
2. FUN(X[[i]], ...)
3. .bulkTracks(ArchRProj = ArchRProj, region = region[x], tileSize = tileSize, 
 .     groupBy = groupBy, threads = threads, minCells = minCells, 
 .     pal = pal, ylim = ylim, baseSize = baseSize, borderWidth = borderWidth, 
 .     tickWidth = tickWidth, facetbaseSize = facetbaseSize, normMethod = normMethod, 
 .     geneAnnotation = geneAnnotation, title = title, useGroups = useGroups, 
 .     tstart = tstart, logFile = logFile)
4. .groupRegionSumArrows(ArchRProj = ArchRProj, groupBy = groupBy, 
 .     normMethod = normMethod, useGroups = useGroups, minCells = minCells, 
 .     region = region, tileSize = tileSize, threads = threads, 
 .     verbose = verbose, logFile = logFile)
5. .safelapply(seq_along(ArrowFiles), function(i) {
 .     .logMessage(sprintf("Getting Region From Arrow Files %s of %s", 
 .         i, length(ArrowFiles)), logFile = logFile)
 .     tryCatch({
 .         .regionSumArrows(ArrowFile = ArrowFiles[i], region = region, 
 .             regionTiles = regionTiles, tileSize = tileSize, cellNames = cellsBySample[[names(ArrowFiles)[i]]], 
 .             cellGroups = groupsBySample[[names(ArrowFiles)[i]]], 
 .             uniqueGroups = uniqueGroups)
 .     }, error = function(e) {
 .         errorList <- list(ArrowFile = ArrowFiles[i], region = region, 
 .             regionTiles = regionTiles, tileSize = tileSize, cellNames = cellsBySample[[names(ArrowFiles)[i]]], 
 .             cellGroups = groupsBySample[[names(ArrowFiles)[i]]], 
 .             uniqueGroups = uniqueGroups)
 .         .logError(e, fn = ".groupRegionSumArrows", info = .sampleName(ArrowFiles[i]), 
 .             errorList = errorList, logFile = logFile)
 .     })
 . }, threads = threads) %>% Reduce("+", .)
6. Reduce("+", .)
7. .safelapply(seq_along(ArrowFiles), function(i) {
 .     .logMessage(sprintf("Getting Region From Arrow Files %s of %s", 
 .         i, length(ArrowFiles)), logFile = logFile)
 .     tryCatch({
 .         .regionSumArrows(ArrowFile = ArrowFiles[i], region = region, 
 .             regionTiles = regionTiles, tileSize = tileSize, cellNames = cellsBySample[[names(ArrowFiles)[i]]], 
 .             cellGroups = groupsBySample[[names(ArrowFiles)[i]]], 
 .             uniqueGroups = uniqueGroups)
 .     }, error = function(e) {
 .         errorList <- list(ArrowFile = ArrowFiles[i], region = region, 
 .             regionTiles = regionTiles, tileSize = tileSize, cellNames = cellsBySample[[names(ArrowFiles)[i]]], 
 .             cellGroups = groupsBySample[[names(ArrowFiles)[i]]], 
 .             uniqueGroups = uniqueGroups)
 .         .logError(e, fn = ".groupRegionSumArrows", info = .sampleName(ArrowFiles[i]), 
 .             errorList = errorList, logFile = logFile)
 .     })
 . }, threads = threads)
8. mclapply(..., mc.cores = threads, mc.preschedule = preschedule)
9. lapply(X = X, FUN = FUN, ...)
10. FUN(X[[i]], ...)
11. tryCatch({
  .     .regionSumArrows(ArrowFile = ArrowFiles[i], region = region, 
  .         regionTiles = regionTiles, tileSize = tileSize, cellNames = cellsBySample[[names(ArrowFiles)[i]]], 
  .         cellGroups = groupsBySample[[names(ArrowFiles)[i]]], 
  .         uniqueGroups = uniqueGroups)
  . }, error = function(e) {
  .     errorList <- list(ArrowFile = ArrowFiles[i], region = region, 
  .         regionTiles = regionTiles, tileSize = tileSize, cellNames = cellsBySample[[names(ArrowFiles)[i]]], 
  .         cellGroups = groupsBySample[[names(ArrowFiles)[i]]], 
  .         uniqueGroups = uniqueGroups)
  .     .logError(e, fn = ".groupRegionSumArrows", info = .sampleName(ArrowFiles[i]), 
  .         errorList = errorList, logFile = logFile)
  . })
12. tryCatchList(expr, classes, parentenv, handlers)
13. tryCatchOne(expr, names, parentenv, handlers[[1L]])
14. value[[3L]](cond)
15. .logError(e, fn = ".groupRegionSumArrows", info = .sampleName(ArrowFiles[i]), 
  .     errorList = errorList, logFile = logFile)
16. stop("Exiting See Error Above")
17. .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))
  . }, "Exiting See Error Above", base::quote(.logError(e, fn = ".groupRegionSumArrows", 
  .     info = .sampleName(ArrowFiles[i]), errorList = errorList, 
  .     logFile = logFile)))

ArchR-plotBrowserTrack-8ec10712fc1-Date-2024-12-18_Time-17-22-06.038219.log

Could you please let me know how can I solve it?

Thanks a lot

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

rcorces commented Dec 18, 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.

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