GreenleafLab / ArchR

ArchR : Analysis of Regulatory Chromatin in R (www.ArchRProject.com)
MIT License
387 stars 139 forks source link

error in addGroupCoverages(ArchRProj = mp, groupBy = "Sample") #2013

Open yangchao4 opened 1 year ago

yangchao4 commented 1 year ago

Hello, I found an error in this mp<-addGroupCoverages(ArchRProj = mp, groupBy = "Sample") command.

Here is the code and the error message

mp <- addGroupCoverages(ArchRProj = mp, groupBy = "Sample") ArchR logging to : ArchRLogs/ArchR-addGroupCoverages-199f6f5b278588-Date-2023-09-03_Time-23-42-10.log If there is an issue, please report to github with logFile! 2023-09-03 23:42:11 : Creating Coverage Files!, 0.017 mins elapsed. 2023-09-03 23:42:11 : Batch Execution w/ safelapply!, 0.017 mins elapsed. 2023-09-03 23:43:02 : Adding Kmer Bias to Coverage Files!, 0.865 mins elapsed. Error in .safelapply(seq_along(availableChr), function(x) { : Error Found Iteration 1 : [1] "Error in .logError(e, fn = \".addKmerBiasToCoverage\", info = \"\", errorList = errorList, : \n Exiting See Error Above\n" <simpleError in .logError(e, fn = ".addKmerBiasToCoverage", info = "", errorList = errorList, logFile = logFile): Exiting See Error Above> Error Found Iteration 2 : [1] "Error in .logError(e, fn = \".addKmerBiasToCoverage\", info = \"\", errorList = errorList, : \n Exiting See Error Above\n" <simpleError in .logError(e, fn = ".addKmerBiasToCoverage", info = "", errorList = errorList, logFile = logFile): Exiting See Error Above> Error Found Iteration 3 : [1] "Error in .logError(e, fn = \".addKmerBiasToCoverage\", info = \"\", errorList = errorList, : \n Exiting See Error Above\n" <simpleError in .logError(e, fn = ".addKmerBiasToCoverage", info = "", errorList = errorList, logFile = logFile): Exiting See Error Above> Error Found Iteration 4 : [1] "Error in .logError(e, fn = \".addKmerBiasToCoverag 此外: Warning message: In mclapply(..., mc.cores = threads, mc.preschedule = preschedule) : 21 function calls resulted in an error

and traceback() information

traceback() 6: stop(errorMsg) 5: .safelapply(seq_along(availableChr), function(x) { .logMessage(sprintf("Kmer Bias %s (%s of %s)", availableChr[x], x, length(availableChr)), logFile = logFile) message(availableChr[x], " ", appendLF = FALSE) chrBS <- BSgenome[[availableChr[x]]] exp <- Biostrings::oligonucleotideFrequency(chrBS, width = kmerLength) obsList <- lapply(seq_along(coverageFiles), function(y) { .logMessage(sprintf("Coverage File %s (%s of %s)", availableChr[x], y, length(coverageFiles)), logFile = logFile) tryCatch({ obsx <- .getCoverageInsertionSites(coverageFiles[y], availableChr[x]) %>% { BSgenome::Views(chrBS, IRanges(start = . - floor(kmerLength/2), width = kmerLength)) } %>% { Biostrings::oligonucleotideFrequency(., width = kmerLength, simplify.as = "collapsed") } tryCatch({ gc() }, error = function(e) { }) obsx }, error = function(e) { errorList <- list(y = y, coverageFile = coverageFiles[y], chr = availableChr[x], iS = tryCatch({ .getCoverageInsertionSites(coverageFiles[y], availableChr[x]) }, error = function(e) { "Error .getCoverageInsertionSites" })) .logError(e, fn = ".addKmerBiasToCoverage", info = "", errorList = errorList, logFile = logFile) }) }) %>% SimpleList names(obsList) <- names(coverageFiles) SimpleList(expected = exp, observed = obsList) }, threads = threads) 4: SimpleList(.) 3: .safelapply(seq_along(availableChr), function(x) { .logMessage(sprintf("Kmer Bias %s (%s of %s)", availableChr[x], x, length(availableChr)), logFile = logFile) message(availableChr[x], " ", appendLF = FALSE) chrBS <- BSgenome[[availableChr[x]]] exp <- Biostrings::oligonucleotideFrequency(chrBS, width = kmerLength) obsList <- lapply(seq_along(coverageFiles), function(y) { .logMessage(sprintf("Coverage File %s (%s of %s)", availableChr[x], y, length(coverageFiles)), logFile = logFile) tryCatch({ obsx <- .getCoverageInsertionSites(coverageFiles[y], availableChr[x]) %>% { BSgenome::Views(chrBS, IRanges(start = . - floor(kmerLength/2), width = kmerLength)) } %>% { Biostrings::oligonucleotideFrequency(., width = kmerLength, simplify.as = "collapsed") } tryCatch({ gc() }, error = function(e) { }) obsx }, error = function(e) { errorList <- list(y = y, coverageFile = coverageFiles[y], chr = availableChr[x], iS = tryCatch({ .getCoverageInsertionSites(coverageFiles[y], availableChr[x]) }, error = function(e) { "Error .getCoverageInsertionSites" })) .logError(e, fn = ".addKmerBiasToCoverage", info = "", errorList = errorList, logFile = logFile) }) }) %>% SimpleList names(obsList) <- names(coverageFiles) SimpleList(expected = exp, observed = obsList) }, threads = threads) %>% SimpleList 2: .addKmerBiasToCoverage(coverageMetadata = coverageMetadata, genome = getGenome(ArchRProj), kmerLength = kmerLength, threads = threads, verbose = FALSE, logFile = logFile) 1: addGroupCoverages(ArchRProj = mp, groupBy = "Sample")

here is the session information

sessionInfo() R version 4.0.5 (2021-03-31) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-serial/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-serial/liblapack.so.3

locale:
 [1] LC_CTYPE=zh_CN.UTF-8       LC_NUMERIC=C               LC_TIME=zh_CN.UTF-8        LC_COLLATE=zh_CN.UTF-8    
 [5] LC_MONETARY=zh_CN.UTF-8    LC_MESSAGES=zh_CN.UTF-8    LC_PAPER=zh_CN.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=zh_CN.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] ArchR_1.0.2                        patchwork_1.1.3                    harmony_1.0                       
 [4] Rcpp_1.0.11                        SingleR_1.4.1                      lubridate_1.9.2                   
 [7] forcats_1.0.0                      stringr_1.5.0                      dplyr_1.1.2                       
[10] purrr_1.0.2                        readr_2.1.4                        tidyr_1.3.0                       
[13] tibble_3.2.1                       tidyverse_2.0.0                    SeuratObject_4.1.3                
[16] Seurat_4.3.0.1                     BiocManager_1.30.22                BSgenome.Mmusculus.UCSC.mm10_1.4.0
[19] BSgenome_1.58.0                    rtracklayer_1.50.0                 Biostrings_2.58.0                 
[22] XVector_0.30.0                     magrittr_2.0.3                     rhdf5_2.34.0                      
[25] Matrix_1.6-1                       data.table_1.14.8                  SummarizedExperiment_1.20.0       
[28] Biobase_2.50.0                     GenomicRanges_1.42.0               GenomeInfoDb_1.26.7               
[31] IRanges_2.24.1                     S4Vectors_0.32.4                   BiocGenerics_0.40.0               
[34] MatrixGenerics_1.2.1               matrixStats_1.0.0                  ggplot2_3.4.3                     
[37] installr_0.23.4                   

loaded via a namespace (and not attached):
  [1] utf8_1.2.3                        spatstat.explore_3.2-1            reticulate_1.31                  
  [4] tidyselect_1.2.0                  htmlwidgets_1.6.2                 grid_4.0.5                       
  [7] BiocParallel_1.24.1               Rtsne_0.16                        devtools_2.4.5                   
 [10] munsell_0.5.0                     codetools_0.2-19                  ica_1.0-3                        
 [13] future_1.31.0                     miniUI_0.1.1.1                    withr_2.5.0                      
 [16] spatstat.random_3.1-5             colorspace_2.1-0                  progressr_0.14.0                 
 [19] rstudioapi_0.15.0                 ROCR_1.0-11                       tensor_1.5                       
 [22] listenv_0.9.0                     GenomeInfoDbData_1.2.4            polyclip_1.10-4                  
 [25] pheatmap_1.0.12                   parallelly_1.34.0                 vctrs_0.6.3                      
 [28] generics_0.1.3                    timechange_0.2.0                  R6_2.5.1                         
 [31] clue_0.3-64                       rsvd_1.0.5                        cachem_1.0.8                     
 [34] bitops_1.0-7                      rhdf5filters_1.2.1                spatstat.utils_3.0-3             
 [37] DelayedArray_0.20.0               promises_1.2.1                    scales_1.2.1                     
 [40] gtable_0.3.4                      beachmat_2.10.0                   Cairo_1.6-1                      
 [43] globals_0.16.2                    processx_3.8.2                    goftest_1.2-3                    
 [46] rlang_1.1.1                       GlobalOptions_0.1.2               splines_4.0.5                    
 [49] lazyeval_0.2.2                    spatstat.geom_3.2-4               reshape2_1.4.4                   
 [52] abind_1.4-5                       httpuv_1.6.11                     rsconnect_1.0.2                  
 [55] usethis_2.2.2                     tools_4.0.5                       ellipsis_0.3.2                   
 [58] RColorBrewer_1.1-3                sessioninfo_1.2.2                 ggridges_0.5.4                   
 [61] plyr_1.8.8                        sparseMatrixStats_1.2.1           zlibbioc_1.36.0                  
 [64] RCurl_1.98-1.12                   prettyunits_1.1.1                 ps_1.7.5                         
 [67] deldir_1.0-9                      pbapply_1.7-2                     GetoptLong_1.0.5                 
 [70] urlchecker_1.0.1                  cowplot_1.1.1                     zoo_1.8-12                       
 [73] ggrepel_0.9.3                     cluster_2.1.4                     fs_1.6.3                         
 [76] scattermore_1.2                   circlize_0.4.15                   lmtest_0.9-40                    
 [79] RANN_2.6.1                        fitdistrplus_1.1-11               pkgload_1.3.2.1                  
 [82] hms_1.1.3                         mime_0.12                         xtable_1.8-4                     
 [85] XML_3.99-0.14                     gridExtra_2.3                     shape_1.4.6                      
 [88] compiler_4.0.5                    KernSmooth_2.23-22                crayon_1.5.2                     
 [91] htmltools_0.5.6                   later_1.3.1                       tzdb_0.4.0                       
 [94] DBI_1.1.3                         ComplexHeatmap_2.6.2              MASS_7.3-60                      
 [97] cli_3.6.1                         igraph_1.5.1                      pkgconfig_2.0.3                  
[100] GenomicAlignments_1.26.0          sp_2.0-0                          plotly_4.10.2                    
[103] spatstat.sparse_3.0-2             BSgenome.Hsapiens.UCSC.hg38_1.4.3 callr_3.7.3                      
[106] digest_0.6.33                     sctransform_0.3.5                 RcppAnnoy_0.0.21                 
[109] spatstat.data_3.0-1               leiden_0.4.3                      uwot_0.1.16                      
[112] DelayedMatrixStats_1.12.3         curl_5.0.2                        shiny_1.7.5                      
[115] Rsamtools_2.6.0                   gtools_3.9.4                      rjson_0.2.21                     
[118] lifecycle_1.0.3                   nlme_3.1-163                      jsonlite_1.8.7                   
[121] Rhdf5lib_1.12.1                   BiocNeighbors_1.8.2               viridisLite_0.4.2                
[124] fansi_1.0.4                       pillar_1.9.0                      lattice_0.21-8                   
[127] pkgbuild_1.4.2                    fastmap_1.1.1                     httr_1.4.7                       
[130] survival_3.5-7                    remotes_2.4.2.1                   glue_1.6.2                       
[133] shinythemes_1.2.0                 rhandsontable_0.3.8               png_0.1-8                        
[136] presto_1.0.0                      profvis_0.3.8                     stringi_1.7.12                   
[139] BiocSingular_1.6.0                memoise_2.0.1                     irlba_2.3.5.1                    
[142] future.apply_1.10.0  

I don't know how to solve this problem. Could you please take a look and help me? Thank you very much. ArchR-addGroupCoverages-199f6f6e5b436b-Date-2023-09-03_Time-23-01-27.log

rcorces commented 1 year ago

Hi @yangchao4! Thanks for using ArchR! Please make sure that your post belongs in the Issues section. Only bugs and error reports belong in the Issues section. Usage questions and feature requests should be posted in the Discussions section, not in Issues.
It is worth noting that there are very few actual bugs in ArchR. If you are getting an error, it is probably something specific to your dataset, usage, or computational environment, all of which are extremely challenging to troubleshoot. As such, we require reproducible examples (preferably using the tutorial dataset) from users who want assistance. If you cannot reproduce your error, we will not be able to help. Before going through the work of making a reproducible example, search the previous Issues, Discussions, function definitions, or the ArchR manual and you will likely find the answers you are looking for. If your post does not contain a reproducible example, it is unlikely to receive a response.
In addition to a reproducible example, you must do the following things before we help you, unless your original post already contained this information: 1. If you've encountered an error, have you already searched previous Issues to make sure that this hasn't already been solved? 2. Did you post your log file? If not, add it now. 3.__ Remove any screenshots that contain text and instead copy and paste the text using markdown's codeblock syntax (three consecutive backticks). You can do this by editing your original post.

yangchao4 commented 1 year ago

Thank you for your response. I have included the error message, code snippets, log files, and version information, and I am also trying to reproduce this issue using the tutorial files.