Skip to content

Commit

Permalink
Update Dockerfile and tool versions
Browse files Browse the repository at this point in the history
  • Loading branch information
emi80 committed Nov 23, 2021
1 parent ebc8dc0 commit af3d3e8
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 49 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
build:

runs-on: ubuntu-latest
env:
IMAGE_HASH: f912436e8791a9d1f9cadf76099f760151435a43d7873712ee692cb2b0f8947e
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
Expand All @@ -24,10 +22,6 @@ jobs:
- name: Set up Nextflow
run: |
curl -fsSL get.nextflow.io | bash -e
- name: Fetch Docker image
run: |
docker pull ${{ github.repository }}@sha256:$IMAGE_HASH
- name: Run pipeline
run: |
.github/workflows/ci.sh run -with-docker
Expand Down
2 changes: 1 addition & 1 deletion chipseq-pipeline.nf
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ process mapping {
- \
| samtools sort -@ ${cpus} \
- \
${prefix}_primary
-o ${prefix}_primary.bam
"""
}
// Merge or rename bam
Expand Down
151 changes: 110 additions & 41 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,129 @@
FROM grape/mapping:gem-1.7.1
ARG UBUNTU_VERSION=20.04
FROM ubuntu:${UBUNTU_VERSION} as builder

LABEL maintainer "Emilio Palumbo <[email protected]>" \
version "1.0" \
description "ChIP-seq analysis pipeline image"
# install needed tools
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractve apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gdebi-core \
git \
libboost-all-dev \
libcurl4-gnutls-dev \
libxml2-dev \
lsb-release \
# ncurses-dev \
python3-dev \
python3-pip \
python-is-python3

ENV _ZERONE_VERSION 5af03a1
# install R
ARG R_VER=3.6.3
RUN export UBUNTU_VER=$(lsb_release -rs | tr -d '.') \
&& curl -O https://cdn.rstudio.com/r/ubuntu-${UBUNTU_VER}/pkgs/r-${R_VER}_1_amd64.deb \
&& DEBIAN_FRONTEND=noninteractve gdebi --non-interactive r-${R_VER}_1_amd64.deb

ENV PATH=/phantompeakqualtools/:$PATH
ENV PATH=/opt/R/${R_VER}/bin:$PATH

# install needed tools
RUN apt-get update --fix-missing -qq && apt-get install -y -q \
r-base \
git \
libboost-dev \
python-dev \
bc \
&& apt-get clean \
&& apt-get purge \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# install spp
RUN echo 'options(repos = "https://cloud.r-project.org/")' > ~/.Rprofile

# install spp
ARG BIOC_VER="3.10"
RUN git clone https://github.com/kundajelab/phantompeakqualtools \
&& cd phantompeakqualtools/ \
&& R -e 'install.packages( c("snow","snowfall","bitops","caTools"), repos="http://cran.us.r-project.org"); \
source("http://bioconductor.org/biocLite.R"); \
biocLite("Rsamtools",suppressUpdates=TRUE); \
install.packages("./spp_1.14.tar.gz");'
&& R -e 'install.packages( c("snow","snowfall","bitops","caTools", "BiocManager")); \
BiocManager::install(version = "'$BIOC_VER'"); \
BiocManager::install("Rsamtools", ask=FALSE); \
install.packages("spp");'

# install Macs2
RUN pip install numpy \
&& pip install macs2
# ARG MACS2_VER=2.1.1.20160309
ARG MACS2_VER=2.2.4
RUN pip3 install numpy \
&& pip3 install macs2==${MACS2_VER}

# get KentUtils
RUN curl -fsSLo /usr/local/bin/bedGraphToBigWig https://github.com/ENCODE-DCC/kentUtils/raw/v302.1.0/bin/linux.x86_64/bedGraphToBigWig \
&& chmod +x /usr/local/bin/bedGraphToBigWig
RUN curl -fsSLo /usr/local/bin/bedClip https://github.com/ENCODE-DCC/kentUtils/raw/v302.1.0/bin/linux.x86_64/bedClip \
&& chmod +x /usr/local/bin/bedClip
RUN curl -fsSLO https://github.com/ENCODE-DCC/kentUtils/raw/v302.1.0/bin/linux.x86_64/bedGraphToBigWig \
&& chmod +x bedGraphToBigWig
RUN curl -fsSLO https://github.com/ENCODE-DCC/kentUtils/raw/v302.1.0/bin/linux.x86_64/bedClip \
&& chmod +x bedClip

# install bedtools
RUN curl -fsSL https://github.com/arq5x/bedtools2/releases/download/v2.26.0/bedtools-2.26.0.tar.gz | tar xz \
ARG BEDTOOLS_VER=2.26.0
RUN curl -fsSL https://github.com/arq5x/bedtools2/releases/download/v${BEDTOOLS_VER}/bedtools-${BEDTOOLS_VER}.tar.gz | tar xz \
&& cd bedtools2 \
&& make \
&& make install

# install java
RUN curl --header "Cookie: oraclelicense=accept-securebackup-cookie" -L http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jre-8u121-linux-x64.tar.gz | tar xz \
&& update-alternatives --install /usr/bin/java java /jre1.8.0_121/bin/java 100
&& make

# install picard
RUN curl -L -o /usr/local/bin/picard.jar https://github.com/broadinstitute/picard/releases/download/2.8.3/picard.jar \
&& chmod +x /usr/local/bin/picard.jar
ARG PICARD_VER=2.8.3
RUN curl -fsSLO https://github.com/broadinstitute/picard/releases/download/${PICARD_VER}/picard.jar \
&& chmod +x picard.jar

# install zerone
ARG ZERONE_VERSION=5af03a1
RUN mkdir -p zerone && \
curl -fsSL https://github.com/nanakiksc/zerone/archive/${_ZERONE_VERSION}.tar.gz | tar xz --strip-components 1 -C zerone && \
make -C zerone && \
mv zerone/zerone /usr/local/bin && \
make clean -C zerone
curl -fsSL https://github.com/nanakiksc/zerone/archive/${ZERONE_VERSION}.tar.gz | tar xz --strip-components 1 -C zerone && \
make -C zerone

RUN apt-get install -y --no-install-recommends ncurses-dev

# install samtools
ARG SAMTOOLS_VER=1.11
RUN curl -fsSL https://github.com/samtools/samtools/releases/download/${SAMTOOLS_VER}/samtools-${SAMTOOLS_VER}.tar.bz2 \
| tar xj && cd samtools-${SAMTOOLS_VER} \
&& make

# install GEM
RUN curl http://barnaserver.com/gemtools/releases/GEMTools-static-i3-1.7.1.tar.gz \
| tar xz

RUN curl -O http://ppa.launchpad.net/linuxuprising/libpng12/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1+1~ppa0~focal_amd64.deb

FROM ubuntu:${UBUNTU_VERSION}

LABEL maintainer "Emilio Palumbo <[email protected]>" \
version "1.0" \
description "ChIP-seq analysis pipeline image"

# install needed tools
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gawk \
libblas3 \
libgomp1 \
libicu66 \
liblapack3 \
libcurl3-gnutls \
locales \
python-is-python3 \
openjdk-8-jre-headless

# set locale
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen en_US.utf8 \
&& /usr/sbin/update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8

# set environment variables
ARG R_VER=3.6.3
ENV LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
PATH=/opt/R/${R_VER}/bin:$PATH

ARG SAMTOOLS_VER=1.11

COPY --from=builder /libpng12-0_1.2.54-1ubuntu1.1+1~ppa0~focal_amd64.deb /
RUN dpkg -i /libpng12-0_1.2.54-1ubuntu1.1+1~ppa0~focal_amd64.deb && \
rm libpng12-0_1.2.54-1ubuntu1.1+1~ppa0~focal_amd64.deb

# Copy installed libraries from builder
COPY --from=builder /opt/R /opt/R
COPY --from=builder /usr/local/lib/python3.8/dist-packages /usr/local/lib/python3.8/dist-packages
COPY --from=builder /bedtools2/bin/ /usr/local/bin/
COPY --from=builder /bedClip /usr/local/bin
COPY --from=builder /bedGraphToBigWig /usr/local/bin/
COPY --from=builder /zerone/zerone /usr/local/bin/
COPY --from=builder /picard.jar /usr/local/bin/
COPY --from=builder /phantompeakqualtools/run_spp.R /usr/local/bin
COPY --from=builder /gemtools-1.7.1-i3/bin/gem-* /usr/local/bin/
COPY --from=builder /samtools-${SAMTOOLS_VER}/samtools /usr/local/bin/
COPY --from=builder /usr/local/bin/macs2 /usr/local/bin/
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ trace.enabled = true

// Process configuration
process {
container = 'guigolab/chip-nf@sha256:f912436e8791a9d1f9cadf76099f760151435a43d7873712ee692cb2b0f8947e'
container = 'guigolab/chip-nf:dev'
tag = { prefix ?: genome.baseName }
}

0 comments on commit af3d3e8

Please sign in to comment.