diff --git a/README.md b/README.md index ea969ee12..857f8b951 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ To learn more about the docker pull rate limits and the open source software pro | [bakta](https://hub.docker.com/r/staphb/bakta)
[![docker pulls](https://badgen.net/docker/pulls/staphb/bakta)](https://hub.docker.com/r/staphb/bakta) | | https://github.com/oschwengers/bakta | | [bandage](https://hub.docker.com/r/staphb/bandage)
[![docker pulls](https://badgen.net/docker/pulls/staphb/bandage)](https://hub.docker.com/r/staphb/bandage) | | https://rrwick.github.io/Bandage/ | | [BBTools](https://hub.docker.com/r/staphb/bbtools/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/bbtools)](https://hub.docker.com/r/staphb/bbtools) | | https://jgi.doe.gov/data-and-tools/bbtools/ | -| [bcftools](https://hub.docker.com/r/staphb/bcftools/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/bcftools)](https://hub.docker.com/r/staphb/bcftools) | | https://github.com/samtools/bcftools | +| [bcftools](https://hub.docker.com/r/staphb/bcftools/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/bcftools)](https://hub.docker.com/r/staphb/bcftools) | | https://github.com/samtools/bcftools | | [bedtools](https://hub.docker.com/r/staphb/bedtools/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/bedtools)](https://hub.docker.com/r/staphb/bedtools) | | https://bedtools.readthedocs.io/en/latest/
https://github.com/arq5x/bedtools2 | | [berrywood-report-env](https://hub.docker.com/r/staphb/berrywood-report-env/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/berrywood-report-env)](https://hub.docker.com/r/staphb/berrywood-report-env) | | none | | [blast+](https://hub.docker.com/r/staphb/blast/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/blast)](https://hub.docker.com/r/staphb/blast) | | https://www.ncbi.nlm.nih.gov/books/NBK279690/ | diff --git a/bcftools/1.20/Dockerfile b/bcftools/1.20/Dockerfile new file mode 100644 index 000000000..611a0318e --- /dev/null +++ b/bcftools/1.20/Dockerfile @@ -0,0 +1,102 @@ +# for easy upgrade later. ARG variables only persist during build time +ARG BCFTOOLS_VER="1.20" + +FROM ubuntu:jammy as builder + +# re-instantiate variable +ARG BCFTOOLS_VER + +# install dependencies, cleanup apt garbage +RUN apt-get update && apt-get install --no-install-recommends -y \ + wget \ + ca-certificates \ + perl \ + bzip2 \ + autoconf \ + automake \ + make \ + gcc \ + zlib1g-dev \ + libbz2-dev \ + liblzma-dev \ + libcurl4-gnutls-dev \ + libssl-dev \ + libperl-dev \ + libgsl0-dev \ + procps && \ + rm -rf /var/lib/apt/lists/* && apt-get autoclean + +# download, compile, and install bcftools +RUN wget https://github.com/samtools/bcftools/releases/download/${BCFTOOLS_VER}/bcftools-${BCFTOOLS_VER}.tar.bz2 && \ + tar -xjf bcftools-${BCFTOOLS_VER}.tar.bz2 && \ + rm -v bcftools-${BCFTOOLS_VER}.tar.bz2 && \ + cd bcftools-${BCFTOOLS_VER} && \ + make && \ + make install && \ + make test + +### start of app stage ### +FROM ubuntu:jammy as app + +# re-instantiate variable +ARG BCFTOOLS_VER + +# putting the labels in +LABEL base.image="ubuntu:jammy" +LABEL dockerfile.version="1" +LABEL software="bcftools" +LABEL software.version="${BCFTOOLS_VER}" +LABEL description="Variant calling and manipulating files in the Variant Call Format (VCF) and its binary counterpart BCF" +LABEL website="https://github.com/samtools/bcftools" +LABEL license="https://github.com/samtools/bcftools/blob/develop/LICENSE" +LABEL maintainer="Erin Young" +LABEL maintainer.email="eriny@utah.gov" +LABEL maintainer2="Curtis Kapsak" +LABEL maintainer2.email="kapsakcj@gmail.com" + +# install dependencies required for running bcftools +# https://github.com/samtools/bcftools/blob/develop/INSTALL#L29 +RUN apt-get update && apt-get install --no-install-recommends -y \ + perl \ + zlib1g \ + libncurses5 \ + bzip2 \ + liblzma-dev \ + libcurl4-gnutls-dev \ + procps \ + && apt-get autoclean && rm -rf /var/lib/apt/lists/* && \ + mkdir /data + +WORKDIR /bcftools/plugins + +# copy in bcftools executables from builder stage +COPY --from=builder /usr/local/bin/* /usr/local/bin/ +COPY --from=builder /bcftools-${BCFTOOLS_VER}/plugins/* /bcftools/plugins + +# set locale settings for singularity compatibility +ENV LC_ALL=C BCFTOOLS_PLUGINS='/bcftools/plugins' + +# set final working directory +WORKDIR /data + +# default command is to pull up help optoins +CMD ["bcftools", "--help"] + +### start of test stage ### +FROM app as test + +# running --help and listing plugins +RUN bcftools --help && bcftools plugin -lv + +# install wget for downloading test files +RUN apt-get update && apt-get install --no-install-recommends -y wget ca-certificates + +RUN echo "downloading test SC2 BAM and FASTA and running bcftools mpileup and bcftools call test commands..." && \ + wget -q https://raw.githubusercontent.com/artic-network/artic-ncov2019/master/primer_schemes/nCoV-2019/V4/SARS-CoV-2.reference.fasta && \ + wget -q https://raw.githubusercontent.com/StaPH-B/docker-builds/master/tests/SARS-CoV-2/SRR13957123.primertrim.sorted.bam && \ + bcftools mpileup -A -d 200 -B -Q 0 -f SARS-CoV-2.reference.fasta SRR13957123.primertrim.sorted.bam | \ + bcftools call -mv -Ov -o SRR13957123.vcf + +# FYI Test suite "make test" is performed in the builder stage since app and +# test stages do not include bcftools source code. +# This is to avoid having to re-download source code simply to run test suite diff --git a/bcftools/1.20/README.md b/bcftools/1.20/README.md new file mode 100644 index 000000000..d1376bb34 --- /dev/null +++ b/bcftools/1.20/README.md @@ -0,0 +1,13 @@ +# bcftools container + +Main tool: + +* [bcftools](https://github.com/samtools/bcftools) + +## Example Usage + +```bash +bcftools mpileup -A -d 200 -B -Q 0 -f {reference_genome} {bam} | bcftools call -mv -Ov -o bcftools_variants/{sample}.vcf +``` + +Better documentation can be found at [https://www.htslib.org/doc/bcftools.html](https://www.htslib.org/doc/bcftools.html)