|
| 1 | +ARG SAMTOOLS_VER="1.21" |
| 2 | + |
| 3 | +FROM ubuntu:jammy as builder |
| 4 | + |
| 5 | +ARG SAMTOOLS_VER |
| 6 | + |
| 7 | +# install dependencies required for compiling samtools |
| 8 | +RUN apt-get update && apt-get install --no-install-recommends -y \ |
| 9 | + libncurses5-dev \ |
| 10 | + libbz2-dev \ |
| 11 | + liblzma-dev \ |
| 12 | + libcurl4-gnutls-dev \ |
| 13 | + zlib1g-dev \ |
| 14 | + libssl-dev \ |
| 15 | + libdeflate-dev \ |
| 16 | + gcc \ |
| 17 | + wget \ |
| 18 | + make \ |
| 19 | + perl \ |
| 20 | + bzip2 \ |
| 21 | + gnuplot \ |
| 22 | + ca-certificates |
| 23 | + |
| 24 | +# download, compile, and install samtools |
| 25 | +RUN wget -q https://github.com/samtools/samtools/releases/download/${SAMTOOLS_VER}/samtools-${SAMTOOLS_VER}.tar.bz2 && \ |
| 26 | + tar -xjf samtools-${SAMTOOLS_VER}.tar.bz2 && \ |
| 27 | + cd samtools-${SAMTOOLS_VER} && \ |
| 28 | + ./configure && \ |
| 29 | + make && \ |
| 30 | + make install && \ |
| 31 | + make test |
| 32 | + |
| 33 | +### start of app stage ### |
| 34 | +FROM ubuntu:jammy as app |
| 35 | + |
| 36 | +ARG SAMTOOLS_VER |
| 37 | + |
| 38 | +LABEL base.image="ubuntu:jammy" |
| 39 | +LABEL dockerfile.version="1" |
| 40 | +LABEL software="samtools" |
| 41 | +LABEL software.version="${SAMTOOLS_VER}" |
| 42 | +LABEL description="Tools (written in C using htslib) for manipulating next-generation sequencing data" |
| 43 | +LABEL website="https://github.com/samtools/samtools" |
| 44 | +LABEL license="https://github.com/samtools/samtools/blob/develop/LICENSE" |
| 45 | +LABEL maintainer="Shelby Bennett" |
| 46 | +LABEL maintainer.email="shelby.bennett@dgs.virginia.gov" |
| 47 | +LABEL maintainer2="Curtis Kapsak" |
| 48 | +LABEL maintainer2.email="kapsakcj@gmail.com" |
| 49 | +LABEL maintainer3="Erin Young" |
| 50 | +LABEL maintainer3.email="eriny@utah.gov" |
| 51 | +LABEL maintainer4="Kutluhan Incekara" |
| 52 | +LABEL maintainer4.email="kutluhan.incekara@ct.gov" |
| 53 | + |
| 54 | +ARG DEBIAN_FRONTEND=noninteractive |
| 55 | + |
| 56 | +# install dependencies required for running samtools |
| 57 | +# 'gnuplot' required for plot-ampliconstats |
| 58 | +RUN apt-get update && apt-get install --no-install-recommends -y \ |
| 59 | + perl \ |
| 60 | + zlib1g \ |
| 61 | + libncurses5 \ |
| 62 | + bzip2 \ |
| 63 | + liblzma5 \ |
| 64 | + libcurl3-gnutls \ |
| 65 | + libdeflate0 \ |
| 66 | + gnuplot \ |
| 67 | + && apt-get autoclean && rm -rf /var/lib/apt/lists/* |
| 68 | + |
| 69 | +# copy in samtools executables from builder stage |
| 70 | +COPY --from=builder /usr/local/bin/* /usr/local/bin/ |
| 71 | + |
| 72 | +ENV LC_ALL=C |
| 73 | + |
| 74 | +# final working directory is /data |
| 75 | +WORKDIR /data |
| 76 | + |
| 77 | +# default command is to pull up help options |
| 78 | +CMD ["samtools", "--help"] |
| 79 | + |
| 80 | +### start of test stage ### |
| 81 | +FROM app as test |
| 82 | + |
| 83 | +ARG SAMTOOLS_VER |
| 84 | + |
| 85 | +# check PATH |
| 86 | +RUN samtools --help |
| 87 | + |
| 88 | +# install make and wget for downloading test files |
| 89 | +RUN apt-get update && apt-get install --no-install-recommends -y wget ca-certificates |
| 90 | + |
| 91 | +WORKDIR /test |
| 92 | + |
| 93 | +RUN wget -q https://raw.githubusercontent.com/StaPH-B/docker-builds/master/tests/SARS-CoV-2/SRR13957123.consensus.fa && \ |
| 94 | + wget -q https://raw.githubusercontent.com/StaPH-B/docker-builds/master/tests/SARS-CoV-2/SRR13957123.primertrim.sorted.bam && \ |
| 95 | + wget -q https://raw.githubusercontent.com/artic-network/artic-ncov2019/master/primer_schemes/nCoV-2019/V3/nCoV-2019.primer.bed && \ |
| 96 | + samtools stats SRR13957123.primertrim.sorted.bam && \ |
| 97 | + samtools faidx SRR13957123.consensus.fa && \ |
| 98 | + samtools ampliconstats nCoV-2019.primer.bed SRR13957123.primertrim.sorted.bam > SRR13957123_ampliconstats.txt && \ |
| 99 | + plot-ampliconstats plot SRR13957123_ampliconstats.txt && \ |
| 100 | + ls |
0 commit comments