neurogenomics / EpiCompare

Comparison, benchmarking & QC of epigenetic datasets
https://doi.org/doi:10.18129/B9.bioc.EpiCompare
12 stars 3 forks source link

`Error: processing vignette 'EpiCompare.Rmd' failed with diagnostics: [ENOENT] Failed to remove ` #138

Closed bschilder closed 1 year ago

bschilder commented 1 year ago

1. Bug description

Error occurs during devtools::check when building the EpiCompare.Rmd vignette, but not while running manually. So this is mostly just an issue for us (the developers) rather than the users.

Console output

==> devtools::check(document = FALSE, args = c('--as-cran'))

══ Building ════════════════════════════════════════════════════════════
Setting env vars:
• CFLAGS    : -Wall -pedantic -fdiagnostics-color=always
• CXXFLAGS  : -Wall -pedantic -fdiagnostics-color=always
• CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always
• CXX14FLAGS: -Wall -pedantic -fdiagnostics-color=always
• CXX17FLAGS: -Wall -pedantic -fdiagnostics-color=always
• CXX20FLAGS: -Wall -pedantic -fdiagnostics-color=always
── R CMD build ─────────────────────────────────────────────────────────
✔  checking for file ‘/Users/schilder/Desktop/EpiCompare/DESCRIPTION’ ...
─  preparing ‘EpiCompare’: (1.2s)
✔  checking DESCRIPTION meta-information ...
─  installing the package to build vignettes
E  creating vignettes (1m 7.8s)
   --- re-building ‘EpiCompare.Rmd’ using rmarkdown
   Quitting from lines 251-267 (EpiCompare.Rmd) 
   Quitting from lines 251-267 (EpiCompare.Rmd) 
   Error: processing vignette 'EpiCompare.Rmd' failed with diagnostics:
   [ENOENT] Failed to remove '/var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T/Rtmp54SsB7/filec7105471b9e3.rds': no such file or directory
   --- failed re-building ‘EpiCompare.Rmd’

   --- re-building ‘docker.Rmd’ using rmarkdown
   --- finished re-building ‘docker.Rmd’

   --- re-building ‘example_report.Rmd’ using rmarkdown
   --- finished re-building ‘example_report.Rmd’

   SUMMARY: processing the following file failed:
     ‘EpiCompare.Rmd’

   Error: Vignette re-building failed.
   Execution halted
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, …`:
! System command 'R' failed
---
Exit status: 1
stdout & stderr: <printed>
---
Backtrace:
 1. devtools::check(document = FALSE, args = c("--as-cran"), check_dir…
 2. withr::with_envvar(pkgbuild::compiler_flags(FALSE), action = "pref…
 3. base::force(code)
 4. pkgbuild::build(pkg$path, tempdir(), args = build_args, quiet = qu…
 5. withr::with_temp_libpaths(rcmd_build_tools(options$cmd, c(options$…
 6. base::force(code)
 7. pkgbuild::rcmd_build_tools(options$cmd, c(options$path, options$args), …
 8. pkgbuild::with_build_tools({ …
 9. base::withCallingHandlers(callr::rcmd_safe(..., env = env, spinner = FAL…
10. callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE, …
11. callr:::run_r(options)
12. base::with(options, with_envvar(env, do.call(processx::run, c(list(bin, …
13. base::with.default(options, with_envvar(env, do.call(processx::run, …
14. base::eval(substitute(expr), data, enclos = parent.frame())
15. base::eval(substitute(expr), data, enclos = parent.frame())
16. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args = real_cm…
17. base::force(code)
18. base::do.call(processx::run, c(list(bin, args = real_cmdargs, stdout_lin…
19. (function (command = NULL, args = character(), error_on_status = T…
20. base::throw(new_process_error(res, call = sys.call(), echo = echo, …
21. | base::signalCondition(cond)
22. (function (e) …
23. asNamespace("callr")$err$throw(e)
Execution halted

Exited with status 1.

Expected behaviour

Runs in both cases

2. Reproducible example

Code

(Please add the steps to reproduce the bug here. See here for an intro to making a reproducible example (i.e. reprex) and why they're important! This will help us to help you much faster.)

git clone https://github.com/neurogenomics/EpiCompare.git
cd EpiCompare
r
>  devtools::check(document = FALSE, args = c('--as-cran'))

3. Session info

(Add output of the R function utils::sessionInfo() below. This helps us assess version/OS conflicts which could be causing bugs.)

``` R version 4.2.1 (2022-06-23) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Monterey 12.4 Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] EpiCompare_1.3.3 loaded via a namespace (and not attached): [1] genomation_1.30.0 shadowtext_0.1.2 [3] ChIPseeker_1.34.1 AnnotationHub_3.6.0 [5] fastmatch_1.1-3 BiocFileCache_2.6.0 [7] plyr_1.8.8 igraph_1.4.0 [9] lazyeval_0.2.2 splines_4.2.1 [11] BiocParallel_1.32.5 gridBase_0.4-7 [13] GenomeInfoDb_1.34.9 ggplot2_3.4.1 [15] digest_0.6.31 yulab.utils_0.0.6 [17] htmltools_0.5.4 GOSemSim_2.24.0 [19] viridis_0.6.2 GO.db_3.16.0 [21] fansi_1.0.4 magrittr_2.0.3 [23] memoise_2.0.1 BSgenome_1.66.2 [25] tzdb_0.3.0 readr_2.1.4 [27] Biostrings_2.66.0 annotate_1.76.0 [29] graphlayouts_0.8.4 matrixStats_0.63.0 [31] enrichplot_1.18.3 prettyunits_1.1.1 [33] colorspace_2.1-0 blob_1.2.3 [35] rappdirs_0.3.3 ggrepel_0.9.3 [37] xfun_0.37 dplyr_1.1.0 [39] jsonlite_1.8.4 crayon_1.5.2 [41] RCurl_1.98-1.10 scatterpie_0.1.8 [43] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2 impute_1.72.3 [45] ape_5.6-2 glue_1.6.2 [47] polyclip_1.10-4 gtable_0.3.1 [49] zlibbioc_1.44.0 XVector_0.38.0 [51] DelayedArray_0.24.0 downloadthis_0.3.2 [53] BiocGenerics_0.44.0 scales_1.2.1 [55] DOSE_3.24.2 DBI_1.1.3 [57] Rcpp_1.0.10 plotrix_3.8-2 [59] viridisLite_0.4.1 xtable_1.8-4 [61] progress_1.2.2 tidytree_0.4.2 [63] gridGraphics_0.5-1 bit_4.0.5 [65] stats4_4.2.1 htmlwidgets_1.6.1 [67] httr_1.4.4 fgsea_1.24.0 [69] gplots_3.1.3 RColorBrewer_1.1-3 [71] ellipsis_0.3.2 pkgconfig_2.0.3 [73] XML_3.99-0.13 farver_2.1.1 [75] dbplyr_2.3.0 locfit_1.5-9.7 [77] utf8_1.2.3 ggplotify_0.1.0 [79] tidyselect_1.2.0 rlang_1.0.6 [81] reshape2_1.4.4 later_1.3.0 [83] AnnotationDbi_1.60.0 munsell_0.5.0 [85] BiocVersion_3.16.0 tools_4.2.1 [87] cachem_1.0.6 cli_3.6.0 [89] generics_0.1.3 RSQLite_2.2.20 [91] evaluate_0.20 stringr_1.5.0 [93] BRGenomics_1.10.0 fastmap_1.1.0 [95] yaml_2.3.7 ggtree_3.6.2 [97] knitr_1.42 bit64_4.0.5 [99] tidygraph_1.2.3 caTools_1.18.2 [101] purrr_1.0.1 KEGGREST_1.38.0 [103] ggraph_2.1.0 nlme_3.1-162 [105] mime_0.12 aplot_0.1.9 [107] xml2_1.3.3 biomaRt_2.54.0 [109] compiler_4.2.1 rstudioapi_0.14 [111] plotly_4.10.1 filelock_1.0.2 [113] curl_5.0.0 png_0.1-8 [115] interactiveDisplayBase_1.36.0 treeio_1.22.0 [117] tibble_3.1.8 tweenr_2.0.2 [119] geneplotter_1.76.0 stringi_1.7.12 [121] GenomicFeatures_1.50.4 lattice_0.20-45 [123] Matrix_1.5-3 vctrs_0.5.2 [125] pillar_1.8.1 lifecycle_1.0.3 [127] BiocManager_1.30.19 data.table_1.14.6 [129] cowplot_1.1.1 bitops_1.0-7 [131] httpuv_1.6.9 patchwork_1.1.2 [133] rtracklayer_1.58.0 GenomicRanges_1.50.2 [135] qvalue_2.30.0 R6_2.5.1 [137] BiocIO_1.8.0 promises_1.2.0.1 [139] KernSmooth_2.23-20 gridExtra_2.3 [141] IRanges_2.32.0 sessioninfo_1.2.2 [143] codetools_0.2-19 gtools_3.9.4 [145] boot_1.3-28.1 MASS_7.3-58.2 [147] assertthat_0.2.1 pkgload_1.3.2 [149] SummarizedExperiment_1.28.0 DESeq2_1.38.3 [151] rjson_0.2.21 withr_2.5.0 [153] GenomicAlignments_1.34.0 Rsamtools_2.14.0 [155] S4Vectors_0.36.1 GenomeInfoDbData_1.2.9 [157] parallel_4.2.1 hms_1.1.2 [159] grid_4.2.1 ggfun_0.0.9 [161] tidyr_1.3.0 HDO.db_0.99.1 [163] rmarkdown_2.20 MatrixGenerics_1.10.0 [165] seqPattern_1.30.0 ggforce_0.4.1 [167] Biobase_2.58.0 shiny_1.7.4 [169] restfulr_0.0.15 ```
bschilder commented 1 year ago

Related Issues:

bschilder commented 1 year ago
bschilder commented 1 year ago

Also, noting that it's strange that this only occurs on line 251 (the picard_files step) even though the step before it (peak_info) is nearly identical (just a slightly different dataframe).

```{r peak_info} 
peak_info_df <- peak_info(peaklist = peaklist,
                          blacklist = blacklist)
