---
author: Sam White
toc-title: Contents
toc-depth: 5
toc-location: left
date: 2016-06-01 19:06:24+00:00
layout: post
slug: docker-improving-roberts-lab-reproducibility
title: Docker - Improving Roberts Lab Reproducibility
categories:
  - 2016
  - Computer Servicing
tags:
  - computing
  - docker
  - dockerfile
  - jupyter notebook
  - R
  - R Studio
  - reproducibility
---

In an attempt at furthering our lab's abilities to maximize our reproducibility, I've been  working on developing an all-encompassing Docker image. Docker is a type of virtual machine (i.e. a self-contained computer that runs within your computer). For the Roberts Lab, the advantage of using Docker is that the Docker images can be customized to run a specific suite of software and these images can then be used by any other person in the lab (assuming they can run Docker on their particular operating system), regardless of operating system. In turn, if everyone is using the same Docker image (i.e. the same virtual machine with all the same software), then we should be able to reproduce data analyses more reliably, due to the fact that there won't be differences between software versions that people are using. Additionally, using Docker greatly simplifies the setup of new computers with the requisite software.

I've put together a Dockerfile (a Dockerfile is a text file/script that Docker uses to retrieve software and build a computer image with those specific instructions) which will automatically build a Docker image (i.e. virtual computer) that contains all of the normal bioinformatics software our lab uses. This has been a side project while I wait for Stacks analysis to complete (or, fail, depending on the day) and it's finally usable! The image that is built from this Dockerfile will even let the user run R Studio and/or Jupyter Notebooks in their browser (I'm excited about this part)!

Here's the current list of software that will be installed:

<table class="highlight tab-size js-file-line-container" data-tab-size="8" >
<tbody >
<tr >

<td id="LC13" class="blob-code blob-code-inner js-file-line" >bedtools 2.25.0
</td>
</tr>
</tbody>
</table>

<table class="highlight tab-size js-file-line-container" data-tab-size="8" >
<tbody >
<tr >

<td id="LC14" class="blob-code blob-code-inner js-file-line" >bismark 0.15.0
</td>
</tr>
<tr >

<td id="LC15" class="blob-code blob-code-inner js-file-line" >blast 2.3.0+
</td>
</tr>
<tr >

<td id="LC16" class="blob-code blob-code-inner js-file-line" >bowtie2 2.2.8
</td>
</tr>
<tr >

<td id="LC17" class="blob-code blob-code-inner js-file-line" >bsmap 2.90
</td>
</tr>
<tr >

<td id="LC18" class="blob-code blob-code-inner js-file-line" >cufflinks 2.1.1
</td>
</tr>
<tr >

<td id="LC19" class="blob-code blob-code-inner js-file-line" >fastqc 0.11.5
</td>
</tr>
<tr >

<td id="LC20" class="blob-code blob-code-inner js-file-line" >fastx_toolkit 0.0.13
</td>
</tr>
<tr >

<td id="LC21" class="blob-code blob-code-inner js-file-line" >R 3.2.5
</td>
</tr>
<tr >

<td id="LC22" class="blob-code blob-code-inner js-file-line" >RStudio Server0.99
</td>
</tr>
<tr >

<td id="LC23" class="blob-code blob-code-inner js-file-line" >pyrad 3.0.66
</td>
</tr>
<tr >

<td id="LC24" class="blob-code blob-code-inner js-file-line" >samtools 0.1.19
</td>
</tr>
<tr >

<td id="LC25" class="blob-code blob-code-inner js-file-line" >stacks 1.40
</td>
</tr>
<tr >

<td id="LC26" class="blob-code blob-code-inner js-file-line" >tophat 2.1.1
</td>
</tr>
</tbody>
</table>

<table class="highlight tab-size js-file-line-container" data-tab-size="8" >
<tbody >
<tr >

<td id="LC27" class="blob-code blob-code-inner js-file-line" >trimmomatic 0.36
</td>
</tr>
</tbody>
</table>

In order to set this up, you need to install [Docker](https://www.docker.com/) and download the Dockerfile ([Dockerfile.bio](https://github.com/sr320/LabDocs/tree/master/code/dockerfiles)) I've created.

I've written a bit of a user guide (specific to this Dockerfile) here to get people started: [docker.md](https://github.com/sr320/LabDocs/blob/master/code/docker.md)

The user guide explains a bit how all of this works and tries to progress from a "basic" this-is-how-to-get-started-with-Docker to an "advanced" description of how to map ports, mount local volumes in your containers, and how to start/attach previously used containers.

The next major goal I have with this Docker project is to get the R kernel installed for Jupyter Notebooks. Currently, the Jupyter Notebook installation is restricted to the default Python 2 kernel.

Additionally, I'd like to improve the usability of the Docker image by setting up aliases in the image. Meaning, a user who wants to use the bowtie program can just type "bowtie". Currently, the user has to type "bowtie2_2.2.8" (although, with this being in the system PATH and tab-completion, it's not that big of a deal), which is a bit ugly.

For some next level stuff, I'd also like to setup all Roberts Lab computers to automatically launch the Docker image when the user opens a terminal. This would greatly simplify things for new lab members. They wouldn't have to deal with going through the various Docker commands to start a Docker container. Instead, their terminal would just put them directly into the container and the user would be none-the-wiser. They'd be reproducibly conducting data analysis without even having to think about it.
