eddelbuettel / r2u

CRAN as Ubuntu Binaries

Home Page:https://eddelbuettel.github.io/r2u

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: best practices for installing Bioconductor packages

tamuanand opened this issue · comments

hi @eddelbuettel

First off, thanks a lot for r2u

I am seeking some guidance on best practices for installing Bioconductor packages and I have looked at:

Based on some of the discussions there, this is what I put together as my Dockerfile

FROM docker.io/eddelbuettel/r2u:22.04

RUN apt update -qq && \
     DEBIAN_FRONTEND=noninteractive \
     install.r \
     r-bioc-bsgenome.hsapiens.ucsc.hg38_1.4.4-1.ca2204.1_all.deb \
     r-bioc-rsamtools_2.12.0-1.ca2204.1_amd64.deb \
     r-bioc-txdb.hsapiens.ucsc.hg38.knowngene_3.15.0-1.ca2204.1_all.deb \
     BiocManager

RUN R --no-echo --no-restore --no-save -e  "BiocManager::install(c('ATACseqQC'))"

Some questions:

  1. How do I search for r-bioc-ATACseqQC-* - I could not figure that out and hence I had to have the additional line of the RUN R command in my Dockerfile. Is there an easy way to search for ATACseqQC? I do see this comment but not sure how to use it to search for ATACseqQC
  2. Should I be using rocker/r2u

Thanks in advance

Sending build context to Docker daemon  2.048kB
Step 3/3 : RUN R --no-echo --no-restore --no-save -e  "BiocManager::install(c('ATACseqQC'))"
 ---> Running in e98d8197900f
'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
    CRAN: https://cloud.r-project.org
Bioconductor version 3.17 (BiocManager 1.30.20), R 4.3.0 (2023-04-21)
Installing package(s) 'BiocVersion', 'ATACseqQC'
Install system packages as root...
Reading package lists... Done
.
...

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

22 packages can be upgraded. Run 'apt list --upgradable' to see them.

...

Building dependency tree... Done
  Selecting previously unselected package r-cran-biocmanager.
(Reading database ... 18437 files and directories currently installed.)
Preparing to unpack .../r-cran-biocmanager_1.30.20-1.ca2204.1_all.deb ...
Unpacking r-cran-biocmanager (1.30.20-1.ca2204.1) ...
Setting up r-cran-biocmanager (1.30.20-1.ca2204.1) ...
Reading state information... Done

...

Warning: replacing previous import ‘utils::findMatches’ by ‘S4Vectors::findMatches’ when loading ‘AnnotationDbi’
....
Warning: replacing previous import ‘utils::findMatches’ by ‘S4Vectors::findMatches’ when loading ‘AnnotationDbi’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Warning: replacing previous import ‘utils::findMatches’ by ‘S4Vectors::findMatches’ when loading ‘AnnotationDbi’
** testing if installed package can be loaded from final location
Warning: replacing previous import ‘utils::findMatches’ by ‘S4Vectors::findMatches’ when loading ‘AnnotationDbi’
** testing if installed package keeps a record of temporary installation path
* DONE (ATACseqQC)

The downloaded source packages are in
        ‘/tmp/Rtmpqnktlw/downloaded_packages’
Old packages: 'AnnotationDbi', 'class', 'CNEr', 'DelayedArray',
  'DirichletMultinomial', 'edgeR', 'GenomeInfoDbData', 'HDF5Array',
  'KernSmooth', 'MASS', 'nnet', 'rhdf5filters', 'S4Vectors', 'seqLogo',
  'SummarizedExperiment', 'TFBSTools'
Removing intermediate container e98d8197900f
 ---> 3fbc913298b7
Successfully built 3fbc913298b7

Briefly:

  • I would start from FROM rocker/r2u:22.04, for now these are identical maybe one day I can retire the eddelbuettel ones
  • After RUN apt update -qq && DEBIAN_FRONTEND=noninteractiv install.r you can list packages in CRAN and BioC names thanks to bspm, so here you can drop all the r-bioc-* prefixes (but must then get the upper/lower case right)
  • What you do is the right move: get what you can from r2u which is basically
    • all of CRAN
    • the parts of BioC which CRAN packages depend upon

And while we do not have have all of BioC we have helpers calling for installation from from source by going via BiocManager: use installBioc.r. For the parts you install from source you have to provide the build-dependencies.