download_button(object = peak_info_df,
                filename = "peak_info_df", 
                output_extension = ".csv")
# Print table 
knitr::kable(peak_info_df, format = "markdown")
# Save output
save_output(save_output = params$save_output,
            file = peak_info_df,
            file_type = "data.frame",
            filename = "peak_info",
            outpath = outfile_dir)
# Remove variable
remove(peak_info_df) 

vs.

```{r picard_files} 
if (!is.null(params$picard_files)){
  fragment_info_df <- fragment_info(picard_list = params$picard_files)
  download_button(object = fragment_info_df,
                  filename = "fragment_info",
                  output_extension = ".csv")
  # Print data frame
  knitr::kable(fragment_info_df, format = "markdown") 
  save_output(save_output = params$save_output,
              file = fragment_info_df,
              file_type = "data.frame",
              filename = "fragment_info",
              outpath = outfile_dir) 
  remove(fragment_info_df)
}    
bschilder commented 1 year ago

Based on some clues from here https://github.com/r-lib/pkgdown/issues/825, tried removing my custom.css from the EpiCompare.Rmd template. But didn't seem to have any effect.

bschilder commented 1 year ago

Tried updating pandoc on my Mac system and then restarting R:

brew install pandoc
pandoc -v
# pandoc 3.1
# Features: +server +lua
# Scripting engine: Lua 5.4
# User data directory: /Users/schilder/.local/share/pandoc
# Copyright (C) 2006-2023 John MacFarlane. Web:  https://pandoc.org
# This is free software; see the source for copying conditions. There is no
# warranty, not even for merchantability or fitness for a particular purpose.

Had no effect.

bschilder commented 1 year ago

Tried adding self_contained: true to yaml header based on some clues from here https://github.com/rstudio/rmarkdown/pull/2095 No effect.

bschilder commented 1 year ago

Note that devtools::check(vignettes=F) does circumvent these issues. This confirms it is purely an issue with rendering the vignettes (not running the example/test code).

Indeed, all checks pass when running this way:

Screenshot 2023-02-16 at 15 15 49

bschilder commented 1 year ago

Suddenly all checks are now passing with the default devtools::check() in Rstudio, despite running the vignettes. No idea how this fixed itself, but it must have been related to one of the other fixes I made along the way!

Screenshot 2023-02-16 at 15 28 38