Skip to content

Commit

Permalink
updating htslib to 1.21 (#1060)
Browse files Browse the repository at this point in the history
* updating htslib to 1.21

* Update README.md

v.1.20 -> v.1.21

---------

Co-authored-by: Kutluhan Incekara <[email protected]>
  • Loading branch information
erinyoung and Kincekara authored Sep 30, 2024
1 parent 79c98a6 commit 3e3785a
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ To learn more about the docker pull rate limits and the open source software pro
| [heatcluster](https://hub.docker.com/r/staphb/heatcluster) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/heatcluster)](https://hub.docker.com/r/staphb/heatcluster) | <ul><li>[1.0.2c](./heatcluster/1.0.2c/)</li></ul> | https://github.com/DrB-S/heatcluster/tree/main |
| [hmmer](https://hub.docker.com/r/staphb/hmmer) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/hmmer)](https://hub.docker.com/r/staphb/hmmer) | <ul><li>[3.3](hmmer/3.3/)</li><li>[3.3.2](hmmer/3.3.2/)</li><li>[3.4](./hmmer/3.4/)</li></ul> | http://hmmer.org/ |
| [homopolish](https://hub.docker.com/r/staphb/homopolish) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/homopolish)](https://hub.docker.com/r/staphb/homopolish) | <ul><li>0.4.1</li></ul> | https://github.com/ythuang0522/homopolish/ |
| [htslib](https://hub.docker.com/r/staphb/htslib) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/htslib)](https://hub.docker.com/r/staphb/htslib) | <ul><li>[1.14](./htslib/1.14)</li><li>[1.15](./htslib/1.15)</li><li>[1.16](./htslib/1.16)</li><li>[1.17](./htslib/1.17)</li><li>[1.18](./htslib/1.18/)</li><li>[1.19](./htslib/1.19/)</li><li>[1.20](./htslib/1.20/)</li><li>[1.20.c](./htslib/1.20.c/)</li></ul> | https://www.htslib.org/ |
| [htslib](https://hub.docker.com/r/staphb/htslib) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/htslib)](https://hub.docker.com/r/staphb/htslib) | <ul><li>[1.14](./htslib/1.14)</li><li>[1.15](./htslib/1.15)</li><li>[1.16](./htslib/1.16)</li><li>[1.17](./htslib/1.17)</li><li>[1.18](./htslib/1.18/)</li><li>[1.19](./htslib/1.19/)</li><li>[1.20](./htslib/1.20/)</li><li>[1.20.c](./htslib/1.20.c/)</li><li>[1.21](./htslib/1.21/)</li></ul> | https://www.htslib.org/ |
| [iqtree](https://hub.docker.com/r/staphb/iqtree/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/iqtree)](https://hub.docker.com/r/staphb/iqtree) | <ul><li>1.6.7</li></ul> | http://www.iqtree.org/ |
| [iqtree2](https://hub.docker.com/r/staphb/iqtree2/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/iqtree2)](https://hub.docker.com/r/staphb/iqtree2) | <ul><li>2.1.2</li><li>2.2.2.2</li><li>[2.2.2.6](iqtree2/2.2.2.6/)</li><li>[2.2.2.7](iqtree2/2.2.2.7/)</li><li>[2.3.1](iqtree2/2.3.1/)</li><li>[2.3.4](iqtree2/2.3.4/)</li></ul> | http://www.iqtree.org/ |
| [IPA](https://hub.docker.com/r/staphb/pbipa) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/pbipa)](https://hub.docker.com/r/staphb/pbipa) | <ul><li>[1.8.0](./pbipa/1.8.0/)</li></ul> | https://github.com/PacificBiosciences/pbipa |
Expand Down
97 changes: 97 additions & 0 deletions htslib/1.21/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# for easy upgrade later. ARG variables only persist during build time
ARG HTSLIB_VER="1.21"

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 \
libdeflate-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} && \
./configure && \
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 \
libbz2-1.0 \
liblzma5 \
libcurl3-gnutls \
libdeflate0 \
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/
COPY --from=builder /usr/local/lib/ /usr/local/lib/
COPY --from=builder /usr/local/include/ /usr/local/include/

# 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

RUN apt-get update && apt-get install --no-install-recommends -y wget

# use on actual files
RUN wget -q https://github.com/StaPH-B/docker-builds/raw/master/tests/SARS-CoV-2/SRR13957123_1.fastq.gz && \
gunzip SRR13957123_1.fastq.gz && \
bgzip SRR13957123_1.fastq

# 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
35 changes: 35 additions & 0 deletions htslib/1.21/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# htslib container

Main tool: [htslib](https://www.htslib.org/)

Code repository: https://github.com/samtools/htslib

Additional tools:

* perl 5.34.0

Basic information on how to use this tool:
- executable: htsfile
- help: --help
- version: --version
- description: The htsfile utility attempts to identify what kind of high-throughput sequencing data files the specified files are, and provides minimal viewing capabilities for some kinds of data file.

Additional information:

This container includes htslib v1.21 compiled with **libdeflate** for a better cloud performance.

Full documentation: https://www.htslib.org/doc/samtools.html

## 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
```

0 comments on commit 3e3785a

Please sign in to comment.