nf-core / website

Code and files for the main nf-core website.
https://nf-co.re
MIT License
64 stars 184 forks source link

Add specific example of building an R container with only R packages #1099

Open pcantalupo opened 2 years ago

pcantalupo commented 2 years ago

Is your feature request related to a problem? Please describe. I need to create a container with just R and some R packages. I found this link https://nf-co.re/developers/modules#software-requirements. But to a beginner (and I know this is a Developer documentation), it is not clear how to build an R specific type of container.

The closest language is in this section:

It is also possible for a new multi-tool container to be built and added to BioContainers by submitting a pull request on their multi-package-containers repository.

However, there are several difficulities for a beginner to understand. For instance, installing R requires you to know to search for r-base on Anaconda.org. If you just search for R, you will never find it. Also, you need to know that R packages are prefixed with r- and bioconductor with bioconductor-

I have a list of commands that I executed to perform this task. I'm not sure if it is valuable to include as documentation.

maxulysse commented 2 years ago

I like this idea, I'd say go for it and start a PR, comments are always a good way to improve

ewels commented 2 years ago

Sounds like a great addition! Could have sections for common languages - R, Python etc.. This comes up quite a lot.

pcantalupo commented 2 years ago

Should I write a separate tutorial webpage and add it to: https://github.com/nf-core/nf-co.re/blob/master/markdown/developers/developer_tutorials.md ?

ggabernet commented 2 years ago

yes that sounds good!

pcantalupo commented 2 years ago

I'm having difficulty writing this tutorial. Allow me to explain.

I created a PR on Biocontainers that was merged recently: https://github.com/BioContainers/multi-package-containers/pull/2107. Then I ran this command line

mulled-search --destination quay singularity conda --search r-dplyr r-readr r-optparse

to find the name of my mulled image (command is based on the one in https://nf-co.re/developers/modules#software-requirements). Unfortunately, I’m not getting any mulled search results.

However, there is another way to get the mulled image name! But, you have to go through the build logs here: https://github.com/BioContainers/multi-package-containers/runs/5610436668?check_suite_focus=true. If you look under the "Upload images" it's quay.io/biocontainers/mulled-v2-4ba25ddb980af37c42ada81fe02785bc9ec0a264:fd1896f69951cb685c17367012009385d3356a3d-0. This method does not seem sustainable but maybe for a developer that is all they need.

Unfortunately, there is more serious problem. When I tested the container with my R script, it failed because of a missing system library for the R readr library. See this issue https://github.com/tidyverse/readr/issues/952#issuecomment-451255375.

So, this makes things difficult to write an effective tutorial for building an R container. How am I supposed to know which system libraries are required for every R package? I’m not sure if I can write the tutorial...any ideas?