-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding version 1.19 for samtools/bcftools/htslib (#830)
* adding version 1.19 * added plugins * added list plugins * Update README.md fix internal bcftools links --------- Co-authored-by: Kutluhan Incekara <[email protected]>
- Loading branch information
Showing
7 changed files
with
344 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# for easy upgrade later. ARG variables only persist during build time | ||
ARG BCFTOOLS_VER="1.19" | ||
|
||
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="[email protected]" | ||
LABEL maintainer2="Curtis Kapsak" | ||
LABEL maintainer2.email="[email protected]" | ||
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# bcftools container | ||
|
||
Main tool: | ||
|
||
* [https://www.htslib.org/](https://www.htslib.org/) | ||
* [GitHub](https://github.com/samtools/bcftools) | ||
|
||
Additional tools: | ||
|
||
* perl 5.34.0 | ||
|
||
## 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# for easy upgrade later. ARG variables only persist during build time | ||
ARG HTSLIB_VER="1.19" | ||
|
||
FROM ubuntu:jammy as builder | ||
|
||
ARG HTSLIB_VER | ||
|
||
# install dependencies, cleanup apt garbage | ||
# It's helpful when they're all listed on https://github.com/samtools/htslib/blob/develop/INSTALL | ||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
wget \ | ||
ca-certificates \ | ||
make \ | ||
bzip2 \ | ||
autoconf \ | ||
automake \ | ||
make \ | ||
gcc \ | ||
perl \ | ||
zlib1g-dev \ | ||
libbz2-dev \ | ||
liblzma-dev \ | ||
libcurl4-gnutls-dev \ | ||
libssl-dev \ | ||
procps && \ | ||
rm -rf /var/lib/apt/lists/* && apt-get autoclean | ||
|
||
# get htslib, compile, install, run test suite | ||
RUN wget -q https://github.com/samtools/htslib/releases/download/${HTSLIB_VER}/htslib-${HTSLIB_VER}.tar.bz2 && \ | ||
tar -vxjf htslib-${HTSLIB_VER}.tar.bz2 && \ | ||
rm -v htslib-${HTSLIB_VER}.tar.bz2 && \ | ||
cd htslib-${HTSLIB_VER} && \ | ||
make && \ | ||
make install && \ | ||
make test | ||
|
||
### start of app stage ### | ||
FROM ubuntu:jammy as app | ||
|
||
ARG HTSLIB_VER | ||
|
||
LABEL base.image="ubuntu:jammy" | ||
LABEL dockerfile.version="1" | ||
LABEL software="htslib" | ||
LABEL software.version="${HTSLIB_VER}" | ||
LABEL description="A C library for reading/writing high-throughput sequencing data" | ||
LABEL website="https://github.com/samtools/htslib" | ||
LABEL license="https://github.com/samtools/htslib/blob/develop/LICENSE" | ||
LABEL maintainer="Erin Young" | ||
LABEL maintainer.email="[email protected]" | ||
LABEL maintainer2="Curtis Kapsak" | ||
LABEL maintainer2.email="[email protected]" | ||
|
||
# install runtime dependencies & cleanup apt garbage | ||
# installed as recommend here: https://github.com/samtools/htslib/blob/develop/INSTALL#L31 | ||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
bzip2 \ | ||
zlib1g-dev \ | ||
libbz2-dev \ | ||
liblzma-dev \ | ||
libcurl4-gnutls-dev \ | ||
ca-certificates \ | ||
&& apt-get autoclean && rm -rf /var/lib/apt/lists/* | ||
|
||
# copy in htslib executables from builder stage | ||
COPY --from=builder /usr/local/bin/* /usr/local/bin/ | ||
|
||
# set locale settings for singularity compatibility | ||
ENV LC_ALL=C | ||
|
||
# set working directory | ||
WORKDIR /data | ||
|
||
# default command is to show help options | ||
CMD ["htsfile", "--help"] | ||
|
||
### start of test stage ### | ||
FROM app as test | ||
|
||
# check that these three executables are available | ||
RUN bgzip --help && tabix --help && htsfile --help | ||
|
||
# FYI Test suite "make test" now performed in the builder stage since app and | ||
# test stages do not include htslib source code. | ||
# This is to avoid having to re-download source code simply to run test suite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# htslib container | ||
|
||
Main tool: | ||
|
||
* [https://www.htslib.org/](https://www.htslib.org/) | ||
* [GitHub](https://github.com/samtools/htslib) | ||
|
||
Additional tools: | ||
|
||
* perl 5.34.0 | ||
|
||
## Example Usage | ||
|
||
```bash | ||
# determine file formats for various BAM and SAM files | ||
$ htsfile tests/SARS-CoV-2/SRR13957123.primertrim.sorted.bam | ||
tests/SARS-CoV-2/SRR13957123.primertrim.sorted.bam: BAM version 1 compressed sequence data | ||
|
||
$ htsfile ce_tag_padded.sam | ||
ce_tag_padded.sam: SAM version 1.4 sequence text | ||
|
||
# compresses sample.fastq to sample.fastq.gz in BGZF format (blocked GNU Zip Format) | ||
$ bgzip sample.fastq | ||
``` | ||
|
||
Better documentation can be found at [https://www.htslib.org/doc/samtools.html](https://www.htslib.org/doc/samtools.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
ARG SAMTOOLS_VER="1.19" | ||
|
||
FROM ubuntu:jammy as builder | ||
|
||
ARG SAMTOOLS_VER | ||
|
||
# install dependencies required for compiling samtools | ||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
libncurses5-dev \ | ||
libbz2-dev \ | ||
liblzma-dev \ | ||
libcurl4-gnutls-dev \ | ||
zlib1g-dev \ | ||
libssl-dev \ | ||
gcc \ | ||
wget \ | ||
make \ | ||
perl \ | ||
bzip2 \ | ||
gnuplot \ | ||
ca-certificates | ||
|
||
# download, compile, and install samtools | ||
RUN wget https://github.com/samtools/samtools/releases/download/${SAMTOOLS_VER}/samtools-${SAMTOOLS_VER}.tar.bz2 && \ | ||
tar -xjf samtools-${SAMTOOLS_VER}.tar.bz2 && \ | ||
cd samtools-${SAMTOOLS_VER} && \ | ||
./configure && \ | ||
make && \ | ||
make install | ||
|
||
### start of app stage ### | ||
FROM ubuntu:jammy as app | ||
|
||
ARG SAMTOOLS_VER | ||
|
||
LABEL base.image="ubuntu:jammy" | ||
LABEL dockerfile.version="1" | ||
LABEL software="samtools" | ||
LABEL software.version="${SAMTOOLS_VER}" | ||
LABEL description="Tools (written in C using htslib) for manipulating next-generation sequencing data" | ||
LABEL website="https://github.com/samtools/samtools" | ||
LABEL license="https://github.com/samtools/samtools/blob/develop/LICENSE" | ||
LABEL maintainer="Shelby Bennett" | ||
LABEL maintainer.email="[email protected]" | ||
LABEL maintainer2="Curtis Kapsak" | ||
LABEL maintainer2.email="[email protected]" | ||
LABEL maintainer3="Erin Young" | ||
LABEL maintainer3.email="[email protected]" | ||
LABEL maintainer4="Kutluhan Incekara" | ||
LABEL maintainer4.email="[email protected]" | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# install dependencies required for running samtools | ||
# 'gnuplot' required for plot-ampliconstats | ||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
perl \ | ||
zlib1g \ | ||
libncurses5 \ | ||
bzip2 \ | ||
liblzma-dev \ | ||
libcurl4-gnutls-dev \ | ||
gnuplot \ | ||
&& apt-get autoclean && rm -rf /var/lib/apt/lists/* | ||
|
||
# copy in samtools executables from builder stage | ||
COPY --from=builder /usr/local/bin/* /usr/local/bin/ | ||
|
||
ENV LC_ALL=C | ||
|
||
# final working directory is /data | ||
WORKDIR /data | ||
|
||
# default command is to pull up help options | ||
CMD ["samtools", "--help"] | ||
|
||
### start of test stage ### | ||
FROM app as test | ||
|
||
# install wget for downloading test files | ||
RUN apt-get update && apt-get install --no-install-recommends -y wget ca-certificates | ||
|
||
RUN wget -q https://raw.githubusercontent.com/StaPH-B/docker-builds/master/tests/SARS-CoV-2/SRR13957123.consensus.fa && \ | ||
wget -q https://raw.githubusercontent.com/StaPH-B/docker-builds/master/tests/SARS-CoV-2/SRR13957123.primertrim.sorted.bam && \ | ||
wget -q https://raw.githubusercontent.com/artic-network/artic-ncov2019/master/primer_schemes/nCoV-2019/V3/nCoV-2019.primer.bed && \ | ||
samtools stats SRR13957123.primertrim.sorted.bam && \ | ||
samtools faidx SRR13957123.consensus.fa && \ | ||
samtools ampliconstats nCoV-2019.primer.bed SRR13957123.primertrim.sorted.bam > SRR13957123_ampliconstats.txt && \ | ||
plot-ampliconstats plot SRR13957123_ampliconstats.txt && \ | ||
ls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# samtools container | ||
|
||
Main tool: | ||
|
||
* [https://www.htslib.org/](https://www.htslib.org/) | ||
* [GitHub](https://github.com/samtools/samtools) | ||
|
||
Additional tools: | ||
|
||
* perl 5.34.0 | ||
|
||
## Example Usage | ||
|
||
```bash | ||
samtools ampliconclip -b bed.file input.bam | ||
|
||
samtools sort -T /tmp/aln.sorted -o aln.sorted.bam aln.bam | ||
``` | ||
|
||
Better documentation can be found at [https://www.htslib.org/doc/samtools.html](https://www.htslib.org/doc/samtools.html) |