Skip to content

Instantly share code, notes, and snippets.

@armish
Created July 27, 2016 17:11
Show Gist options
  • Save armish/3f172be4a7db88823e8578d83cf8b209 to your computer and use it in GitHub Desktop.
Save armish/3f172be4a7db88823e8578d83cf8b209 to your computer and use it in GitHub Desktop.
Docker image with all genomes cached via pyensembl in it
# This Docker image is meant to serve commonly used Ensembl Genomes
# already cached via PyEnsembl. Any application that depends on
# the pyensembl library can use this image to speed things up
# as caching these genomes is a huge bottleneck for most applications
FROM ubuntu:latest
MAINTAINER B. Arman Aksoy <arman@aksoy.org>
## We will be needing a few utilities to get this going
# So, let's start with updating the package list
RUN apt-get update
# wget, to be able to download Conda script
RUN apt-get install -y wget
# bzip2, so that Conda can unbundle stuff
RUN apt-get install -y bzip2
# because http://stackoverflow.com/a/25423366
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
## Let's set up our playground and cache
RUN mkdir -p $HOME/miniconda
RUN cd $HOME && \
wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && \
bash miniconda.sh -b -f -p $HOME/miniconda && \
export PATH="$HOME/miniconda/bin:$PATH" && \
hash -r && \
# Create our Conda environment and activate it
conda create -y -n pyensembl-cache python=3 && \
echo "$PATH" && ls $HOME/miniconda/bin && \
. activate pyensembl-cache && \
# Install some packages up-front
conda install numpy scipy nose pandas matplotlib biopython && \
# and install pyensembl
pip install pyensembl && \
# Cache all the genomes!
pyensembl install --release 54 --species human && \
pyensembl install --release 75 --species human && \
pyensembl install --release 77 --species human && \
pyensembl install --release 83 --species human && \
pyensembl install --release 84 --species human && \
pyensembl install --release 67 --species mouse && \
pyensembl install --release 84 --species mouse
## Remove
RUN echo "All done!"
## All done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment