Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Forked from BICF / Astrocyte / chipseq_analysis
26 commits ahead of the upstream repository.
Dockerfile 5.41 KiB
FROM continuumio/miniconda3:24.3.0-0

LABEL IMAGE="chipseq" \
    IMAGE_VERSION="1.0.0" \
    AUTHORS="Felix Perez,Peng Lian" \
    EMAIL="biohpc-help@utsouthwestern.edu"

WORKDIR /chipseq/

# Environment variables for the campus proxy.
ENV http_proxy="http://proxy.swmed.edu:3128" \
    https_proxy="http://proxy.swmed.edu:3128"

    # Enable the use of bash-specific conda commands in the layer.
RUN eval "$(conda shell.bash hook)" && \
    # Create a Python 3.6.1 conda environment and initialize its use.
    conda create -y -c bioconda -c defaults -c conda-forge -n py361 python=3.6.1 && \
    echo "python ==3.6.1" >> /opt/conda/envs/py361/conda-meta/pinned && \
    conda update conda -y && \
    conda activate py361 && \
    # Install the versions of numpy and pandas required for further software installs.
    pip install numpy==1.12.1 && \
    pip install pandas==0.20.1 && \
    # Install BWA 0.7.12
    conda install -y --solver=libmamba -c bioconda bwa=0.7.12 && \
    # Install depedencies for the following installations.
    apt-get update && apt-get install -y gcc make zlib1g-dev libbz2-dev liblzma-dev libcurl4-openssl-dev && \
    # Install Sambamba 0.6.6
    conda install -y -c bioconda sambamba=0.6.6 && \
    sambamba --version && \
    # Install BEDTools 2.26.0
    conda install -y -c bioconda bedtools=2.26.0 && \
    bedtools --version && \
    # Install Pandoc 2.7
    conda install -y -c conda-forge pandoc=2.7 && \
    pandoc --version && \
    # Install deepTools 2.5.0.1
    pip install deepTools==2.5.0.1 && \
    deeptools --version && \
    pip cache purge && \
    conda deactivate && \
    conda clean -y --all && \
    apt-get remove -y gcc make zlib1g-dev libbz2-dev liblzma-dev libcurl4-openssl-dev && \
    apt-get clean

RUN eval "$(conda shell.bash hook)" && \
    # Install MultiQC v.1.9 & SAMtools 1.6 in a separate conda environment - unsatisfiable in py361.
    conda create -y --solver=libmamba -c defaults -c conda-forge -c bioconda -n extra python=3.7.6 multiqc=1.9 samtools=1.6 && \
    ln -s /opt/conda/envs/extra/bin/multiqc /usr/bin/multiqc && \
    ln -s /opt/conda/envs/extra/bin/samtools /usr/bin/samtools && \
    samtools --version && \
    multiqc --version && \
    conda deactivate && \
    conda clean -y --all

    # Create a Python 2.7 environment.
RUN eval "$(conda shell.bash hook)" && \
    conda create -y -n py27 -c conda-forge python=2.7.12 pip=9.0.1 && \
    conda activate py27  && \
    apt-get update && apt-get install -y gcc make zlib1g-dev libbz2-dev liblzma-dev libcurl4-openssl-dev && \
    # Install Trim Galore 0.4.1.
    conda install -y --solver=libmamba -c bioconda trim-galore=0.4.1 && \
    trim_galore --version && \
    # Fix the version of cutadapt for trim galore.
    conda install -y --solver=libmamba -c bioconda cutadapt=1.9.1 && \
    cutadapt --version && \
    # Install MACS2 2.1.0.20151222
    pip install numpy && \
    pip install MACS2==2.1.0.20151222 && \
    macs2 --version && \
    # Install phantompeakqualtools 1.2
    conda install -y --solver=libmamba -c conda-forge gcc && \
    conda install -y --solver=libmamba -c bioconda phantompeakqualtools=1.2 && \
    # Install MEME 4.11.1
    conda install -y --solver=libmamba -c bioconda meme=4.11.1 && \
    meme -version && \
    conda deactivate && \
    conda clean -y --all && \
    apt-get remove -y gcc make zlib1g-dev && \
    apt-get remove -y libbz2-dev liblzma-dev libcurl4-openssl-dev && \
    apt-get clean

RUN eval "$(conda shell.bash hook)" && \
    conda activate py27 && \
    # Install R 3.4.1 & r-spp 1.14.
    conda install -y --solver=libmamba -c conda-forge libiconv && \
    conda install -y --solver=libmamba -c conda-forge r=3.4.1 && \
    conda install -y --solver=libmamba -c bioconda r-spp=1.14 && \
    conda deactivate && \
    conda clean -y --all && \
    # Setup the symlinks for the software in the py27 environment so that when 
    # the Python 3.6.1 environment is active, users can still use commands
    # that are dependent upon Python 2.7.
    ln -s /opt/conda/envs/py27/bin/trim_galore /usr/bin/trim_galore && \
    ln -s /opt/conda/envs/py27/bin/cutadapt /usr/bin/cutadapt && \
    ln -s /opt/conda/envs/py27/bin/R /usr/bin/R && \
    ln -s /opt/conda/envs/py27/bin/Rscript /usr/bin/Rscript && \
    ln -s /opt/conda/envs/py27/bin/run_spp.R /usr/bin/run_spp.R && \
    ln -s /opt/conda/envs/py27/bin/macs2 /usr/bin/macs2 && \
    ln -s /opt/conda/envs/py27/bin/meme /usr/bin/meme && \
    ln -s /opt/conda/envs/py27/bin/meme-chip /usr/bin/meme-chip

# Install UCSC_userApps/v317
RUN apt-get install -y gcc-9 g++-9 make libncurses-dev zlib1g-dev libbz2-dev liblzma-dev libcap-dev libssl-dev libpng-dev libmariadb-dev-compat libcurl4-openssl-dev && \
    ln -fs /usr/bin/gcc-9 /usr/bin/gcc && \
    wget http://hgdownload.cse.ucsc.edu/admin/exe/userApps.archive/userApps.v317.src.tgz && \
    tar -xzf userApps.v317.src.tgz && \
    rm userApps.v317.src.tgz && \
    cd userApps && \
    make clean && \
    make && \
    # In entrypoint.sh, an export command is used to add the userApps binaries to the PATH environment variable.
    apt-get remove -y gcc-9 g++-9 make libncurses-dev zlib1g-dev libbz2-dev liblzma-dev libpcap-dev libssl-dev libpng-dev libmariadb-dev-compat libcurl4-openssl-dev && \
    apt-get clean

# Copy in the entrypoint script to use for activating the Python 3.6.1 conda environment by default when launching a container.
COPY entrypoint.sh .

RUN chmod +x entrypoint.sh

ENTRYPOINT ["/chipseq/entrypoint.sh"]