From 24675a01c6094392f8a7d6d6a442fbe989162df3 Mon Sep 17 00:00:00 2001 From: Young Date: Thu, 8 Aug 2024 13:03:31 -0600 Subject: [PATCH] adding ivar version 1.4.3 (#995) --- README.md | 2 +- ivar/1.4.3/Dockerfile | 125 ++++++++++++++++++++++++++++++++++++++++++ ivar/1.4.3/README.md | 39 +++++++++++++ 3 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 ivar/1.4.3/Dockerfile create mode 100644 ivar/1.4.3/README.md diff --git a/README.md b/README.md index 0cfc6542c..546530972 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ To learn more about the docker pull rate limits and the open source software pro | [IPA](https://hub.docker.com/r/staphb/pbipa)
[![docker pulls](https://badgen.net/docker/pulls/staphb/pbipa)](https://hub.docker.com/r/staphb/pbipa) | | https://github.com/PacificBiosciences/pbipa | | [IRMA](https://hub.docker.com/r/staphb/irma/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/irma)](https://hub.docker.com/r/staphb/irma) | | https://wonder.cdc.gov/amd/flu/irma/| | [isPcr](https://users.soe.ucsc.edu/~kent/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/ispcr)](https://hub.docker.com/r/staphb/ispcr) | | https://users.soe.ucsc.edu/~kent/ | -| [iVar](https://hub.docker.com/r/staphb/ivar/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/ivar)](https://hub.docker.com/r/staphb/ivar) | | https://github.com/andersen-lab/ivar | +| [iVar](https://hub.docker.com/r/staphb/ivar/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/ivar)](https://hub.docker.com/r/staphb/ivar) | | https://github.com/andersen-lab/ivar | | [Jasmine](https://hub.docker.com/r/staphb/pbjasmine/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/pbjasmine)](https://hub.docker.com/r/staphb/pbjasmine) | | https://github.com/PacificBiosciences/jasmine | | [Kaptive](https://hub.docker.com/r/staphb/kaptive/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/kaptive)](https://hub.docker.com/r/staphb/kaptive) | | https://github.com/klebgenomics/Kaptive | | [Kleborate](https://hub.docker.com/r/staphb/kleborate/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/kleborate)](https://hub.docker.com/r/staphb/kleborate) | | https://github.com/katholt/Kleborate/
https://github.com/katholt/Kaptive/ | diff --git a/ivar/1.4.3/Dockerfile b/ivar/1.4.3/Dockerfile new file mode 100644 index 000000000..5ce2d06b0 --- /dev/null +++ b/ivar/1.4.3/Dockerfile @@ -0,0 +1,125 @@ +ARG SAMTOOLSVER=1.20 +ARG HTSLIB_VER=${SAMTOOLSVER} +ARG IVARVER=1.4.3 + +FROM ubuntu:jammy as builder + +ARG SAMTOOLSVER +ARG HTSLIB_VER +ARG IVARVER + +# installing htslib +RUN apt-get update && apt-get install --no-install-recommends -y \ + build-essential \ + wget \ + ca-certificates \ + make \ + bzip2 \ + autoconf \ + automake \ + make \ + gcc \ + perl \ + zlib1g-dev \ + libbz2-dev \ + liblzma-dev \ + libcurl4-gnutls-dev \ + libssl-dev \ + libncurses5-dev \ + procps + +# 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 + +# download, compile, and install samtools +RUN wget -q https://github.com/samtools/samtools/releases/download/${SAMTOOLSVER}/samtools-${SAMTOOLSVER}.tar.bz2 && \ + tar -xjf samtools-${SAMTOOLSVER}.tar.bz2 && \ + cd samtools-${SAMTOOLSVER} && \ + ./configure && \ + make && \ + make install && \ + make test + +# installing iVar; make /data +RUN wget -q https://github.com/andersen-lab/ivar/archive/v${IVARVER}.tar.gz && \ + tar -xf v${IVARVER}.tar.gz && \ + rm -rf v${IVARVER}.tar.gz && \ + cd ivar-${IVARVER} && \ + ./autogen.sh && \ + ./configure && \ + make && \ + make install + +FROM ubuntu:jammy as app + +ARG IVARVER + +LABEL base.image="ubuntu:jammy" +LABEL dockerfile.version="1" +LABEL software="iVar" +LABEL software.version=${IVARVER} +LABEL description="Computational package that contains functions broadly useful for viral amplicon-based sequencing." +LABEL website="https://github.com/andersen-lab/ivar" +LABEL license="https://github.com/andersen-lab/ivar/blob/master/LICENSE" +LABEL maintainer="Erin Young" +LABEL maintainer.email="eriny@utah.gov" +LABEL maintainer2="Curtis Kapsak" +LABEL maintainer2.email="kapsakcj@gmail.com" +LABEL modified.from="https://github.com/andersen-lab/ivar/blob/master/Dockerfile" +LABEL original.maintainer="Kathik G" +LABEL original.maintainer.email="gkarthik@scripps.edu" + +# install dependencies, cleanup apt garbage. +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates \ + procps \ + libcurl3-gnutls && \ + apt-get autoclean && rm -rf /var/lib/apt/lists/* + +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/ + +WORKDIR /data + +ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" + +CMD ivar help + +FROM app as test + +WORKDIR /test + +RUN ivar help && ivar version && samtools --version + +RUN apt-get update && apt-get install -y wget + +# getting files +RUN wget -q https://github.com/StaPH-B/docker-builds/blob/master/tests/SARS-CoV-2/SRR13957123.sorted.bam?raw=true -O SRR13957123.sorted.bam && \ + samtools view -s 0.25 -b SRR13957123.sorted.bam | samtools sort -o SRR13957123.subsampled.bam - && samtools index SRR13957123.subsampled.bam && \ + wget -q https://raw.githubusercontent.com/artic-network/artic-ncov2019/master/primer_schemes/nCoV-2019/V3/nCoV-2019.reference.fasta -O MN908947.3.fasta && \ + wget -q https://raw.githubusercontent.com/artic-network/artic-ncov2019/master/primer_schemes/nCoV-2019/V3/nCoV-2019.primer.bed && \ + wget -q https://github.com/StaPH-B/docker-builds/blob/83ee344304794f4ffa162d1c082bb35f916badcf/tests/SARS-CoV-2/SRR13957123_1.fastq.gz?raw=true -O SRR13957123_1.fastq.gz && \ + wget -q https://github.com/StaPH-B/docker-builds/blob/83ee344304794f4ffa162d1c082bb35f916badcf/tests/SARS-CoV-2/SRR13957123_2.fastq.gz?raw=true -O SRR13957123_2.fastq.gz + +# primer trimming +RUN ivar trim -e -i SRR13957123.subsampled.bam -b nCoV-2019.primer.bed -p SRR13957123.primertrim && \ + samtools sort SRR13957123.primertrim.bam -o SRR13957123.primertrim.sorted.bam + +# creating a consensus - using smaller -d for github actions +RUN samtools mpileup -A -d 40 -B -Q 0 --reference MN908947.3.fasta SRR13957123.primertrim.sorted.bam | \ + ivar consensus -q 20 -t 0.6 -n N -m 20 -p SRR13957123.consensus && \ + wc -c SRR13957123.consensus* + +# piping into ivar takes too long, but here's what the test would be +# RUN bwa index MN908947.3.fasta && \ +# bwa mem MN908947.3.fasta SRR13957123_1.fastq.gz SRR13957123_2.fastq.gz | \ +# ivar trim -b nCoV-2019.primer.bed -x 3 -m 30 | \ +# samtools sort | samtools mpileup -aa -A -Q 0 -B -d 200 --reference MN908947.3.fasta - | \ +# ivar consensus -p test_consensus -m 10 -n N -t 0.5 diff --git a/ivar/1.4.3/README.md b/ivar/1.4.3/README.md new file mode 100644 index 000000000..214ef3a90 --- /dev/null +++ b/ivar/1.4.3/README.md @@ -0,0 +1,39 @@ +# iVar container + +Main tool : [iVar](https://andersen-lab.github.io/ivar/html/manualpage.html) + +> iVar is a computational package that contains functions broadly useful for viral amplicon-based sequencing + +Additional tools (required): + +* [HTSlib](https://github.com/samtools/htslib) 1.20 +* [samtools](http://www.htslib.org/) 1.20 + +## Example Usage + +```bash +ivar trim -e -i {bam} -b {primer bed} -p {sample}.primertrim +``` + +```bash +samtools mpileup -A -d 8000 -B -Q 0 --reference {reference.fasta} {bam} | \ + ivar variants -p {sample}.variants -q 20 -t 0.6 -r {reference.fasta} -g {reference.gff} +``` + +```bash +samtools mpileup -A -d 8000 -B -Q 0 --reference {reference.fasta} {bam} | \ + ivar consensus -t 0.6 -p {sample}.consensus -n N +``` + +Starting with iVar version 1.4.1, the output of an aligner such as minimap2 and bwa (both included) can be piped into ivar trim directly +```bash +# index reference +bwa index reference.fasta + +# run bwa and pipe into ivar (single line is split with \ for clarity) +bwa mem reference.fasta read_1.fastq.gz read_2.fastq.gz | \ + ivar trim -b primer.bed -x 3 -m 30 | \ + samtools sort | \ + samtools mpileup -aa -A -Q 0 -B -d 2000 - | \ + ivar consensus -p output_prefix -m 10 -n N -t 0.5 +```