Skip to content

Instantly share code, notes, and snippets.

@pansapiens
Last active June 6, 2019 02:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pansapiens/68e231429789444e8472079fcf81316e to your computer and use it in GitHub Desktop.
Save pansapiens/68e231429789444e8472079fcf81316e to your computer and use it in GitHub Desktop.
nullarbor Dockerfile

Assuming the Docker image has been built and pushed to Dockerhub, and you've downloaded the raw reads and reference genome into /mnt/nullarbor_test/input, you can run it under Singularity like:

singularity run --bind /mnt/nullarbor_test/input:/input \
                --bind /mnt/nullarbor_test/output:/output \
                docker://pansapiens/nullarbor:latest \
                --name PRJEB13012 --mlst efaecium \
                --ref /input/Enterococcus_faecium_505.ASM29533v2.dna_sm.toplevel.fa \
                --input /input/samples.tsv --force --outdir /output/
FROM continuumio/miniconda3
LABEL maintainer="Andrew Perry <andrew.perry@monash.edu>"
ARG KRAKEN_DB_URL=https://ccb.jhu.edu/software/kraken/dl/minikraken_20171019_4GB.tgz
ARG CENTRIFUGE_DB_URL=ftp://ftp.ccb.jhu.edu/pub/infphilo/centrifuge/data/p_compressed+h+v.tar.gz
ENV KRAKEN_DB_PATH=/databases/minikraken
ENV CENTRIFUGE_DB_PATH=/databases/centrifuge-db
ENV KRAKEN_DEFAULT_DB=$KRAKEN_DB_PATH/minikraken_20171013_4GB
ENV CENTRIFUGE_DEFAULT_DB=$CENTRIFUGE_DB_PATH/p_compressed+h+v
ENV PATH="/opt/conda/bin:${PATH}"
RUN echo 'PATH="/opt/conda/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"' >/etc/environment
# RUN useradd --system -s /sbin/nologin nullarbor
RUN apt-get -y update && \
apt-get -y install curl procps build-essential && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p $KRAKEN_DB_PATH && \
curl -fsSL $KRAKEN_DB_URL | tar -C $KRAKEN_DB_PATH -xzvf -
RUN mkdir -p $CENTRIFUGE_DB_PATH && \
curl $CENTRIFUGE_DB_URL | tar -C $CENTRIFUGE_DB_PATH -xvzf -
RUN conda install -y -c bioconda -c conda-forge nullarbor
# samtools openssl fix - this step can be removed once this problem is properly fixed in future package versions
RUN conda install -y -c bioconda samtools=1.9 bcftools --force-reinstall
RUN conda install -y openssl=1.1
RUN conda install -y perl --force-reinstall
# ensure samtools and bcftools run without libcrypto error
RUN samtools --version
RUN bcftools --version
# kraken2 seems to clobber the /opt/conda/libexec/classify binary from kraken,
# so we force install kraken again to ensure classify is the correct version
RUN conda install -y -c bioconda kraken --force-reinstall
# sanity check
RUN nullarbor.pl --check
ENTRYPOINT ["nullarbor.pl"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment