From 6feeb2634db6fb9fd72f8c4dbf8688bda11bcde1 Mon Sep 17 00:00:00 2001 From: Young Date: Wed, 22 Nov 2023 12:01:47 -0700 Subject: [PATCH] bedtools version 2.31.1 (#790) * added version 2.31.1 * readjusted labels and tests --- README.md | 2 +- bedtools/2.31.1/Dockerfile | 98 ++++++++++++++++++++++++++++++++++++++ bedtools/2.31.1/README.md | 63 ++++++++++++++++++++++++ 3 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 bedtools/2.31.1/Dockerfile create mode 100644 bedtools/2.31.1/README.md diff --git a/README.md b/README.md index 0b04a691f..768e6165a 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ To learn more about the docker pull rate limits and the open source software pro | [Auspice](https://github.com/nextstrain/auspice)
[![docker pulls](https://badgen.net/docker/pulls/staphb/auspice)](https://hub.docker.com/r/staphb/auspice) | | https://github.com/nextstrain/auspice | | [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 | -| [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 | +| [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/ | | [bowtie2](https://hub.docker.com/r/staphb/bowtie2/)
[![docker pulls](https://badgen.net/docker/pulls/staphb/bowtie2)](https://hub.docker.com/r/staphb/bowtie2) | | http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml
https://github.com/BenLangmead/bowtie2 | diff --git a/bedtools/2.31.1/Dockerfile b/bedtools/2.31.1/Dockerfile new file mode 100644 index 000000000..d6e850580 --- /dev/null +++ b/bedtools/2.31.1/Dockerfile @@ -0,0 +1,98 @@ +ARG BEDTOOLS_VER="2.31.1" + +### builder stage for compiling bedtools code ### +FROM ubuntu:jammy as builder + +# re-instantiate variable so we can use it in builder stage +ARG BEDTOOLS_VER + +# install deps via apt-get, these are mainly for compiling bedtools code and for running tests. some are for downloading files (wget, ca-certificates) +# last command is to point 'python' cmd to `python3` so that bedtools test scripts work. There are bash scripts that call 'python' +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + zlib1g-dev \ + libghc-bzlib-dev \ + liblzma-dev \ + wget \ + ca-certificates \ + python3 && \ + apt-get autoclean && rm -rf /var/lib/apt/lists/* && \ + update-alternatives --install /usr/bin/python python /usr/bin/python3 10 + +# python3 required when compiling via `make` command for creating old CLI executables +# dependencies listed here (albeit for v2.30.0, still should be identical): https://packages.ubuntu.com/jammy/bedtools +# requires libghc-bzlib-dev, build-essential, zlib1g-dev, and a few others +# 'make install' should place binary executable files in /usr/local/bin +RUN wget -q https://github.com/arq5x/bedtools2/archive/refs/tags/v${BEDTOOLS_VER}.tar.gz && \ + tar -xzf v${BEDTOOLS_VER}.tar.gz && \ + cd bedtools2-${BEDTOOLS_VER} && \ + make && \ + make install + +### keeping old installation cmds here in case we want to install via pre-compiled binary again in the future ### +# RUN cd /usr/local/bin && \ +# wget https://github.com/arq5x/bedtools2/releases/download/v${BEDTOOLS_VER}/bedtools.static && \ +# mv bedtools.static bedtools && \ +# chmod +x bedtools && \ +# mkdir /data + +### testing in builder ### +# test scripts expect to be run from the bedtools root dir +WORKDIR /bedtools2-${BEDTOOLS_VER} + +# commenting out ulimit command in test/test.sh (gitpod complains) +# run tests included with bedtools code +RUN sed -i 's/ulimit/#ulimit/g' test/test.sh && \ + make test + +### final app stage ### +# starting from fresh base image instead of a previous stage +FROM ubuntu:jammy as app + +ARG BEDTOOLS_VER + +LABEL base.image="ubuntu:jammy" +LABEL dockerfile.version="1" +LABEL software="bedtools" +LABEL software.version="${BEDTOOLS_VER}" +LABEL description="bedtools - the swiss army knife for genome arithmetic" +LABEL website="https://github.com/arq5x/bedtools2" +LABEL license="https://github.com/arq5x/bedtools2/blob/master/LICENSE" +LABEL maintainer="Curtis Kapsak" +LABEL maintainer.email="kapsakcj@gmail.com" +LABEL maintainer2="Erin Young" +LABEL maintainer2.email="eriny@utah.gov" + +# copy in all bedtools executable files from builder stage to final app stage +COPY --from=builder /usr/local/bin/* /usr/local/bin + +RUN apt-get update && apt-get install -y --no-install-recommends \ + wget \ + ca-certificates \ + procps && \ + apt-get autoclean && rm -rf /var/lib/apt/lists/* + +# setting just in case for singularity compatibility +ENV LC_ALL=C + +# default command is to print help options +CMD [ "bedtools", "--help" ] + +# set final working directory to /data +WORKDIR /data + +FROM app as test + +# check help options and version +RUN bedtools --help && \ + bedtools --version + +# downloads two bedfiles for ARTIC SARS-CoV-2 artic schemes, fixes their formatting, uses bedtools sort, intersect, and merge +RUN wget https://raw.githubusercontent.com/artic-network/artic-ncov2019/master/primer_schemes/nCoV-2019/V5.3.2/SARS-CoV-2.primer.bed -O V5.3.2.artic.bed && \ + wget https://raw.githubusercontent.com/artic-network/artic-ncov2019/master/primer_schemes/nCoV-2019/V4.1/SARS-CoV-2.primer.bed -O V4.1.artic.bed && \ + awk '{print $1 "\t" $2 "\t" $3 "\t" $4 "\t" $5 "\t" $6}' V5.3.2.artic.bed > V5.3.2.unsorted.bed && \ + bedtools sort -i V5.3.2.unsorted.bed > V5.3.2.bed && \ + awk '{print $1 "\t" $2 "\t" $3 "\t" $4 "\t" $5 "\t" $6}' V4.1.artic.bed > V4.1.bed && \ + bedtools intersect -a V5.3.2.bed -b V4.1.bed > intersect_test.bed && \ + mergeBed -i V5.3.2.bed > merged_test.bed && \ + head intersect_test.bed merged_test.bed \ No newline at end of file diff --git a/bedtools/2.31.1/README.md b/bedtools/2.31.1/README.md new file mode 100644 index 000000000..d5391c74a --- /dev/null +++ b/bedtools/2.31.1/README.md @@ -0,0 +1,63 @@ +# bedtools2 container + +GitHub Repo: [bedtools](https://github.com/arq5x/bedtools2/) + +Full documentation: [https://bedtools.readthedocs.io/en/latest/index.html](https://bedtools.readthedocs.io/en/latest/index.html) + +> Collectively, the bedtools utilities are a swiss-army knife of tools for a wide-range of genomics analysis tasks. The most widely-used tools enable genome arithmetic: that is, set theory on the genome. For example, bedtools allows one to intersect, merge, count, complement, and shuffle genomic intervals from multiple files in widely-used genomic file formats such as BAM, BED, GFF/GTF, VCF. While each individual tool is designed to do a relatively simple task (e.g., intersect two interval files), quite sophisticated analyses can be conducted by combining multiple bedtools operations on the UNIX command line. + +List of sub-commands in bedtools 2.31.0: + +- annotate +- bamtobed +- bamtofastq +- bed12tobed6 +- bedpetobam +- bedtobam +- closest +- cluster +- complement +- coverage +- expand +- flank +- fisher +- genomecov +- getfasta +- groupby +- igv +- intersect +- jaccard +- links +- makewindows +- map +- maskfasta +- merge +- multicov +- multiinter +- nuc +- overlap +- pairtobed +- pairtopair +- random +- reldist +- shift +- shuffle +- slop +- sort +- subtract +- summary +- tag +- unionbedg +- window + +## Example Usage + +```bash +# bedtools consists of a suite of sub-commands that are invoked as follows: +# bedtools [sub-command] [options] + +# For example, to intersect two BED files, one would invoke the following: +bedtools intersect -a a.bed -b b.bed +``` + +More examples are found in the [bedtools tutorial](http://quinlanlab.org/tutorials/bedtools/bedtools.html)