Lastly, to search what apt knows do apt-cache search whatyousearchfor and/or apt-cache policy packagename (for finer version info) eg

edd@rob:~$ dkrrr rocker/r2u:jammy     # dkrrr is a shell alias of mine
root@10021b51c9f8:/# cd
root@10021b51c9f8:~# apt update -qq
23 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@10021b51c9f8:~# apt-cache search summarizedexperiment
r-bioc-genomicranges - Bioc Package 'GenomicRanges' (Representation and manipulation of genomic intervals)
r-bioc-bumpymatrix - Bioc Package 'BumpyMatrix' (Bumpy Matrix of Non-Scalar Objects)
r-bioc-multiassayexperiment - Bioc Package 'MultiAssayExperiment' (Software for the integration of multi-omics experiments inBioconductor)
r-bioc-summarizedexperiment - Bioc Package 'SummarizedExperiment' (SummarizedExperiment container)
root@10021b51c9f8:~# apt-cache policy r-bioc-summarizedexperiment
r-bioc-summarizedexperiment:
  Installed: (none)
  Candidate: 1.30.1-1.ca2204.1
  Version table:
     1.30.1-1.ca2204.1 700
        700 https://r2u.stat.illinois.edu/ubuntu jammy/main all Packages
     1.24.0+dfsg-1 500
        500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
root@10021b51c9f8:~# 

Also, some bioc folks use r2u too and build on top of it so you can try the #containers channel in the friendly BioC slack.

Hi @eddelbuettel

Thanks a lot for all your responses

I went ahead and changed my Dockerfile to this

FROM rocker/r2u:22.04

RUN apt update -qq && \
     DEBIAN_FRONTEND=noninteractive \
     install.r \
     easypackages \
     BiocManager

RUN installBioc.r ATACseqQC Rsamtools TxDb.Hsapiens.UCSC.hg38.knownGene BSgenome.Hsapiens.UCSC.hg38

I built the docker image and then created a singularity sif file to use it on HPC.

When I shell into the sif file, I get these messages/warnings and I am not sure how to address them. Should I ignore them?

  • I also went through this thread but could not find a way to get over these below #9

I realize those are warnings and will likely not affect anything - but just wanting to make sure if I have missed something

singularity shell name_of_sif
Singularity> R

R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.


Warning message:
D-Bus service not found!

- If you are in a container environment, please consider adding the
  following to your configuration to silence this warning:

  options(bspm.sudo = TRUE)

- If you are in a desktop/server environment, please remove any 'bspm'
  installation from the user library and force a new system
  installation as follows:

  $ sudo Rscript --vanilla -e 'install.packages("bspm", repos="https://cran.r-project.org")'
> library(easypackages)
> my_packages <- c("ATACseqQC", "TxDb.Hsapiens.UCSC.hg38.knownGene", "Rsamtools", "BSgenome.Hsapiens.UCSC.hg38")
> libraries(my_packages)

...
<snipped>
....

Loading required package: BSgenome.Hsapiens.UCSC.hg38
Loading required package: BSgenome
Loading required package: rtracklayer
All packages loaded successfully
Warning messages:
1: replacing previous import ‘utils::findMatches’ by ‘S4Vectors::findMatches’ when loading ‘AnnotationDbi’
2: no function found corresponding to methods exports from ‘HDF5Array’ for: ‘is_sparse<-’
3: multiple methods tables found for ‘extract_array’
4: multiple methods tables found for ‘is_sparse’
5: multiple methods tables found for ‘write_block’

> 

Thanks in advance

I am sorry but I am really busy with a million other things -- you list a screenful but I have difficulty seeing what your question is. Can you rephrase / reword / hightlight? Thanks so much!

It looks like it loads. If you have questions about particular BioC packages then I am not really the best person to ask. Can you maybe talk to the respective BioC authors, or helpers in that community?

Sure - thanks. It loads correctly. I was just wondering if I need to do something about the warnings.

Warning message:
D-Bus service not found!

- If you are in a container environment, please consider adding the
  following to your configuration to silence this warning:

  options(bspm.sudo = TRUE)

I will close this issue.

Thanks again.

That is from bspm, the secret weapon powering the CRAN/BioC-to-apt translation. It is an R package, and has documentation. Maybe you want to turn it off now in /etc/R/Rprofile.site (penultimate line), if you find another way to silence this let me know :-) -- other it is a package by my pal Inaki's package so ask him.