Error building Bioconductor package within shiny app

I am having a similar issue to the one posted here by lgatto. I am trying to publish an app that uses Bioconductor packages and the deployment fails because the impute package can not be built. The app runs fine on my system locally. I created the same short reproducible example as lgatto to demonstrate the issue e.g.

  1. Creating the Old Faithful Geyser Data example app that comes with shiny : in RStudio, I used File > New File > New Shiny Web Application . I can successfully run it with shiny::runApp() and deploy it by clicking on the Publish button.
  2. Add a file, say data.R in the app directory containing the relevant repo options that seemed to solve the issue posted by lgatto, along with a call to perform some trivial data processing using the package MSnbase (this won't affect the app)
local({
  r <- getOption("repos")
  r["CRAN"] <- "https://cran.rstudio.com/"
  r["BioCsoft"] <- "https://bioconductor.org/packages/3.7/bioc"
  r["BioCann"] <- "https://bioconductor.org/packages/3.7/data/annotation"
  r["BioCexp"] <- "https://bioconductor.org/packages/3.7/data/experiment"
  options(repos = r)
})

library("MSnbase")
data(msnset)
mean(exprs(filterNA(msnset)))

and then I add

source("data.R")

at the top of ui.R .

  1. I can still successfully run the app locally, but when I try to publish it I get an issue with the Bioconductor impute package, one of the dependencies of MSnbase
> deployApp()
Preparing to deploy application...DONE
Uploading bundle for application: 399831...DONE
Deploying bundle: 1534639 for application: 399831 ...
Waiting for task: 543040165
  building: Parsing manifest
  building: Building image: 1550071
  building: Fetching packages
  building: Building package: impute
################################ Begin Task Log ################################ 
################################# End Task Log ################################# 
Error: Unhandled Exception: Child Task 543040166 failed: Error building image: Error fetching impute (1.53.0) source. Error downloading package source. Please update your BioConductor packages to the latest version and try again: <BioconductorPackageSource repo=

Thank you very much in advance for any help.

Lisa

> sessionInfo()
R Under development (unstable) (2018-03-21 r74432)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

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

other attached packages:
 [1] devtools_1.13.6      BiocInstaller_1.30.0 pRoloc_1.20.1       
 [4] MLInterfaces_1.60.1  cluster_2.0.6        annotate_1.58.0     
 [7] XML_3.98-1.11        AnnotationDbi_1.42.1 IRanges_2.14.10     
[10] S4Vectors_0.18.3     MSnbase_2.6.1        ProtGenerics_1.12.0 
[13] BiocParallel_1.14.1  Biobase_2.40.0       BiocGenerics_0.26.0 
[16] mzR_2.14.0           Rcpp_0.12.17         shiny_1.1.0         
[19] rsconnect_0.8.8     

loaded via a namespace (and not attached):
  [1] backports_1.1.2       plyr_1.8.4            igraph_1.2.1         
  [4] lazyeval_0.2.1        splines_3.5.0         ggvis_0.4.3          
  [7] crosstalk_1.0.0       ggplot2_2.2.1         digest_0.6.15        
 [10] foreach_1.4.4         htmltools_0.3.6       viridis_0.5.1        
 [13] gdata_2.18.0          magrittr_1.5          memoise_1.1.0        
 [16] doParallel_1.0.11     sfsmisc_1.1-2         limma_3.36.2         
 [19] recipes_0.1.3         gower_0.1.2           rda_1.0.2-2          
 [22] dimRed_0.1.0          lpSolve_5.6.13        prettyunits_1.0.2    
 [25] colorspace_1.3-2      blob_1.1.1            dplyr_0.7.5          
 [28] jsonlite_1.5          crayon_1.3.4          RCurl_1.95-4.10      
 [31] hexbin_1.27.2         genefilter_1.61.1     bindr_0.1.1          
 [34] impute_1.53.0         DRR_0.0.3             survival_2.42-3      
 [37] iterators_1.0.9       glue_1.2.0            gtable_0.2.0         
 [40] ipred_0.9-6           zlibbioc_1.26.0       kernlab_0.9-26       
 [43] ddalpha_1.3.1.1       prabclus_2.2-6        DEoptimR_1.0-8       
 [46] scales_0.5.0          vsn_3.48.1            mvtnorm_1.0-7        
 [49] DBI_1.0.0             viridisLite_0.3.0     xtable_1.8-2         
 [52] progress_1.2.0        foreign_0.8-70        bit_1.1-14           
 [55] proxy_0.4-22          mclust_5.4            preprocessCore_1.42.0
 [58] lava_1.6.1            prodlim_2018.04.18    DT_0.4               
 [61] sampling_2.8          htmlwidgets_1.2       httr_1.3.1           
 [64] threejs_0.3.1         FNN_1.1               RColorBrewer_1.1-2   
 [67] fpc_2.1-11            modeltools_0.2-21     pkgconfig_2.0.1      
 [70] flexmix_2.3-14        nnet_7.3-12           RJSONIO_1.3-0        
 [73] caret_6.0-80          tidyselect_0.2.4      rlang_0.2.1          
 [76] reshape2_1.4.3        later_0.7.3           munsell_0.5.0        
 [79] mlbench_2.1-1         tools_3.5.0           RSQLite_2.1.1        
 [82] pls_2.6-0             broom_0.4.4           evaluate_0.10.1      
 [85] stringr_1.3.1         mzID_1.18.0           yaml_2.1.19          
 [88] ModelMetrics_1.1.0    knitr_1.20            bit64_0.9-7          
 [91] robustbase_0.92-8     randomForest_4.6-12   purrr_0.2.5          
 [94] packrat_0.4.9-3       dendextend_1.8.0      bindrcpp_0.2.2       
 [97] nlme_3.1-136          whisker_0.3-2         mime_0.5             
[100] RcppRoll_0.3.0        biomaRt_2.36.1        compiler_3.5.0       
[103] rstudioapi_0.7        curl_3.2              e1071_1.6-8          
[106] affyio_1.50.0         tibble_1.4.2          stringi_1.2.3        
[109] highr_0.7             lattice_0.20-35       trimcluster_0.1-2    
[112] Matrix_1.2-14         markdown_0.8          psych_1.8.4          
[115] gbm_2.1.3             pillar_1.2.3          MALDIquant_1.17      
[118] bitops_1.0-6          httpuv_1.4.4.1        R6_2.2.2             
[121] pcaMethods_1.72.0     affy_1.58.0           hwriter_1.3.2        
[124] promises_1.0.1        gridExtra_2.3         codetools_0.2-15     
[127] MASS_7.3-50           gtools_3.8.1          assertthat_0.2.0     
[130] CVST_0.2-2            rprojroot_1.3-2       withr_2.1.2          
[133] mnormt_1.5-5          diptest_0.75-7        hms_0.4.2            
[136] grid_3.5.0            rpart_4.1-13          timeDate_3043.102    
[139] tidyr_0.8.1           class_7.3-14          rmarkdown_1.10       
[142] git2r_0.21.0          lubridate_1.7.4       base64enc_0.1-3 
1 Like

You should not need to add the repo options inside your code, shinyapps.io will handle that piece.

Locally you will want to set at least BioCsoft before installing the packages.

After installing MSnbase, I found that I needed to update BiocParallel.

I was then able to deploy the Old Faithful sample application as a single page Shiny app.R with:

library("MSnbase")
data(msnset)
mean(exprs(filterNA(msnset)))

at the top.

You may find that updating impute to 1.54.0 gets you further.

Thank you for the speedy reply.

Annoyingly, I use R-devel and after doing a clean install and updating all my packages I assume given the below message I need to download a stable version of R to deploy my app?

> deployApp()
Preparing to deploy application...DONE
Uploading bundle for application: 399169...DONE
Deploying bundle: 1536992 for application: 399169 ...
Waiting for task: 543349286
  building: Parsing manifest
  building: Building image: 1552848
  error: Installing system dependencies
################################ Begin Task Log ################################ 
################################# End Task Log ################################# 
Error: Unhandled Exception: Child Task 543349287 failed: Error building image: R version 3.6.0 currently unavailable

Correct, shinyapps.io only makes released versions of R available.

Reverting to the released version 3.5.1 and updating all packages fixed the above! Many thanks!