Git Product home page Git Product logo

bioconductor_devel's Introduction

Hub Status
Docker
Singularity https://www.singularity-hub.org/static/img/hosted-singularity--hub-%23e32929.svg

About the "bioconductor" script

This script makes it more convenient to run the Bioconductor docker images locally for routine daily usage:

  1. It creates a host directory ~/dockerhome where the home directory of the Docker user will be mounted. Files can be shared between the Docker container and host filesystem here.
  2. It results in user-installed packages being added to the host directory ~/.docker-devel-packages or ~/.docker-release-packages.
  3. It runs the Docker containers waldronlab/bioconductor_devel and waldronlab/bioconductor_release. The script can, however, easily be changed to use any of the official Bioconductor Docker containers.

About the waldronlab docker images

The waldronlab/bioconductor_devel and waldronlab/bioconductor_release images are built on top of the bioconductor/devel_base2 and bioconductor/release_base2 images, respectively. They add many system dependencies so that almost every Bioconductor package can be installed using BiocManager::install() with no further troubles. As of the last testing, the release image successfully installed all but 10 of over 1,600 packages (testing done with this gist). For almost everyone, this means no more errors when trying to install a package.

For singularity users

To make a generalization, Docker is more supported by commercial Cloud providers, whereas Singularity is (far) more likely to be supported by university high-performance computing facilities.

If you have singularity installed, pull the singularity images as follows:

singularity pull shub://waldronlab/bioconductor_devel
singularity pull shub://waldronlab/bioconductor_release

So far I have only used singularity for bash and R, with aliases like these (assuming you did the above pull commands from your home directory):

alias singulaR="singularity shell $HOME/waldronlab-bioconductor_devel-master-latest.simg R"
alias singularbash="singularity shell $HOME/waldronlab-bioconductor_devel-master-latest.simg bash"

Note that default behavior in singularity is to mount your home (and several other) directories as the home directory within the container, while maintaining your user permissions. This makes all the docker efforts to mount volumes for your container package and home directories unnecessary. I haven't yet tried running rstudio via singularity, but it shouldn't be too hard?

Other helpful shortcuts

The following aliases may also be useful in your ~/.bash_profile for command-line R and bash usage with the same containers, package directories, home directory, and rstudio user:

alias releaseshell="docker run -ti -u rstudio -w /home/rstudio -v $HOME/dockerhome:/home/rstudio -v $HOME/.docker-release-packages:/usr/local/lib/R/host-site-library waldronlab/b\
ioconductor_release bash"
alias develshell="docker run -ti -u rstudio -w /home/rstudio -v $HOME/dockerhome:/home/rstudio -v $HOME/.docker-devel-packages:/usr/local/lib/R/host-site-library waldronlab/bioco\
nductor_devel bash"
alias Rrelease="docker run -ti -v $HOME/dockerhome:/home/rstudio -v $HOME/.docker-release-packages:/usr/local/lib/R/host-site-library waldronlab/bioconductor_release R"
alias Rdevel="docker run -ti -v $HOME/dockerhome:/home/rstudio -v $HOME/.docker-devel-packages:/usr/local/lib/R/host-site-library waldronlab/bioconductor_devel R"
#default:                                               
alias R=Rdevel

Using the bioconductor script and docker container

  1. Install a docker client for your operating system.
  2. Make sure home directories are being shared (Whale icon -> Preferences -> File Sharing). Last I checked, this was already the case by default. You can also change the allotted system resources if you want.
  3. Copy the bioconductor script from this repo to somewhere in your $PATH. Modify as you see fit, e.g. if you want to mount different directories or in a different place than ~/dockerhome, or change the rstudio password. Make sure the script is executable (e.g. chmod a+x bioconductor).
  4. From the command-line, type bioconductor devel or bioconductor release. Later you can use Ctrl-C to stop the container. There are additional usage tips at https://github.com/Bioconductor/bioc_docker, including how to access the image from a command-line.
  5. In a browser, open http://localhost:8787. Login with username is "rstudio" and password "rstudiopassword" unless you change the password in the "bioconductor" script of step 3.

That's it! You can stop the instance you're running and switch to release or devel (but you can't currently run both at the same time). There will be separate host package libraries for user-installed packages (in ~/.docker-devel-packages and ~/.docker-release-packages), and a common home directory in ~/dockerhome. docker pull is run each time you invoke the bioconductor script, so you should automatically get the most up-to-date Bioconductor release or devel versions, and will only have to run BiocManager::install() to update user-installed packages.

TODO

The bioconductor script is rudimentary and should use docopt, provide start & stop, and have an option for opening a bash shell or R console. It could also provide arguments for the volume location etc.

It at least does error at the docker pull stage if you enter anything other than "release" or "devel" as the argument.

bioconductor_devel's People

Contributors

lwaldron avatar link-ny avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.