Bioconductor/BiocFileCache

Disable progress bar in bfcrpath

Closed this issue · 3 comments

LTLA commented

As requested by @lshep: currently, bfcrpath prints out a progress bar, which is nice in interactive sessions but annoying when compiling Rmarkdown documents. Ideally this could be turned off - or even better, diverted to the "message" stream so that knitr automatically knows that it is not the output of a function and ignores it.

lshep commented

What sort of settings do you have in your vignette that knitr doesn't automatically pick it up? We certainly can have it divert but in its current state when I knitr a vignette it doesn't show the progress bar as part of the output already and when I run a non interactive session it also does not show the progress bar. So is there a more specific case you are seeing this appear?

LTLA commented

Minimum example would be something like:

---
title: yada yada yada
author:
- name: Aaron T. L. Lun
output:
  BiocStyle::html_document
---

```{r style, echo=FALSE, results='hide', message=FALSE}
library(BiocStyle)
library(knitr)
opts_chunk$set(error=FALSE, message=FALSE, warning=FALSE)
opts_chunk$set(fig.asp=1)
```

Blah blah blah

```{r}
library(BiocFileCache)
bfc <- BiocFileCache("raw_data", ask = FALSE)
lun.zip <- bfcrpath(bfc,
    file.path("https://www.ebi.ac.uk/arrayexpress/files",
        "E-MTAB-5522/E-MTAB-5522.processed.1.zip"))
lun.sdrf <- bfcrpath(bfc,
    file.path("https://www.ebi.ac.uk/arrayexpress/files",
        "E-MTAB-5522/E-MTAB-5522.sdrf.txt"))
```

... when, compiled with rmarkdown::render, gives me a HTML containing the progress bar.

Session information
R version 3.5.0 Patched (2018-04-30 r74679)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS

Matrix products: default
BLAS: /home/cri.camres.org/lun01/Software/R/R-3-5-branch/lib/libRblas.so
LAPACK: /home/cri.camres.org/lun01/Software/R/R-3-5-branch/lib/libRlapack.so

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

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

other attached packages:
[1] bindrcpp_0.2.2      BiocFileCache_1.5.8 dbplyr_1.2.2       
[4] knitr_1.20          BiocStyle_2.9.6    

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.19       compiler_3.5.0     pillar_1.3.0       BiocManager_1.30.3
 [5] bindr_0.1.1        tools_3.5.0        digest_0.6.18      bit_1.1-14        
 [9] evaluate_0.12      RSQLite_2.1.1      memoise_1.1.0      tibble_1.4.2      
[13] pkgconfig_2.0.2    rlang_0.3.0        DBI_1.0.0          curl_3.2          
[17] yaml_2.2.0         xfun_0.3           dplyr_0.7.7        stringr_1.3.1     
[21] httr_1.3.1         rappdirs_0.3.1     rprojroot_1.3-2    bit64_0.9-7       
[25] tidyselect_0.2.5   glue_1.3.0         R6_2.3.0           rmarkdown_1.10    
[29] bookdown_0.7       purrr_0.2.5        blob_1.1.1         magrittr_1.5      
[33] backports_1.1.2    htmltools_0.3.6    assertthat_0.2.0   stringi_1.2.4     
[37] crayon_1.3.4      
lshep commented

Thanks - looks like it specifically happens when using rmarkdown::render - When I tried this script and used Rstudio's provided knit function the output did not include the progress bar - now that I can reproduce I'll look at a fix