Skip to content

Commit

Permalink
Merge pull request #73 from Bioinformatics/HAP-318
Browse files Browse the repository at this point in the history
HAP-318 and HAP-319
  • Loading branch information
Krusche, Peter authored and GitHub Enterprise committed Jun 3, 2017
2 parents 8faf71c + 0f5fe57 commit d9a9967
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 67 deletions.
88 changes: 25 additions & 63 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,23 @@
FROM ubuntu:14.04

RUN apt-get update
RUN apt-get upgrade -y

# install python and PIP
RUN apt-get install python2.7 python2.7-dev -y
RUN apt-get install cython -y
RUN apt-get install python-setuptools -y
RUN apt-get install python-pip -y
RUN apt-get install python-numpy -y
RUN apt-get install zlib1g-dev -y
# ideally, we don't want to use the ubuntu version
# here because this bloats the Docker image
# RUN apt-get install python-pandas -y
RUN easy_install -U distribute

# numpy and such
RUN apt-get install build-essential -y
RUN apt-get install gfortran -y
RUN apt-get install -y libatlas-base-dev
RUN apt-get install pkg-config -y
FROM ubuntu:16.04

RUN apt-get update && apt-get upgrade -y
RUN apt-get install build-essential zlib1g-dev libbz2-dev pkg-config cmake libncurses5-dev autoconf -y
RUN apt-get install git bzip2 wget -y
RUN apt-get install python2.7 python2.7-dev python \
python-setuptools \
python-pip \
python-psutil \
cython \
python-numpy \
python-pandas \
python-distribute \
python-pysam \
python-scipy \
-y
RUN apt-get install software-properties-common python-software-properties -y
RUN apt-get install cmake -y

# hap.py v0.3.7+ requires g++ 4.9
RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y
RUN apt-get update
RUN apt-get install g++-4.9 -y
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 50
RUN apt-get clean -y

# upgrade to newest versions / install
RUN pip install --upgrade cython
RUN pip install --upgrade numpy
RUN pip install --upgrade pandas
RUN pip install pybedtools
RUN pip install pysam
RUN pip install bx-python
RUN pip install scipy

# boost and cmake for hap.py
RUN apt-get install libncurses5-dev -y
RUN apt-get install git -y
RUN apt-get install samtools -y
RUN apt-get install bzip2 -y
RUN apt-get install wget -y
RUN apt-get install libbz2-dev -y


RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
Expand All @@ -55,8 +26,6 @@ RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer

RUN apt-get clean -y

# copy git repository into the image
RUN mkdir -p /opt/hap.py-source
COPY . /opt/hap.py-source/
Expand All @@ -67,29 +36,22 @@ RUN mkdir -p /opt/hap.py-data
# download HG19 reference data
WORKDIR /opt/hap.py-data

# This downloads from UCSC
RUN /opt/hap.py-source/src/sh/make_hg19.sh

# this downloads our copy from box.com (once available)
# RUN wget https://illumina.app.box.com/s/1vwpu1w23p2qupukjjlrenq81mrtth1z/hg19.fa.bz2 -O /opt/hap.py-source/src/data/hg19.fa.bz2
# RUN bzcat /opt/hap.py-source/src/data/hg19.fa.bz2 > /opt/hap.py-data/hg19.fa
RUN samtools faidx /opt/hap.py-data/hg19.fa

# get + install ant
WORKDIR /opt
RUN wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.7-bin.tar.gz && \
tar xzf apache-ant-1.9.7-bin.tar.gz && \
rm apache-ant-1.9.7-bin.tar.gz
ENV PATH $PATH:/opt/apache-ant-1.9.7/bin

# run hap.py installer in the image
# run hap.py installer in the image, don't run tests since we don't have a reference file
WORKDIR /opt/hap.py-source
RUN HG19=/opt/hap.py-data/hg19.fa python install.py /opt/hap.py --with-rtgtools
RUN python install.py /opt/hap.py --with-rtgtools --no-tests
WORKDIR /opt/hap.py

# run basic tests
RUN bin/test_haplotypes

# remove source folder
WORKDIR /
RUN rm -rf /opt/hap.py-source

# Optionally set up I/O folders
# RUN mkdir /data && chgrp users /data && chmod a+rwx /data
# VOLUME /data
# RUN useradd happy -m -s /bin/bash -G users
# USER happy
59 changes: 59 additions & 0 deletions Dockerfile.ubuntu-with-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get upgrade -y
RUN apt-get install build-essential zlib1g-dev libbz2-dev pkg-config cmake libncurses5-dev autoconf -y
RUN apt-get install git bzip2 wget -y
RUN apt-get install python2.7 python2.7-dev python \
python-setuptools \
python-pip \
python-psutil \
cython \
python-numpy \
python-pandas \
python-distribute \
python-pysam \
python-scipy \
-y
RUN apt-get install software-properties-common python-software-properties -y
RUN apt-get clean -y

RUN pip install bx-python

RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java8-installer && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer

# copy git repository into the image
RUN mkdir -p /opt/hap.py-source
COPY . /opt/hap.py-source/

# make minimal HG19 reference sequence
RUN mkdir -p /opt/hap.py-data

# get + install ant
WORKDIR /opt
RUN wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.7-bin.tar.gz && \
tar xzf apache-ant-1.9.7-bin.tar.gz && \
rm apache-ant-1.9.7-bin.tar.gz
ENV PATH $PATH:/opt/apache-ant-1.9.7/bin

# run hap.py installer in the image, don't run tests since we don't have a reference file
WORKDIR /opt/hap.py-source
RUN python install.py /opt/hap.py --with-rtgtools --no-tests

# download HG19 reference data
# This downloads from UCSC
WORKDIR /opt/hap.py-data
ENV PATH $PATH:/opt/hap.py/bin
RUN /opt/hap.py-source/src/sh/make_hg19.sh && samtools faidx /opt/hap.py-data/hg19.fa
# Run tests
ENV HG19 /opt/hap.py-data/hg19.fa
WORKDIR /opt/hap.py
RUN /opt/hap.py-source/src/sh/run_tests.sh

# remove source folder
WORKDIR /
RUN rm -rf /opt/hap.py-source
2 changes: 2 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
| Ticket | Description |
|---------|------------------------------------------------------------------------------------|
| HAP-317 | Update htslib to 1.4.1 and always check for BCF conversion errors |
| HAP-318 | Update rtgtools to 3.8.1 |
| HAP-319 | Slimmer docker image without hg19 reference |

## v0.3.8

Expand Down
6 changes: 3 additions & 3 deletions external/make_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ if [[ ! -z $BUILD_VCFEVAL ]]; then
cd ${TLD}
mkdir -p ${TLD}/rtg-tools
cd rtg-tools
wget http://github.com/RealTimeGenomics/rtg-tools/archive/3.7.1.tar.gz -O ${TLD}/rtg-tools/rtg-tools.tar.gz
wget http://github.com/RealTimeGenomics/rtg-tools/archive/3.8.1.tar.gz -O ${TLD}/rtg-tools/rtg-tools.tar.gz
tar xvf rtg-tools.tar.gz
cd rtg-tools-3.7.1
cd rtg-tools-3.8.1

if [[ ! -z ${ANT_HOME} ]]; then
$ANT_HOME/bin/ant zip-nojre
Expand All @@ -126,7 +126,7 @@ if [[ ! -z $BUILD_VCFEVAL ]]; then
fi
cd ..

RTG_ZIPFILE=$(ls rtg-tools-3.7.1/dist/*-nojre.zip | head -1)
RTG_ZIPFILE=$(ls rtg-tools-3.8.1/dist/*-nojre.zip | head -1)
RTG_BASE=$(basename $RTG_ZIPFILE -nojre.zip)
jar xvf $RTG_ZIPFILE
mv $RTG_BASE ${ISD}/libexec/rtg-tools-install
Expand Down
3 changes: 2 additions & 1 deletion happy.requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Cython
numpy
pandas
pybedtools
psutil
pip
pysam
nose
scipy
Expand Down

0 comments on commit d9a9967

Please sign in to comment.