├── .gitignore ├── LICENSE ├── README.md ├── amr ├── Dockerfile ├── README.md └── build-image.sh ├── blast-static ├── Dockerfile ├── README.md ├── build-image.sh └── create-multi-arch-image.sh ├── blast-workbench ├── .dockerignore ├── Dockerfile ├── README.md ├── build-image.sh ├── magicblast-wrapper.sh └── test.sh ├── blast ├── .dockerignore ├── 2.10.0 │ ├── Dockerfile │ ├── VERSION │ └── build-image.sh ├── 2.10.1 │ ├── Dockerfile │ ├── VERSION │ └── build-image.sh ├── 2.11.0 │ ├── Dockerfile │ ├── VERSION │ ├── build-image.sh │ └── update_blastdb.pl ├── 2.12.0 │ ├── Dockerfile │ ├── VERSION │ └── build-image.sh ├── 2.13.0 │ ├── Dockerfile │ ├── VERSION │ └── build-image.sh ├── 2.14.0 │ ├── Dockerfile │ ├── VERSION │ ├── blastn.sh │ ├── blastp.sh │ ├── blastx.sh │ ├── build-image.sh │ ├── tblastn.sh │ └── tblastx.sh ├── 2.14.1 │ ├── Dockerfile │ ├── VERSION │ ├── blastn.sh │ ├── blastp.sh │ ├── blastx.sh │ ├── build-image.sh │ ├── tblastn.sh │ └── tblastx.sh ├── 2.15.0 │ ├── Dockerfile │ ├── VERSION │ ├── blastn.sh │ ├── blastp.sh │ ├── blastx.sh │ ├── build-image.sh │ ├── tblastn.sh │ └── tblastx.sh ├── 2.16.0 │ ├── Dockerfile │ ├── VERSION │ ├── blastn.sh │ ├── blastp.sh │ ├── blastx.sh │ ├── build-image.sh │ ├── tblastn.sh │ └── tblastx.sh ├── 2.7.1 │ ├── Dockerfile │ ├── VERSION │ └── build-image.sh ├── 2.8.0 │ ├── Dockerfile │ ├── VERSION │ └── build-image.sh ├── 2.8.1 │ ├── Dockerfile │ ├── VERSION │ └── build-image.sh ├── 2.9.0 │ ├── Dockerfile │ ├── VERSION │ └── build-image.sh ├── LICENSE ├── README.md └── test.sh ├── blastdbs ├── amr │ ├── Dockerfile │ ├── VERSION │ └── build-image.sh ├── contam_filter │ ├── Dockerfile │ ├── VERSION │ └── build-image.sh └── human_genomic │ ├── Dockerfile │ ├── VERSION │ └── build-image.sh ├── edirect ├── .dockerignore ├── Dockerfile ├── README.md ├── VERSION ├── build-image.sh ├── installconfirm └── test.sh ├── hmmer ├── Dockerfile ├── VERSION └── build-image.sh ├── hmmerdbs └── hmmer_amr │ ├── Dockerfile │ ├── VERSION │ └── build-image.sh ├── igblast ├── Dockerfile ├── Makefile └── README.md ├── magicblast ├── Dockerfile ├── README.md ├── VDB_VERSION ├── VERSION ├── build-image.sh └── test-image.sh ├── ncbi-workbench ├── .dockerignore ├── Dockerfile ├── Makefile ├── README.md └── test.sh ├── pgap-standalone ├── Dockerfile ├── VERSION ├── build-image.sh └── fetch_files.sh ├── sra-toolkit ├── Dockerfile ├── Makefile └── README.md └── utils └── docker_clean.sh /.gitignore: -------------------------------------------------------------------------------- 1 | typescript 2 | *.log 3 | *.swp 4 | *~ 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | PUBLIC DOMAIN NOTICE 2 | National Center for Biotechnology Information 3 | 4 | This software/database is a "United States Government Work" under the 5 | terms of the United States Copyright Act. It was written as part of 6 | the author's official duties as a United States Government employee and 7 | thus cannot be copyrighted. This software/database is freely available 8 | to the public for use. The National Library of Medicine and the U.S. 9 | Government have not placed any restriction on its use or reproduction. 10 | 11 | Although all reasonable efforts have been taken to ensure the accuracy 12 | and reliability of the software and data, the NLM and the U.S. 13 | Government do not and cannot warrant the performance or results that 14 | may be obtained by using this software or data. The NLM and the U.S. 15 | Government disclaim all warranties, express or implied, including 16 | warranties of performance, merchantability or fitness for any particular 17 | purpose. 18 | 19 | Please cite the author in any work or product based on this material. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ncbi-docker 2 | Container builders for NCBI Utilities 3 | -------------------------------------------------------------------------------- /amr/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 AS builder 2 | 3 | LABEL maintainer="Arjun Prasad " 4 | 5 | ARG VERSION 6 | 7 | USER root 8 | 9 | # basic setup 10 | # RUN apt-get update && apt-get install -y hmmer ncbi-blast+ libcurl4-openssl-dev curl 11 | # Set up to compile 12 | RUN apt-get update && apt-get install -y hmmer ncbi-blast+ git libcurl4-openssl-dev build-essential 13 | 14 | ARG SOFTWARE_VERSION 15 | 16 | ARG BINARY_URL 17 | 18 | # Install AMRFinderPlus 19 | # WORKDIR /usr/local/bin 20 | # SHELL ["/bin/bash", "-o", "pipefail", "-c"] 21 | # RUN curl --silent -L ${BINARY_URL} | tar xvfz - 22 | # Compile AMRFinderPlus -- Requires Set up to compile above 23 | RUN git clone https://github.com/ncbi/amr.git \ 24 | && cd amr \ 25 | && git submodule update --init \ 26 | && make -j -O \ 27 | && make install INSTALL_DIR=/amrfinder 28 | 29 | # Now make image for software 30 | FROM ubuntu:22.04 31 | 32 | RUN apt-get update && apt-get install -y hmmer ncbi-blast+ libcurl4-openssl-dev curl 33 | 34 | COPY --from=builder /amrfinder/ /usr/local/bin 35 | 36 | ARG DB_VERSION 37 | 38 | RUN amrfinder -u 39 | 40 | WORKDIR /amrfinder 41 | 42 | # now test 43 | RUN BASE_URL=https://raw.githubusercontent.com/ncbi/amr/master \ 44 | && curl --silent -L \ 45 | -O ${BASE_URL}/test_dna.fa \ 46 | -O ${BASE_URL}/test_prot.fa \ 47 | -O ${BASE_URL}/test_prot.gff \ 48 | -O ${BASE_URL}/test_both.expected \ 49 | -O ${BASE_URL}/test_dna.expected \ 50 | -O ${BASE_URL}/test_dna_mut_all.expected \ 51 | -O ${BASE_URL}/test_prot.expected \ 52 | -O ${BASE_URL}/test_amrfinder.sh \ 53 | && pwd \ 54 | && ls -al \ 55 | && chmod a+x test_amrfinder.sh \ 56 | && ./test_amrfinder.sh -p 57 | 58 | # Test installation 59 | # WORKDIR /amrfinder 60 | #RUN ./test_amrfinder.sh -p 61 | 62 | WORKDIR /data 63 | 64 | # Example commands 65 | # ------------------ 66 | # Run on a local file with 8 threads 67 | # docker run --rm -v ${PWD}:/data ncbi/amr \ 68 | # amrfinder -p test_prot.fa --threads 8 69 | # 70 | # Update the database then run on a local file (new images are released with 71 | # every database release, so you shouldn't need to do this if your image is up 72 | # to date) 73 | # docker run --rm -v ${PWD}:/data ncbi/amr \ 74 | # bash -c 'amrfinder -u && amrfinder -p test_prot.fa --threads 8' \ 75 | # > amrfinder.out 76 | -------------------------------------------------------------------------------- /amr/README.md: -------------------------------------------------------------------------------- 1 | Docker image creation for NCBI's AMRFinderPlus 2 | ================================================ 3 | 4 | [![Latest DockerHub version](https://img.shields.io/docker/v/ncbi/amr/latest?label=docker%20hub)](https://hub.docker.com/r/ncbi/amr) contains both software and database. 5 | 6 | The [AMRFinderPlus](https://github.com/ncbi/amr/wiki) software and the accompanying database are designed to find acquired antimicrobial resistance genes and point mutations in protein and/or assembled nucleotide sequences. We have also added "plus" stress, heat, and biocide resistance and virulence factors for [some organisms](https://github.com/evolarjun/amr/wiki/Curated-organisms). 7 | 8 | See [the AMRFinderPlus wiki](https://github.com/ncbi/amr/wiki) for documentation of the software and database. 9 | 10 | Building 11 | --------- 12 | To build the image use the script `build-image.sh` which will grab the latest versions of software and database from the internet to facilitate tagging of the resulting image. 13 | 14 | Usage 15 | --------- 16 | 17 | ### Run core only on a file with 8 threads 18 | ``` 19 | docker run --rm -v ${PWD}:/data ncbi/amr \ 20 | amrfinder -p test_prot.fa --threads 8 > amrfinder.out 21 | ``` 22 | 23 | ### Update the database then run AMRFinderPlus 24 | 25 | Note that this image contains both software and database. It is updated at dockerhub with 26 | every software and database release, so if your docker image is up-to-date then 27 | you shouldn't need to update the database to get the latest results. 28 | 29 | ``` 30 | docker run --rm -v ${PWD}:/data ncbi/amr \ 31 | bash -c 'amrfinder -u && amrfinder -p test_prot.fa --threads 8' \ 32 | > amrfinder.out 33 | ``` 34 | 35 | See [Running AMRFinderPlus](https://github.com/ncbi/amr/wiki/Running-AMRFinderPlus) for details on AMRFinderPlus command-line options. 36 | 37 | -------------------------------------------------------------------------------- /amr/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | # Increment this to build from base including dependencies 4 | VERSION=1.13 5 | 6 | get_tarball_url() { 7 | curl --silent "https://api.github.com/repos/$1/releases/latest" | 8 | fgrep '"browser_download_url":' | 9 | cut -d '"' -f 4 10 | } 11 | 12 | USERNAME=ncbi 13 | IMAGE=amr 14 | 15 | echo -n "Getting latest software version... " 16 | SOFTWARE_VERSION=`curl --silent https://raw.githubusercontent.com/ncbi/amr/master/version.txt` 17 | echo "$SOFTWARE_VERSION" 18 | 19 | echo -n "Getting latest database version... " 20 | DB_VERSION=`curl --silent https://ftp.ncbi.nlm.nih.gov/pathogen/Antimicrobial_resistance/AMRFinderPlus/database/latest/version.txt` 21 | echo "$DB_VERSION" 22 | 23 | BINARY_URL=$(get_tarball_url ncbi/amr) 24 | VERSION_TAG="${SOFTWARE_VERSION}-$DB_VERSION" 25 | 26 | echo "Running docker build..." 27 | docker build --build-arg VERSION=${VERSION} --build-arg DB_VERSION=${DB_VERSION} \ 28 | --build-arg SOFTWARE_VERSION=${SOFTWARE_VERSION} \ 29 | --build-arg BINARY_URL=${BINARY_URL} \ 30 | -t $USERNAME/$IMAGE:$VERSION_TAG . \ 31 | --progress=plain \ 32 | && docker tag $USERNAME/$IMAGE:$VERSION_TAG $USERNAME/$IMAGE:latest 33 | 34 | echo $VERSION_TAG > version_tag.txt 35 | 36 | # temp for testing 37 | # USERNAME=ncbi 38 | # IMAGE=amr 39 | # VERSION_TAG=3.10.23-2021-12-21.1 40 | 41 | # Run some tests 42 | echo "Testing new image... " 43 | docker run --rm $USERNAME/$IMAGE:$VERSION_TAG bash -c 'cd /amrfinder && ./test_amrfinder.sh -p' 44 | if [ $? -gt 0 ] 45 | then 46 | >&2 echo "ERROR! Tests for $USERNAME/$IMAGE:$VERSION_TAG failed" 47 | exit 1 48 | else 49 | >&2 echo "Tests successful!" 50 | >&2 echo "To push to dockerhub run:" 51 | >&2 echo "docker push ncbi/amr:$VERSION_TAG" 52 | fi 53 | -------------------------------------------------------------------------------- /blast-static/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | ARG version 3 | 4 | USER root 5 | RUN apt-get -y -m update && apt-get install -y wget curl libidn-dev libnet-perl liblist-moreutils-perl perl-doc libgomp1 libxml2 libsqlite3-dev 6 | 7 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 8 | WORKDIR /blast 9 | 10 | RUN if [ $(uname -m) = x86_64 ] ; then arch=x64; \ 11 | elif [ $(uname -m) = aarch64 ] ; then arch=aarch64; \ 12 | else echo "Architecture $(uname -m) is not supported" >&2; exit 1; \ 13 | fi && wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-${arch}-linux.tar.gz && tar xzf ncbi-blast-${version}+-${arch}-linux.tar.gz --strip-components=1 && rm ncbi-blast-${version}+-${arch}-linux.tar.gz 14 | 15 | 16 | # Needed for 2.13.0 Linux amd64 release 17 | RUN if [ -d "ncbi-blast-${version}+" ] ; then \ 18 | cp -R "ncbi-blast-${version}+/bin" . ; \ 19 | rm -R "ncbi-blast-${version}+"; \ 20 | fi 21 | 22 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 23 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 24 | ENV BLAST_DOCKER true 25 | ENV PATH="/blast/bin:${PATH}" 26 | 27 | CMD ["/bin/sh"] 28 | -------------------------------------------------------------------------------- /blast-static/README.md: -------------------------------------------------------------------------------- 1 | # blast-static 2 | 3 | Tools to create a docker image with statically linked BLAST programs for Linux amd64 and arm64/v8 architectures. 4 | 5 | To create a multi-architecture image: 6 | 1. Run `build-image.sh` script on an amd64 and arm64 machines to create and push the images with tags that end with `-amd64` and `-arm64`. 7 | 2. Run `create-multi-arch-image.sh`. 8 | 9 | `create-multi-arch-image.sh` with default parameters creates an image tagged `blast-static:${VERSION}`. To create and push the image tagged `latest`, run: 10 | 11 | ``` 12 | create-multi-arch-image.sh ncbi latest 13 | ``` 14 | -------------------------------------------------------------------------------- /blast-static/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -xeuo pipefail 3 | 4 | DOCKERHUB_USERNAME=${1:-"ncbi"} 5 | IMAGE=blast-static 6 | VERSION=$(curl -sSL https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/VERSION) 7 | 8 | case $(uname -m) in 9 | x86_64) ARCH=amd64;; 10 | aarch64) ARCH=arm64;; 11 | esac 12 | 13 | 14 | docker build --build-arg version="${VERSION}" -t "$DOCKERHUB_USERNAME"/$IMAGE:"$VERSION" --pull --no-cache . 2>&1 | tee build.log 15 | docker tag "$DOCKERHUB_USERNAME"/$IMAGE:"$VERSION" "$DOCKERHUB_USERNAME"/$IMAGE:latest 16 | docker tag "$DOCKERHUB_USERNAME"/$IMAGE:"$VERSION" "$DOCKERHUB_USERNAME"/$IMAGE:"${VERSION}"-${ARCH} 17 | -------------------------------------------------------------------------------- /blast-static/create-multi-arch-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DOCKERHUB_USERNAME=${1:-"ncbi"} 4 | IMAGE=blast-static 5 | VERSION=${2:-$(curl -sSL https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/VERSION)} 6 | 7 | docker manifest create "$DOCKERHUB_USERNAME"/$IMAGE:"$VERSION" \ 8 | --amend "$DOCKERHUB_USERNAME"/$IMAGE:"${VERSION}"-amd64 \ 9 | --amend "$DOCKERHUB_USERNAME"/$IMAGE:"${VERSION}"-arm64 10 | 11 | # The command below pushes multi-architecture image to docker hub 12 | #docker manifest push $DOCKERHUB_USERNAME/$IMAGE:$VERSION 13 | -------------------------------------------------------------------------------- /blast-workbench/.dockerignore: -------------------------------------------------------------------------------- 1 | *.log 2 | build-image.sh 3 | test.sh 4 | -------------------------------------------------------------------------------- /blast-workbench/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/edirect as edirect 2 | FROM ncbi/magicblast as magicblast 3 | FROM ncbi/blast 4 | 5 | LABEL Description="NCBI BLAST tools" \ 6 | Vendor="NCBI/NLM/NIH" \ 7 | URL="https://blast.ncbi.nlm.nih.gov" \ 8 | Maintainer=camacho@ncbi.nlm.nih.gov 9 | 10 | COPY --from=edirect /usr/local/ncbi/edirect /root/edirect 11 | RUN apt-get -y -m update && apt-get install -y curl vmtouch cpanminus libxml-simple-perl libwww-perl libjson-perl libnet-perl && rm -rf /var/lib/apt/lists/* && cpanm HTML::Entities 12 | 13 | RUN mkdir -p /magicblast/bin /magicblast/lib 14 | COPY --from=magicblast /blast/bin/magicblast /magicblast/bin/magicblast.REAL 15 | COPY ./magicblast-wrapper.sh /magicblast/bin/magicblast 16 | RUN chmod +x /magicblast/bin/magicblast 17 | COPY --from=magicblast /blast/lib /magicblast/lib 18 | 19 | ENV PATH "/root/edirect:/blast/bin:/magicblast/bin:${PATH}" 20 | ENV BLASTDB "/blast/blastdb:/blast/blastdb_custom" 21 | CMD ["/bin/bash"] 22 | -------------------------------------------------------------------------------- /blast-workbench/README.md: -------------------------------------------------------------------------------- 1 | # blast-workbench 2 | 3 | This (experimental) Docker image contains the latest versions of the following [NCBI][1] software: 4 | 5 | * [BLAST+][blast_man] command line applications 6 | * [MagicBLAST][mb_doc] 7 | * [EDirect][edir_doc] 8 | 9 | # How to use this image? 10 | 11 | ## How to run BLAST? 12 | 13 | Please see the [NCBI BLAST+ Docker image documentation][blast_docker] and replace `ncbi/blast` with 14 | `ncbi/blast-workbench`. 15 | 16 | ## How to run EDirect? 17 | 18 | ```bash 19 | docker run --rm \ 20 | -v $HOME/queries:/blast/queries:rw \ 21 | ncbi/blast-workbench \ 22 | sh -c 'efetch -db protein -id NP_002377 -format fasta > /blast/queries/NP_002377.fsa' 23 | ``` 24 | 25 | You can verify the results of this command on the local host as follows: 26 | 27 | `ls -l $HOME/queries` 28 | 29 | 30 | The [test.sh](./test.sh) script shows some example commands. 31 | 32 | [1]: https://www.ncbi.nlm.nih.gov 33 | [blast_man]: https://www.ncbi.nlm.nih.gov/books/NBK279690/ 34 | [mb_doc]: https://ncbi.github.io/magicblast/ 35 | [edir_doc]: https://dataguide.nlm.nih.gov/edirect/documentation.html 36 | [blast_docker]: https://github.com/ncbi/docker/blob/master/blast/README.md 37 | -------------------------------------------------------------------------------- /blast-workbench/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | DOCKERHUB_USERNAME=${1:-"ncbi"} 4 | IMAGE=blast-workbench 5 | VERSION=0.4 6 | 7 | docker build -t $DOCKERHUB_USERNAME/$IMAGE:$VERSION . 8 | docker tag $DOCKERHUB_USERNAME/$IMAGE:$VERSION $DOCKERHUB_USERNAME/$IMAGE:latest 9 | -------------------------------------------------------------------------------- /blast-workbench/magicblast-wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # magicblast-wrapper.sh: Simple wrapper script for MagicBLAST to properly set 3 | # LD_LIBRARY_PATH 4 | # 5 | # Author: Christiam Camacho (camacho@ncbi.nlm.nih.gov) 6 | # Created: Sat Nov 3 09:55:03 2018 7 | 8 | export LD_LIBRARY_PATH="/magicblast/lib:${LD_LIBRARY_PATH}" 9 | magicblast.REAL $* 10 | 11 | -------------------------------------------------------------------------------- /blast-workbench/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | # test.sh: simple test script 3 | # 4 | # Author: Christiam Camacho (camacho@ncbi.nlm.nih.gov) 5 | # Created: Sat Nov 3 08:44:39 2018 6 | 7 | IMG=ncbi/blast-workbench 8 | 9 | time docker run --rm ${IMG} /bin/bash -c "printenv BLASTDB" 10 | time docker run --rm ${IMG} blastn -version 11 | time docker run --rm ${IMG} magicblast -version 12 | time docker run --rm ${IMG} installconfirm 13 | time docker run --rm ${IMG} efetch -db nucleotide -id u00001 -format fasta 14 | time docker run --rm ${IMG} get_species_taxids.sh -n squirrel 15 | time docker run --rm ${IMG} update_blastdb.pl --decompress taxdb 16 | time docker run --rm ${IMG} update_blastdb.pl taxdb --source gcp 17 | -------------------------------------------------------------------------------- /blast/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | README.md 3 | 2.* 4 | -------------------------------------------------------------------------------- /blast/2.10.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/edirect as edirect 2 | FROM ubuntu:18.04 as blastbuild 3 | 4 | ARG version 5 | ARG num_procs=8 6 | LABEL Description="NCBI BLAST" Vendor="NCBI/NLM/NIH" Version=${version} Maintainer=camacho@ncbi.nlm.nih.gov 7 | 8 | USER root 9 | WORKDIR /root/ 10 | 11 | RUN apt-get -y -m update && apt-get install -y build-essential curl libidn11 libnet-perl perl-doc liblmdb-dev 12 | 13 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz | \ 14 | tar xzf - && \ 15 | cd ncbi-blast-${version}+-src/c++ && \ 16 | ./configure --with-mt --with-strip --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --with-openmp --without-vdb --without-gnutls --without-gcrypt --prefix=/blast && \ 17 | cd ReleaseMT/build && \ 18 | make -j ${num_procs} -f Makefile.flat blastdb_aliastool.exe blastdbcheck.exe blastdbcmd.exe blast_formatter.exe blastn.exe blastp.exe blastx.exe convert2blastmask.exe deltablast.exe dustmasker.exe makeblastdb.exe makembindex.exe makeprofiledb.exe psiblast.exe rpsblast.exe rpstblastn.exe segmasker.exe tblastn.exe tblastx.exe windowmasker.exe 19 | 20 | 21 | FROM ubuntu:18.04 22 | ARG version 23 | COPY VERSION . 24 | 25 | USER root 26 | WORKDIR /root/ 27 | 28 | RUN apt-get -y -m update && apt-get install -y libgomp1 libnet-perl libxml-simple-perl libjson-perl perl-doc liblmdb-dev parallel vmtouch cpanminus curl && rm -rf /var/lib/apt/lists/* && cpanm HTML::Entities 29 | 30 | RUN mkdir -p /blast/bin /blast/lib 31 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/bin /blast/bin 32 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/lib /blast/lib 33 | 34 | COPY --from=edirect /usr/local/ncbi/edirect /root/edirect 35 | 36 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 37 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 38 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 39 | ENV PATH="/root/edirect:/blast/bin:${PATH}" 40 | 41 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastdb_path -o /blast/bin/blastdb_path && chmod +x /blast/bin/blastdb_path && \ 42 | cp /blast/bin/blastp /blast/bin/blastp.REAL && \ 43 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastp.sh -o /blast/bin/blastp && chmod +x /blast/bin/blastp && \ 44 | cp /blast/bin/blastn /blast/bin/blastn.REAL && \ 45 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastn.sh -o /blast/bin/blastn && chmod +x /blast/bin/blastn && \ 46 | cp /blast/bin/blastx /blast/bin/blastx.REAL && \ 47 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastx.sh -o /blast/bin/blastx && chmod +x /blast/bin/blastx && \ 48 | cp /blast/bin/tblastn /blast/bin/tblastn.REAL && \ 49 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastn.sh -o /blast/bin/tblastn && chmod +x /blast/bin/tblastn && \ 50 | cp /blast/bin/tblastx /blast/bin/tblastx.REAL && \ 51 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastx.sh -o /blast/bin/tblastx && chmod +x /blast/bin/tblastx 52 | RUN echo 'will cite' | parallel --citation 53 | 54 | WORKDIR /blast 55 | 56 | CMD ["/bin/bash"] 57 | 58 | -------------------------------------------------------------------------------- /blast/2.10.0/VERSION: -------------------------------------------------------------------------------- 1 | 2.10.0 2 | -------------------------------------------------------------------------------- /blast/2.10.0/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | DOCKERHUB_USERNAME=${1:-"ncbi"} 4 | IMAGE=blast 5 | VERSION=`cat VERSION` 6 | NP=`grep -c ^proc /proc/cpuinfo` 7 | 8 | docker build --build-arg version=${VERSION} --build-arg num_procs=${NP} -t $DOCKERHUB_USERNAME/$IMAGE:$VERSION . 9 | docker tag $DOCKERHUB_USERNAME/$IMAGE:$VERSION $DOCKERHUB_USERNAME/$IMAGE:latest 10 | -------------------------------------------------------------------------------- /blast/2.10.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/edirect as edirect 2 | FROM ubuntu:18.04 as blastbuild 3 | ARG version 4 | ARG num_procs=8 5 | LABEL Description="NCBI BLAST" Vendor="NCBI/NLM/NIH" Version=${version} Maintainer=camacho@ncbi.nlm.nih.gov 6 | 7 | USER root 8 | WORKDIR /root/ 9 | 10 | RUN apt-get -y -m update && apt-get install -y build-essential curl libidn11 libnet-perl perl-doc liblmdb-dev 11 | 12 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz | \ 13 | tar xzf - && \ 14 | cd ncbi-blast-${version}+-src/c++ && \ 15 | ./configure --with-mt --with-strip --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --with-openmp --without-vdb --without-gnutls --without-gcrypt --prefix=/blast && \ 16 | cd ReleaseMT/build && \ 17 | make -j ${num_procs} -f Makefile.flat blastdb_aliastool.exe blastdbcheck.exe blastdbcmd.exe blast_formatter.exe blastn.exe blastp.exe blastx.exe convert2blastmask.exe deltablast.exe dustmasker.exe makeblastdb.exe makembindex.exe makeprofiledb.exe psiblast.exe rpsblast.exe rpstblastn.exe segmasker.exe tblastn.exe tblastx.exe windowmasker.exe 18 | 19 | FROM google/cloud-sdk:slim as gsutil 20 | ARG version 21 | COPY VERSION . 22 | 23 | USER root 24 | WORKDIR /root/ 25 | 26 | RUN apt-get -y -m update && apt-get install -y libgomp1 libnet-perl libxml-simple-perl libjson-perl perl-doc liblmdb-dev parallel vmtouch cpanminus curl && rm -rf /var/lib/apt/lists/* && cpanm HTML::Entities 27 | 28 | RUN mkdir -p /blast/bin /blast/lib 29 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/bin /blast/bin 30 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/lib /blast/lib 31 | 32 | COPY --from=edirect /usr/local/ncbi/edirect /root/edirect 33 | 34 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 35 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 36 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 37 | ENV PATH="/root/edirect:/blast/bin:${PATH}" 38 | 39 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastdb_path -o /blast/bin/blastdb_path && chmod +x /blast/bin/blastdb_path && \ 40 | cp /blast/bin/blastp /blast/bin/blastp.REAL && \ 41 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastp.sh -o /blast/bin/blastp && chmod +x /blast/bin/blastp && \ 42 | cp /blast/bin/blastn /blast/bin/blastn.REAL && \ 43 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastn.sh -o /blast/bin/blastn && chmod +x /blast/bin/blastn && \ 44 | cp /blast/bin/blastx /blast/bin/blastx.REAL && \ 45 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastx.sh -o /blast/bin/blastx && chmod +x /blast/bin/blastx && \ 46 | cp /blast/bin/tblastn /blast/bin/tblastn.REAL && \ 47 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastn.sh -o /blast/bin/tblastn && chmod +x /blast/bin/tblastn && \ 48 | cp /blast/bin/tblastx /blast/bin/tblastx.REAL && \ 49 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastx.sh -o /blast/bin/tblastx && chmod +x /blast/bin/tblastx 50 | 51 | 52 | COPY update_blastdb.pl /blast/bin 53 | 54 | WORKDIR /blast 55 | 56 | CMD ["/bin/bash"] 57 | 58 | -------------------------------------------------------------------------------- /blast/2.10.1/VERSION: -------------------------------------------------------------------------------- 1 | 2.10.1 2 | -------------------------------------------------------------------------------- /blast/2.10.1/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | DOCKERHUB_USERNAME=${1:-"ncbi"} 4 | IMAGE=blast 5 | VERSION=`cat VERSION` 6 | NP=`grep -c ^proc /proc/cpuinfo` 7 | 8 | docker build --build-arg version=${VERSION} --build-arg num_procs=${NP} -t $DOCKERHUB_USERNAME/$IMAGE:$VERSION . 9 | docker tag $DOCKERHUB_USERNAME/$IMAGE:$VERSION $DOCKERHUB_USERNAME/$IMAGE:latest 10 | -------------------------------------------------------------------------------- /blast/2.11.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/edirect as edirect 2 | FROM ubuntu:18.04 as blastbuild 3 | ARG version 4 | ARG num_procs=8 5 | LABEL Description="NCBI BLAST" Vendor="NCBI/NLM/NIH" Version=${version} Maintainer=camacho@ncbi.nlm.nih.gov 6 | 7 | USER root 8 | WORKDIR /root/ 9 | 10 | RUN apt-get -y -m update && apt-get install -y build-essential curl libidn11 libnet-perl perl-doc liblmdb-dev 11 | 12 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz | \ 13 | tar xzf - && \ 14 | cd ncbi-blast-${version}+-src/c++ && \ 15 | ./configure --with-mt --with-strip --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --with-openmp --without-vdb --without-gnutls --without-gcrypt --prefix=/blast && \ 16 | cd ReleaseMT/build && \ 17 | make -j ${num_procs} -f Makefile.flat blastdb_aliastool.exe blastdbcheck.exe blastdbcmd.exe blast_formatter.exe blastn.exe blastp.exe blastx.exe convert2blastmask.exe deltablast.exe dustmasker.exe makeblastdb.exe makembindex.exe makeprofiledb.exe psiblast.exe rpsblast.exe rpstblastn.exe segmasker.exe tblastn.exe tblastx.exe windowmasker.exe 18 | 19 | FROM google/cloud-sdk:slim as gsutil 20 | ARG version 21 | COPY VERSION . 22 | 23 | USER root 24 | WORKDIR /root/ 25 | 26 | RUN apt-get -y -m update && apt-get install -y libgomp1 libnet-perl libxml-simple-perl libjson-perl perl-doc liblmdb-dev parallel vmtouch cpanminus curl && rm -rf /var/lib/apt/lists/* && cpanm HTML::Entities 27 | 28 | RUN mkdir -p /blast/bin /blast/lib 29 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/bin /blast/bin 30 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/lib /blast/lib 31 | 32 | COPY --from=edirect /usr/local/ncbi/edirect /root/edirect 33 | 34 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 35 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 36 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 37 | ENV BLAST_DOCKER true 38 | ENV PATH="/root/edirect:/blast/bin:${PATH}" 39 | 40 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastdb_path -o /blast/bin/blastdb_path && chmod +x /blast/bin/blastdb_path && \ 41 | cp /blast/bin/blastp /blast/bin/blastp.REAL && \ 42 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastp.sh -o /blast/bin/blastp && chmod +x /blast/bin/blastp && \ 43 | cp /blast/bin/blastn /blast/bin/blastn.REAL && \ 44 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastn.sh -o /blast/bin/blastn && chmod +x /blast/bin/blastn && \ 45 | cp /blast/bin/blastx /blast/bin/blastx.REAL && \ 46 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastx.sh -o /blast/bin/blastx && chmod +x /blast/bin/blastx && \ 47 | cp /blast/bin/tblastn /blast/bin/tblastn.REAL && \ 48 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastn.sh -o /blast/bin/tblastn && chmod +x /blast/bin/tblastn && \ 49 | cp /blast/bin/tblastx /blast/bin/tblastx.REAL && \ 50 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastx.sh -o /blast/bin/tblastx && chmod +x /blast/bin/tblastx 51 | 52 | # Remove the line below after the BLAST+ 2.11 release 53 | COPY update_blastdb.pl /blast/bin 54 | 55 | WORKDIR /blast 56 | 57 | CMD ["/bin/bash"] 58 | 59 | -------------------------------------------------------------------------------- /blast/2.11.0/VERSION: -------------------------------------------------------------------------------- 1 | 2.11.0 2 | -------------------------------------------------------------------------------- /blast/2.11.0/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | DOCKERHUB_USERNAME=${1:-"ncbi"} 4 | IMAGE=blast 5 | VERSION=`curl -s https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/VERSION` 6 | NP=`grep -c ^proc /proc/cpuinfo` 7 | 8 | docker build --build-arg version=${VERSION} --build-arg num_procs=${NP} -t $DOCKERHUB_USERNAME/$IMAGE:$VERSION . 9 | docker tag $DOCKERHUB_USERNAME/$IMAGE:$VERSION $DOCKERHUB_USERNAME/$IMAGE:latest 10 | -------------------------------------------------------------------------------- /blast/2.11.0/update_blastdb.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # $Id: update_blastdb.pl 615662 2020-09-02 16:09:38Z merezhuk $ 3 | # =========================================================================== 4 | # 5 | # PUBLIC DOMAIN NOTICE 6 | # National Center for Biotechnology Information 7 | # 8 | # This software/database is a "United States Government Work" under the 9 | # terms of the United States Copyright Act. It was written as part of 10 | # the author's official duties as a United States Government employee and 11 | # thus cannot be copyrighted. This software/database is freely available 12 | # to the public for use. The National Library of Medicine and the U.S. 13 | # Government have not placed any restriction on its use or reproduction. 14 | # 15 | # Although all reasonable efforts have been taken to ensure the accuracy 16 | # and reliability of the software and data, the NLM and the U.S. 17 | # Government do not and cannot warrant the performance or results that 18 | # may be obtained by using this software or data. The NLM and the U.S. 19 | # Government disclaim all warranties, express or implied, including 20 | # warranties of performance, merchantability or fitness for any particular 21 | # purpose. 22 | # 23 | # Please cite the author in any work or product based on this material. 24 | # 25 | # =========================================================================== 26 | # 27 | # Author: Christiam Camacho 28 | # 29 | # File Description: 30 | # Script to download the pre-formatted BLAST databases. 31 | # 32 | # =========================================================================== 33 | 34 | use strict; 35 | use warnings; 36 | use Net::FTP; 37 | use Getopt::Long; 38 | use Pod::Usage; 39 | use File::stat; 40 | use Digest::MD5; 41 | use Archive::Tar; 42 | use File::Temp; 43 | use JSON::PP; 44 | 45 | use constant NCBI_FTP => "ftp.ncbi.nlm.nih.gov"; 46 | use constant BLAST_DB_DIR => "/blast/db"; 47 | use constant USER => "anonymous"; 48 | use constant PASSWORD => "anonymous"; 49 | use constant DEBUG => 0; 50 | use constant MAX_DOWNLOAD_ATTEMPTS => 3; 51 | use constant EXIT_FAILURE => 1; 52 | 53 | use constant AWS_URL => "http://s3.amazonaws.com"; 54 | use constant AMI_URL => "http://169.254.169.254/latest/meta-data/local-hostname"; 55 | use constant AWS_BUCKET => "ncbi-blast-databases"; 56 | 57 | use constant GCS_URL => "https://storage.googleapis.com"; 58 | use constant GCP_URL => "http://metadata.google.internal/computeMetadata/v1/instance/id"; 59 | use constant GCP_BUCKET => "blast-db"; 60 | 61 | use constant BLASTDB_MANIFEST => "blastdb-manifest.json"; 62 | use constant BLASTDB_MANIFEST_VERSION => "1.0"; 63 | 64 | # Process command line options 65 | my $opt_verbose = 1; 66 | my $opt_quiet = 0; 67 | my $opt_force_download = 0; 68 | my $opt_help = 0; 69 | my $opt_passive = 1; 70 | my $opt_blastdb_ver = undef; 71 | my $opt_timeout = 120; 72 | my $opt_showall = undef; 73 | my $opt_show_version = 0; 74 | my $opt_decompress = 0; 75 | my $opt_source; 76 | my $opt_legacy_exit_code = 0; 77 | my $opt_nt = &get_num_cores(); 78 | my $result = GetOptions("verbose+" => \$opt_verbose, 79 | "quiet" => \$opt_quiet, 80 | "force" => \$opt_force_download, 81 | "passive:s" => \$opt_passive, 82 | "timeout=i" => \$opt_timeout, 83 | "showall:s" => \$opt_showall, 84 | "version" => \$opt_show_version, 85 | "blastdb_version:i" => \$opt_blastdb_ver, 86 | "decompress" => \$opt_decompress, 87 | "source=s" => \$opt_source, 88 | "num_threads=i" => \$opt_nt, 89 | "legacy_exit_code" => \$opt_legacy_exit_code, 90 | "help" => \$opt_help); 91 | $opt_verbose = 0 if $opt_quiet; 92 | die "Failed to parse command line options\n" unless $result; 93 | pod2usage({-exitval => 0, -verbose => 2}) if $opt_help; 94 | if (length($opt_passive) and ($opt_passive !~ /1|no/i)) { 95 | pod2usage({-exitval => 1, -verbose => 0, 96 | -msg => "Invalid value for passive option: '$opt_passive'"}); 97 | } 98 | pod2usage({-exitval => 0, -verbose => 2}) unless (scalar @ARGV or 99 | defined($opt_showall) or 100 | $opt_show_version); 101 | if (defined $opt_blastdb_ver) { 102 | pod2usage({-exitval => 1, -verbose => 0, 103 | -msg => "Invalid BLAST database version: $opt_blastdb_ver. Supported values: 4, 5"}) 104 | unless ($opt_blastdb_ver == 4 or $opt_blastdb_ver == 5); 105 | } 106 | pod2usage({-exitval => 1, -verbose => 0, -msg => "Invalid number of threads"}) 107 | if ($opt_nt <= 0); 108 | if (length($opt_passive) and $opt_passive =~ /n|no/i) { 109 | $opt_passive = 0; 110 | } else { 111 | $opt_passive = 1; 112 | } 113 | my $exit_code = 0; 114 | $|++; 115 | 116 | if ($opt_show_version) { 117 | my $revision = '$Revision: 615662 $'; 118 | $revision =~ s/\$Revision: | \$//g; 119 | print "$0 version $revision\n"; 120 | exit($exit_code); 121 | } 122 | my $curl = &get_curl_path(); 123 | 124 | my $location = "NCBI"; 125 | # If provided, the source takes precedence over any attempts to determine the closest location 126 | if (defined($opt_source)) { 127 | if ($opt_source =~ /^ncbi/i) { 128 | $location = "NCBI"; 129 | } elsif ($opt_source =~ /^gc/i) { 130 | $location = "GCP"; 131 | } elsif ($opt_source =~ /^aws/i) { 132 | $location = "AWS"; 133 | } 134 | } else { 135 | # Try to auto-detect whether we're on the cloud 136 | if (defined($curl)) { 137 | my $tmpfile = File::Temp->new(); 138 | my $gcp_cmd = "$curl --connect-timeout 3 --retry 3 --retry-max-time 30 -sfo $tmpfile -H 'Metadata-Flavor: Google' " . GCP_URL; 139 | my $aws_cmd = "$curl --connect-timeout 3 --retry 3 --retry-max-time 30 -sfo /dev/null " . AMI_URL; 140 | print "$gcp_cmd\n" if DEBUG; 141 | if (system($gcp_cmd) == 0) { 142 | # status not always reliable. Check that curl output is all digits. 143 | my $tmpfile_content = do { local $/; <$tmpfile>}; 144 | print "curl output $tmpfile_content\n" if DEBUG; 145 | $location = "GCP" if ($tmpfile_content =~ m/^(\d+)$/); 146 | } elsif (DEBUG) { 147 | # Consult https://ec.haxx.se/usingcurl/usingcurl-returns 148 | print "curl to GCP metadata server returned ", $?>>8, "\n"; 149 | } 150 | 151 | print "$aws_cmd\n" if DEBUG; 152 | if (system($aws_cmd) == 0) { 153 | $location = "AWS"; 154 | } elsif (DEBUG) { 155 | # Consult https://ec.haxx.se/usingcurl/usingcurl-returns 156 | print "curl to AWS metadata server returned ", $?>>8, "\n"; 157 | } 158 | print "Location is $location\n" if DEBUG; 159 | } 160 | } 161 | if ($location =~ /aws|gcp/i and not defined $curl) { 162 | print "Error: $0 depends on curl to fetch data from cloud storage, please install this utility to access these data sources.\n"; 163 | exit(EXIT_FAILURE); 164 | } 165 | 166 | my $ftp; 167 | 168 | if ($location ne "NCBI") { 169 | die "Only BLASTDB version 5 is supported at GCP and AWS\n" if (defined $opt_blastdb_ver and $opt_blastdb_ver != 5); 170 | my $latest_dir = &get_latest_dir($location); 171 | my ($json, $url) = &get_blastdb_metadata($location, $latest_dir); 172 | unless (length($json)) { 173 | print STDERR "ERROR: Missing manifest file $url, please report to blast-help\@ncbi.nlm.nih.gov\n"; 174 | exit(EXIT_FAILURE); 175 | } 176 | print "Connected to $location\n" if $opt_verbose; 177 | my $metadata = decode_json($json); 178 | unless (exists($$metadata{version}) and ($$metadata{version} eq BLASTDB_MANIFEST_VERSION)) { 179 | print STDERR "ERROR: Invalid version in manifest file $url, please report to blast-help\@ncbi.nlm.nih.gov\n"; 180 | exit(EXIT_FAILURE); 181 | } 182 | if (defined($opt_showall)) { 183 | my $print_header = 1; 184 | foreach my $db (sort keys %$metadata) { 185 | next if ($db =~ /^version$/); 186 | if ($opt_showall =~ /tsv/i) { 187 | printf("%s\t%s\t%9.4f\t%s\n", $db, $$metadata{$db}{description}, 188 | $$metadata{$db}{size}, $$metadata{$db}{last_updated}); 189 | } elsif ($opt_showall =~ /pretty/i) { 190 | if ($print_header) { 191 | printf("%-60s %-120s %-11s %15s\n", "BLASTDB", 192 | "DESCRIPTION", "SIZE (GB)", "LAST_UPDATED"); 193 | $print_header = 0; 194 | } 195 | printf("%-60s %-120s %9.4f %15s\n", $db, $$metadata{$db}{description}, 196 | $$metadata{$db}{size}, $$metadata{$db}{last_updated}); 197 | } else { 198 | print "$db\n"; 199 | } 200 | } 201 | } else { 202 | my @files2download; 203 | for my $requested_db (@ARGV) { 204 | if (exists $$metadata{$requested_db}) { 205 | push @files2download, @{$$metadata{$requested_db}{files}}; 206 | } else { 207 | print STDERR "Warning: $requested_db does not exist in $location ($latest_dir)\n"; 208 | } 209 | } 210 | if (@files2download) { 211 | my $gsutil = &get_gsutil_path(); 212 | my $awscli = undef; # &get_awscli_path(); # aws s3 required credentials, fall back to curl 213 | my $cmd; 214 | my $fh = File::Temp->new(); 215 | if ($location eq "GCP" and defined($gsutil)) { 216 | $cmd = "$gsutil -q "; 217 | if ($opt_nt > 1) { 218 | $cmd .= "-m "; 219 | $cmd .= "-o 'GSUtil:parallel_thread_count=1' "; 220 | $cmd .= "-o 'GSUtil:parallel_process_count=$opt_nt' "; 221 | } 222 | $cmd .= " cp " . join(" ", @files2download) . " ."; 223 | } elsif ($location eq "AWS" and defined ($awscli)) { 224 | my $aws_cmd = "$awscli s3 cp "; 225 | $aws_cmd .= "--only-show-errors " unless $opt_verbose >= 3; 226 | print $fh join("\n", @files2download); 227 | $cmd = "/usr/bin/xargs -P $opt_nt -n 1 -I{}"; 228 | $cmd .= " -t" if $opt_verbose > 3; 229 | $cmd .= " $aws_cmd {} ."; 230 | $cmd .= " <$fh " ; 231 | } else { # fall back to curl 232 | my $url = $location eq "AWS" ? AWS_URL : GCS_URL; 233 | s,gs://,$url/, foreach (@files2download); 234 | s,s3://,$url/, foreach (@files2download); 235 | if ($opt_nt > 1 and -f "/usr/bin/xargs") { 236 | print $fh join("\n", @files2download); 237 | $cmd = "/usr/bin/xargs -P $opt_nt -n 1"; 238 | $cmd .= " -t" if $opt_verbose > 3; 239 | $cmd .= " $curl -sSOR"; 240 | $cmd .= " <$fh " ; 241 | } else { 242 | $cmd = "$curl -sSR"; 243 | $cmd .= " -O $_" foreach (@files2download); 244 | } 245 | } 246 | print "$cmd\n" if $opt_verbose > 3; 247 | system($cmd); 248 | } 249 | } 250 | 251 | } else { 252 | # Connect and download files 253 | $ftp = &connect_to_ftp(); 254 | if (defined $opt_showall) { 255 | print "$_\n" foreach (sort(&get_available_databases($ftp->ls()))); 256 | } else { 257 | my @files = sort(&get_files_to_download()); 258 | my @files2decompress; 259 | $exit_code = &download(\@files, \@files2decompress); 260 | if ($exit_code == 1) { 261 | foreach (@files2decompress) { 262 | $exit_code = &decompress($_); 263 | last if ($exit_code != 1); 264 | } 265 | } 266 | unless ($opt_legacy_exit_code) { 267 | $exit_code = ($exit_code == 1 ? 0 : $exit_code); 268 | } 269 | } 270 | $ftp->quit(); 271 | } 272 | 273 | exit($exit_code); 274 | 275 | # Connects to NCBI ftp server 276 | sub connect_to_ftp 277 | { 278 | my %ftp_opts; 279 | $ftp_opts{'Passive'} = 1 if $opt_passive; 280 | $ftp_opts{'Timeout'} = $opt_timeout if ($opt_timeout >= 0); 281 | $ftp_opts{'Debug'} = 1 if ($opt_verbose > 1); 282 | my $ftp = Net::FTP->new(NCBI_FTP, %ftp_opts) 283 | or die "Failed to connect to " . NCBI_FTP . ": $!\n"; 284 | $ftp->login(USER, PASSWORD) 285 | or die "Failed to login to " . NCBI_FTP . ": $!\n"; 286 | my $ftp_path = BLAST_DB_DIR; 287 | $ftp_path .= "/v$opt_blastdb_ver" if (defined $opt_blastdb_ver); 288 | $ftp->cwd($ftp_path); 289 | $ftp->binary(); 290 | if ($opt_verbose) { 291 | if (defined $opt_blastdb_ver) { 292 | print "Connected to $location; downloading BLASTDBv$opt_blastdb_ver\n"; 293 | } else { 294 | print "Connected to $location\n"; 295 | } 296 | } 297 | return $ftp; 298 | } 299 | 300 | # Gets the list of available databases on NCBI FTP site 301 | sub get_available_databases 302 | { 303 | my @blast_db_files = $ftp->ls(); 304 | my @retval = (); 305 | 306 | foreach (@blast_db_files) { 307 | next unless (/\.tar\.gz$/); 308 | push @retval, &extract_db_name($_); 309 | } 310 | my %seen = (); 311 | return grep { ! $seen{$_} ++ } @retval; 312 | } 313 | 314 | # Obtains the list of files to download 315 | sub get_files_to_download 316 | { 317 | my @blast_db_files = $ftp->ls(); 318 | my @retval = (); 319 | 320 | if ($opt_verbose > 2) { 321 | print "Found the following files on ftp site:\n"; 322 | print "$_\n" for (@blast_db_files); 323 | } 324 | 325 | for my $requested_db (@ARGV) { 326 | for my $file (@blast_db_files) { 327 | next unless ($file =~ /\.tar\.gz$/); 328 | if ($file =~ /^$requested_db\..*/) { 329 | push @retval, $file; 330 | } 331 | } 332 | } 333 | 334 | if ($opt_verbose) { 335 | for my $requested_db (@ARGV) { 336 | unless (grep(/$requested_db/, @retval)) { 337 | print STDERR "$requested_db not found, skipping.\n" 338 | } 339 | } 340 | } 341 | 342 | return @retval; 343 | } 344 | 345 | # Download the requested files only if their checksum files are missing or if 346 | # these (or the archives) are newer in the FTP site. Returns 0 if no files were 347 | # downloaded, 1 if at least one file was downloaded (so that this can be the 348 | # application's exit code) 349 | sub download($$) 350 | { 351 | my @requested_dbs = @ARGV; 352 | my @files2download = @{$_[0]}; 353 | my $files2decompress = $_[1]; 354 | my $retval = 0; 355 | 356 | for my $file (@files2download) { 357 | 358 | my $attempts = 0; # Download attempts for this file 359 | if ($opt_verbose and &is_multivolume_db($file) and $file =~ /\.00\./) { 360 | my $db_name = &extract_db_name($file); 361 | my $nvol = &get_num_volumes($db_name, @files2download); 362 | print "Downloading $db_name (" . $nvol . " volumes) ...\n" unless ($opt_quiet); 363 | } 364 | 365 | # We preserve the checksum files as evidence of the downloaded archive 366 | my $checksum_file = "$file.md5"; 367 | my $new_download = (-e $checksum_file ? 0 : 1); 368 | my $update_available = ($new_download or 369 | ((stat($checksum_file))->mtime < $ftp->mdtm($checksum_file))); 370 | if (-e $file and (stat($file)->mtime < $ftp->mdtm($file))) { 371 | $update_available = 1; 372 | } 373 | 374 | download_file: 375 | if ($opt_force_download or $new_download or $update_available) { 376 | print "Downloading $file..." if $opt_verbose; 377 | $ftp->get($file); 378 | unless ($ftp->get($checksum_file)) { 379 | print STDERR "Failed to download $checksum_file!\n"; 380 | return EXIT_FAILURE; 381 | } 382 | my $rmt_digest = &read_md5_file($checksum_file); 383 | my $lcl_digest = &compute_md5_checksum($file); 384 | print "\nRMT $file Digest $rmt_digest" if (DEBUG); 385 | print "\nLCL $file Digest $lcl_digest\n" if (DEBUG); 386 | if ($lcl_digest ne $rmt_digest) { 387 | unlink $file, $checksum_file; 388 | if (++$attempts >= MAX_DOWNLOAD_ATTEMPTS) { 389 | print STDERR "too many failures, aborting download!\n"; 390 | return EXIT_FAILURE; 391 | } else { 392 | print "corrupt download, trying again.\n"; 393 | goto download_file; 394 | } 395 | } 396 | push @$files2decompress, $file if ($opt_decompress); 397 | print " [OK]\n" if $opt_verbose; 398 | $retval = 1 if ($retval == 0); 399 | } else { 400 | if ($opt_decompress and -f $file) { 401 | push @$files2decompress, $file; 402 | $retval = 1; 403 | } else { 404 | my $msg = ($opt_decompress 405 | ? "The contents of $file are up to date in your system." 406 | : "$file is up to date."); 407 | print "$msg\n" if $opt_verbose; 408 | } 409 | } 410 | } 411 | return $retval; 412 | } 413 | 414 | # Try to decompress using /bin/tar as Archive::Tar is known to be slower (as 415 | # it's pure perl) 416 | sub _decompress_impl($) 417 | { 418 | my $file = shift; 419 | if ($^O eq "cygwin") { 420 | local $ENV{PATH} = "/bin:/usr/bin"; 421 | my $cmd = "tar -zxf $file 2>/dev/null"; 422 | return 1 unless (system($cmd)); 423 | } 424 | unless ($^O =~ /win/i) { 425 | local $ENV{PATH} = "/bin:/usr/bin"; 426 | my $cmd = "gzip -cd $file 2>/dev/null | tar xf - 2>/dev/null"; 427 | return 1 unless (system($cmd)); 428 | } 429 | return Archive::Tar->extract_archive($file, 1); 430 | } 431 | 432 | # Decompresses the file passed as its argument 433 | # Returns 1 on success, and 2 on failure, printing an error to STDERR 434 | sub decompress($) 435 | { 436 | my $file = shift; 437 | print "Decompressing $file ..." unless ($opt_quiet); 438 | my $succeeded = &_decompress_impl($file); 439 | unless ($succeeded) { 440 | my $msg = "Failed to decompress $file ($Archive::Tar::error), "; 441 | $msg .= "please do so manually."; 442 | print STDERR "$msg\n"; 443 | return EXIT_FAILURE; 444 | } 445 | unlink $file; # Clean up archive, but preserve the checksum file 446 | print " [OK]\n" unless ($opt_quiet); 447 | return 1; 448 | } 449 | 450 | sub compute_md5_checksum($) 451 | { 452 | my $file = shift; 453 | my $digest = "N/A"; 454 | if (open(DOWNLOADED_FILE, $file)) { 455 | binmode(DOWNLOADED_FILE); 456 | $digest = Digest::MD5->new->addfile(*DOWNLOADED_FILE)->hexdigest; 457 | close(DOWNLOADED_FILE); 458 | } 459 | return $digest; 460 | } 461 | 462 | sub read_md5_file($) 463 | { 464 | my $md5file = shift; 465 | open(IN, $md5file); 466 | $_ = ; 467 | close(IN); 468 | my @retval = split; 469 | return $retval[0]; 470 | } 471 | 472 | # Determine if a given pre-formatted BLAST database file is part of a 473 | # multi-volume database 474 | sub is_multivolume_db 475 | { 476 | my $file = shift; 477 | return 1 if ($file =~ /\.\d{2,3}\.tar\.gz$/); 478 | return 0; 479 | } 480 | 481 | # Extracts the database name from the pre-formatted BLAST database archive file 482 | # name 483 | sub extract_db_name 484 | { 485 | my $file = shift; 486 | my $retval = ""; 487 | if (&is_multivolume_db($file)) { 488 | $retval = $1 if ($file =~ m/(.*)\.\d{2,3}\.tar\.gz$/); 489 | } else { 490 | $retval = $1 if ($file =~ m/(.*)\.tar\.gz$/); 491 | } 492 | return $retval; 493 | } 494 | 495 | # Returns the number of volumes for a BLAST database given the file name of a 496 | # pre-formatted BLAST database and the list of all databases to download 497 | sub get_num_volumes 498 | { 499 | my $db = shift; 500 | my $retval = 0; 501 | foreach (@_) { 502 | if (/$db/) { 503 | if (/.*\.(\d{2,3})\.tar\.gz$/) { 504 | $retval = int($1) if (int($1) > $retval); 505 | } 506 | } 507 | } 508 | return $retval + 1; 509 | } 510 | 511 | # Retrieves the name of the 'subdirectory' where the latest BLASTDBs residue in GCP 512 | sub get_latest_dir 513 | { 514 | my $source = shift; 515 | my $url = GCS_URL . "/" . GCP_BUCKET . "/latest-dir"; 516 | $url = AWS_URL . "/" . AWS_BUCKET . "/latest-dir" if ($source eq "AWS"); 517 | my $cmd = "$curl -s $url"; 518 | print "$cmd\n" if DEBUG; 519 | chomp(my $retval = `$cmd`); 520 | unless (length($retval)) { 521 | print STDERR "ERROR: Missing file $url, please try again or report to blast-help\@ncbi.nlm.nih.gov\n"; 522 | exit(EXIT_FAILURE); 523 | } 524 | print "$source latest-dir: '$retval'\n" if DEBUG; 525 | return $retval; 526 | } 527 | 528 | # Fetches the JSON text containing the BLASTDB metadata in GCS 529 | sub get_blastdb_metadata 530 | { 531 | my $source = shift; 532 | my $latest_dir = shift; 533 | my $url = GCS_URL . "/" . GCP_BUCKET . "/$latest_dir/" . BLASTDB_MANIFEST; 534 | $url = AWS_URL . "/" . AWS_BUCKET . "/$latest_dir/" . BLASTDB_MANIFEST if ($source eq "AWS"); 535 | my $cmd = "curl -sf $url"; 536 | print "$cmd\n" if DEBUG; 537 | chomp(my $retval = `$cmd`); 538 | return ($retval, $url); 539 | } 540 | 541 | # Returns the path to the gsutil utility or undef if it is not found 542 | sub get_gsutil_path 543 | { 544 | foreach (qw(/google/google-cloud-sdk/bin /usr/local/bin /usr/bin /snap/bin)) { 545 | my $path = "$_/gsutil"; 546 | return $path if (-f $path); 547 | } 548 | return undef; 549 | } 550 | 551 | # Returns the path to the aws CLI utility or undef if it is not found 552 | sub get_awscli_path 553 | { 554 | foreach (qw(/usr/local/bin /usr/bin)) { 555 | my $path = "$_/aws"; 556 | return $path if (-f $path); 557 | } 558 | return undef; 559 | } 560 | 561 | # Returns the number of cores, or 1 if unknown 562 | sub get_num_cores 563 | { 564 | my $retval = 1; 565 | if ($^O =~ /linux/i) { 566 | open my $fh, "/proc/cpuinfo" or return $retval; 567 | $retval = scalar(map /^processor/, <$fh>); 568 | close($fh); 569 | } elsif ($^O =~ /darwin/i) { 570 | chomp($retval = `/usr/sbin/sysctl -n hw.ncpu`); 571 | } 572 | return $retval; 573 | } 574 | 575 | # Returns the path to the curl utility, or undef if it is not found 576 | sub get_curl_path 577 | { 578 | foreach (qw(/usr/local/bin /usr/bin)) { 579 | my $path = "$_/curl"; 580 | return $path if (-f $path); 581 | } 582 | if ($^O =~ /mswin/i) { 583 | my $retval = `where curl`; 584 | if (defined $retval) { 585 | chomp($retval); 586 | return $retval if (-f $retval); 587 | } 588 | } 589 | return undef; 590 | } 591 | 592 | __END__ 593 | 594 | =head1 NAME 595 | 596 | B - Download pre-formatted BLAST databases 597 | 598 | =head1 SYNOPSIS 599 | 600 | update_blastdb.pl [options] blastdb ... 601 | 602 | =head1 OPTIONS 603 | 604 | =over 2 605 | 606 | =item B<--source> 607 | 608 | Location to download BLAST databases from (default: auto-detect closest location). 609 | Supported values: ncbi, aws, or gcp. 610 | 611 | =item B<--decompress> 612 | 613 | Downloads, decompresses the archives in the current working directory, and 614 | deletes the downloaded archive to save disk space, while preserving the 615 | archive checksum files (default: false). 616 | 617 | =item B<--showall> 618 | 619 | Show all available pre-formatted BLAST databases (default: false). The output 620 | of this option lists the database names which should be used when 621 | requesting downloads or updates using this script. 622 | 623 | It accepts the optional arguments: 'tsv' and 'pretty' to produce tab-separated values 624 | and a human-readable format respectively. These parameters elicit the display of 625 | additional metadata if this is available to the program. 626 | This metadata is displayed in columnar format; the columns represent: 627 | 628 | name, description, size in gigabytes, date of last update (YYYY-MM-DD format). 629 | 630 | =item B<--blastdb_version> 631 | 632 | Specify which BLAST database version to download (default: 5). 633 | Supported values: 4, 5 634 | 635 | =item B<--passive> 636 | 637 | Use passive FTP, useful when behind a firewall or working in the cloud (default: true). 638 | To disable passive FTP, configure this option as follows: --passive no 639 | 640 | =item B<--timeout> 641 | 642 | Timeout on connection to NCBI (default: 120 seconds). 643 | 644 | =item B<--force> 645 | 646 | Force download even if there is a archive already on local directory (default: 647 | false). 648 | 649 | =item B<--verbose> 650 | 651 | Increment verbosity level (default: 1). Repeat this option multiple times to 652 | increase the verbosity level (maximum 2). 653 | 654 | =item B<--quiet> 655 | 656 | Produce no output (default: false). Overrides the B<--verbose> option. 657 | 658 | =item B<--version> 659 | 660 | Prints this script's version. Overrides all other options. 661 | 662 | =item B<--num_threads> 663 | 664 | Sets the number of threads to utilize to perform downloads in parallel when data comes from the cloud. 665 | Defaults to use all available CPUs on the machine (Linux and macos only). 666 | 667 | =item B<--legacy_exit_code> 668 | 669 | Enables exit codes from prior to version 581818, BLAST+ 2.10.0 release, for 670 | downloads from NCBI only. This option is meant to be used by legacy applications that rely 671 | on this exit codes: 672 | 0 for successful operations that result in no downloads, 1 for successful 673 | downloads, and 2 for errors. 674 | 675 | =back 676 | 677 | =head1 DESCRIPTION 678 | 679 | This script will download the pre-formatted BLAST databases requested in the 680 | command line from the NCBI ftp site. 681 | 682 | =head1 EXIT CODES 683 | 684 | This script returns 0 on successful operations and non-zero on errors. 685 | 686 | =head1 DEPENDENCIES 687 | 688 | This script depends on curl for retrieval from cloud service providers. 689 | 690 | =head1 BUGS 691 | 692 | Please report them to 693 | 694 | =head1 COPYRIGHT 695 | 696 | See PUBLIC DOMAIN NOTICE included at the top of this script. 697 | 698 | =cut 699 | -------------------------------------------------------------------------------- /blast/2.12.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/edirect as edirect 2 | FROM ubuntu:18.04 as blastbuild 3 | ARG version 4 | ARG num_procs=8 5 | LABEL Description="NCBI BLAST" Vendor="NCBI/NLM/NIH" Version=${version} Maintainer=camacho@ncbi.nlm.nih.gov 6 | 7 | USER root 8 | WORKDIR /root/ 9 | 10 | RUN apt-get -y -m update && apt-get install -y build-essential curl libidn11 libnet-perl perl-doc liblmdb-dev 11 | 12 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz | \ 13 | tar xzf - && \ 14 | cd ncbi-blast-${version}+-src/c++ && \ 15 | ./configure --with-mt --with-strip --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --with-openmp --without-vdb --without-gnutls --without-gcrypt --prefix=/blast && \ 16 | cd ReleaseMT/build && \ 17 | make -j ${num_procs} -f Makefile.flat blastdb_aliastool.exe blastdbcheck.exe blastdbcmd.exe blast_formatter.exe blastn.exe blastp.exe blastx.exe convert2blastmask.exe deltablast.exe dustmasker.exe makeblastdb.exe makembindex.exe makeprofiledb.exe psiblast.exe rpsblast.exe rpstblastn.exe segmasker.exe tblastn.exe tblastx.exe windowmasker.exe 18 | 19 | FROM google/cloud-sdk:slim as gsutil 20 | ARG version 21 | COPY VERSION . 22 | 23 | USER root 24 | WORKDIR /root/ 25 | 26 | RUN apt-get -y -m update && apt-get install -y libgomp1 libnet-perl libxml-simple-perl libjson-perl perl-doc liblmdb-dev parallel vmtouch cpanminus curl && rm -rf /var/lib/apt/lists/* && cpanm HTML::Entities 27 | 28 | RUN mkdir -p /blast/bin /blast/lib 29 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/bin /blast/bin 30 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/lib /blast/lib 31 | 32 | COPY --from=edirect /usr/local/ncbi/edirect /root/edirect 33 | 34 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 35 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 36 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 37 | ENV BLAST_DOCKER true 38 | ENV PATH="/root/edirect:/blast/bin:${PATH}" 39 | 40 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastdb_path -o /blast/bin/blastdb_path && chmod +x /blast/bin/blastdb_path && \ 41 | cp /blast/bin/blastp /blast/bin/blastp.REAL && \ 42 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastp.sh -o /blast/bin/blastp && chmod +x /blast/bin/blastp && \ 43 | cp /blast/bin/blastn /blast/bin/blastn.REAL && \ 44 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastn.sh -o /blast/bin/blastn && chmod +x /blast/bin/blastn && \ 45 | cp /blast/bin/blastx /blast/bin/blastx.REAL && \ 46 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastx.sh -o /blast/bin/blastx && chmod +x /blast/bin/blastx && \ 47 | cp /blast/bin/tblastn /blast/bin/tblastn.REAL && \ 48 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastn.sh -o /blast/bin/tblastn && chmod +x /blast/bin/tblastn && \ 49 | cp /blast/bin/tblastx /blast/bin/tblastx.REAL && \ 50 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastx.sh -o /blast/bin/tblastx && chmod +x /blast/bin/tblastx 51 | 52 | WORKDIR /blast 53 | 54 | CMD ["/bin/bash"] 55 | 56 | -------------------------------------------------------------------------------- /blast/2.12.0/VERSION: -------------------------------------------------------------------------------- 1 | 2.12.0 2 | -------------------------------------------------------------------------------- /blast/2.12.0/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | DOCKERHUB_USERNAME=${1:-"ncbi"} 4 | IMAGE=blast 5 | VERSION=`curl -s https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/VERSION` 6 | NP=`grep -c ^proc /proc/cpuinfo` 7 | 8 | docker build --build-arg version=${VERSION} --build-arg num_procs=${NP} -t $DOCKERHUB_USERNAME/$IMAGE:$VERSION . 9 | docker tag $DOCKERHUB_USERNAME/$IMAGE:$VERSION $DOCKERHUB_USERNAME/$IMAGE:latest 10 | -------------------------------------------------------------------------------- /blast/2.13.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/edirect as edirect 2 | FROM ubuntu:18.04 as blastbuild 3 | ARG version 4 | ARG vdb_version 5 | ARG num_procs=8 6 | LABEL Description="NCBI BLAST" Vendor="NCBI/NLM/NIH" Version=${version} Maintainer=camacho@ncbi.nlm.nih.gov 7 | 8 | USER root 9 | WORKDIR /root/ 10 | 11 | RUN apt-get -y -m update && apt-get install -y build-essential curl libidn11 libnet-perl perl-doc liblmdb-dev wget 12 | 13 | # cmake installed by apt is currently too old 14 | RUN wget https://github.com/Kitware/CMake/releases/download/v3.22.3/cmake-3.22.3-linux-x86_64.tar.gz && tar xfz cmake-3.22.3-linux-x86_64.tar.gz && rm cmake-3.22.3-linux-x86_64.tar.gz 15 | ENV PATH="${PATH}:/root/cmake-3.22.3-linux-x86_64/bin" 16 | 17 | # Download and build ncbi-vdb 18 | RUN wget https://github.com/ncbi/ncbi-vdb/archive/refs/tags/${vdb_version}.tar.gz && \ 19 | tar xfz ${vdb_version}.tar.gz && rm ${vdb_version}.tar.gz && \ 20 | mv ncbi-vdb-${vdb_version} ncbi-vdb && \ 21 | cd ncbi-vdb && ./configure --prefix /root/vdb && make install -j ${num_proc} 22 | 23 | # Arrange ncbi-vdb libraries and header files in a form that C++ toolkit 24 | # build can consume them. 25 | ARG VDB=/root/VDB 26 | RUN mkdir -p ${VDB}/linux/release/x86_64/lib && \ 27 | cp -R /root/vdb/lib64/* ${VDB}/linux/release/x86_64/lib && \ 28 | mkdir -p ${VDB}/interfaces && cp -R /root/vdb/include/* ${VDB}/interfaces 29 | 30 | # Build BLAST binaries 31 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz | \ 32 | tar xzf - && \ 33 | cd ncbi-blast-${version}+-src/c++ && \ 34 | ./configure --with-mt --with-strip --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --with-openmp --with-vdb=${VDB} --without-gnutls --without-gcrypt --prefix=/blast && \ 35 | cd ReleaseMT/build && \ 36 | make -j ${num_procs} -f Makefile.flat blastdb_aliastool.exe blastdbcheck.exe blastdbcmd.exe blast_formatter.exe blastn.exe blastp.exe blastx.exe convert2blastmask.exe deltablast.exe dustmasker.exe makeblastdb.exe makembindex.exe makeprofiledb.exe psiblast.exe rpsblast.exe rpstblastn.exe segmasker.exe tblastn.exe tblastx.exe windowmasker.exe blastn_vdb.exe tblastn_vdb.exe blast_formatter_vdb.exe blast_vdb_cmd.exe 37 | 38 | FROM google/cloud-sdk:slim as gsutil 39 | ARG version 40 | COPY VERSION . 41 | 42 | USER root 43 | WORKDIR /root/ 44 | 45 | RUN apt-get -y -m update && apt-get install -y libgomp1 libnet-perl libxml-simple-perl libjson-perl perl-doc liblmdb-dev parallel vmtouch cpanminus curl && rm -rf /var/lib/apt/lists/* && cpanm HTML::Entities 46 | 47 | RUN mkdir -p /blast/bin /blast/lib 48 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/bin /blast/bin 49 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/lib /blast/lib 50 | COPY --from=blastbuild /root/VDB/linux/release/x86_64/lib /blast/lib 51 | 52 | COPY --from=edirect /usr/local/ncbi/edirect /root/edirect 53 | 54 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 55 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 56 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 57 | ENV BLAST_DOCKER true 58 | ENV PATH="/root/edirect:/blast/bin:${PATH}" 59 | 60 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastdb_path -o /blast/bin/blastdb_path && chmod +x /blast/bin/blastdb_path && \ 61 | cp /blast/bin/blastp /blast/bin/blastp.REAL && \ 62 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastp.sh -o /blast/bin/blastp && chmod +x /blast/bin/blastp && \ 63 | cp /blast/bin/blastn /blast/bin/blastn.REAL && \ 64 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastn.sh -o /blast/bin/blastn && chmod +x /blast/bin/blastn && \ 65 | cp /blast/bin/blastx /blast/bin/blastx.REAL && \ 66 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastx.sh -o /blast/bin/blastx && chmod +x /blast/bin/blastx && \ 67 | cp /blast/bin/tblastn /blast/bin/tblastn.REAL && \ 68 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastn.sh -o /blast/bin/tblastn && chmod +x /blast/bin/tblastn && \ 69 | cp /blast/bin/tblastx /blast/bin/tblastx.REAL && \ 70 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastx.sh -o /blast/bin/tblastx && chmod +x /blast/bin/tblastx 71 | 72 | WORKDIR /blast 73 | 74 | CMD ["/bin/bash"] 75 | 76 | -------------------------------------------------------------------------------- /blast/2.13.0/VERSION: -------------------------------------------------------------------------------- 1 | 2.13.0 2 | -------------------------------------------------------------------------------- /blast/2.13.0/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | DOCKERHUB_USERNAME=${1:-"ncbi"} 4 | IMAGE=blast 5 | VERSION=`curl -s https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/VERSION` 6 | # Check the latest ncbi-vdb release version in https://github.com/ncbi/ncbi-vdb/tags 7 | VDB_VERSION=3.0.0 8 | NP=`grep -c ^proc /proc/cpuinfo` 9 | 10 | docker build --build-arg version=${VERSION} --build-arg num_procs=${NP} --build-arg vdb_version=${VDB_VERSION} -t $DOCKERHUB_USERNAME/$IMAGE:$VERSION . 11 | docker tag $DOCKERHUB_USERNAME/$IMAGE:$VERSION $DOCKERHUB_USERNAME/$IMAGE:latest 12 | -------------------------------------------------------------------------------- /blast/2.14.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/edirect:12.5 as edirect 2 | FROM ubuntu:18.04 as blastbuild 3 | ARG version 4 | ARG vdb_version 5 | ARG num_procs=8 6 | LABEL Description="NCBI BLAST" Vendor="NCBI/NLM/NIH" Version=${version} Maintainer=camacho@ncbi.nlm.nih.gov 7 | 8 | USER root 9 | WORKDIR /root/ 10 | 11 | RUN apt-get -y -m update && apt-get install -y build-essential curl libidn11 libnet-perl perl-doc liblmdb-dev wget 12 | 13 | # cmake installed by apt is currently too old 14 | RUN wget https://github.com/Kitware/CMake/releases/download/v3.22.3/cmake-3.22.3-linux-x86_64.tar.gz && tar xfz cmake-3.22.3-linux-x86_64.tar.gz && rm cmake-3.22.3-linux-x86_64.tar.gz 15 | ENV PATH="${PATH}:/root/cmake-3.22.3-linux-x86_64/bin" 16 | 17 | # Download and build ncbi-vdb 18 | RUN wget https://github.com/ncbi/ncbi-vdb/archive/refs/tags/${vdb_version}.tar.gz && \ 19 | tar xfz ${vdb_version}.tar.gz && rm ${vdb_version}.tar.gz && \ 20 | mv ncbi-vdb-${vdb_version} ncbi-vdb && \ 21 | cd ncbi-vdb && ./configure --prefix /root/vdb && make install -j ${num_proc} 22 | 23 | # Arrange ncbi-vdb libraries and header files in a form that C++ toolkit 24 | # build can consume them. 25 | ARG VDB=/root/VDB 26 | RUN mkdir -p ${VDB}/linux/release/x86_64/lib && \ 27 | cp -R /root/vdb/lib64/* ${VDB}/linux/release/x86_64/lib && \ 28 | mkdir -p ${VDB}/interfaces && cp -R /root/vdb/include/* ${VDB}/interfaces 29 | 30 | # Build BLAST binaries 31 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz | \ 32 | tar xzf - && \ 33 | cd ncbi-blast-${version}+-src/c++ && \ 34 | ./configure --with-mt --with-strip --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --with-openmp --with-vdb=${VDB} --without-gnutls --without-gcrypt --without-zstd --without-lzo --prefix=/blast && \ 35 | cd ReleaseMT/build && \ 36 | make -j ${num_procs} -f Makefile.flat blastdb_aliastool.exe blastdbcheck.exe blastdbcmd.exe blast_formatter.exe blastn.exe blastp.exe blastx.exe convert2blastmask.exe deltablast.exe dustmasker.exe makeblastdb.exe makembindex.exe makeprofiledb.exe psiblast.exe rpsblast.exe rpstblastn.exe segmasker.exe tblastn.exe tblastx.exe windowmasker.exe blastn_vdb.exe tblastn_vdb.exe blast_formatter_vdb.exe blast_vdb_cmd.exe blastdb_path.exe 37 | 38 | FROM google/cloud-sdk:slim as gsutil 39 | ARG version 40 | COPY VERSION . 41 | 42 | USER root 43 | WORKDIR /root/ 44 | 45 | RUN apt-get -y -m update && apt-get install -y libgomp1 libnet-perl libxml-simple-perl libjson-perl perl-doc liblmdb-dev parallel vmtouch cpanminus curl && rm -rf /var/lib/apt/lists/* && cpanm HTML::Entities 46 | 47 | RUN mkdir -p /blast/bin /blast/lib 48 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/bin /blast/bin 49 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/lib /blast/lib 50 | COPY --from=blastbuild /root/VDB/linux/release/x86_64/lib /blast/lib 51 | 52 | COPY --from=edirect /usr/local/ncbi/edirect /root/edirect 53 | 54 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 55 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 56 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 57 | ENV BLAST_DOCKER true 58 | ENV PATH="/root/edirect:/blast/bin:${PATH}" 59 | 60 | RUN cp /blast/bin/blastp /blast/bin/blastp.REAL && \ 61 | cp /blast/bin/blastn /blast/bin/blastn.REAL && \ 62 | cp /blast/bin/blastx /blast/bin/blastx.REAL && \ 63 | cp /blast/bin/tblastn /blast/bin/tblastn.REAL && \ 64 | cp /blast/bin/tblastx /blast/bin/tblastx.REAL 65 | 66 | COPY blastn.sh /blast/bin/blastn 67 | COPY blastp.sh /blast/bin/blastp 68 | COPY blastx.sh /blast/bin/blastx 69 | COPY tblastn.sh /blast/bin/tblastn 70 | COPY tblastx.sh /blast/bin/tblastx 71 | 72 | RUN chmod +x /blast/bin/blastn && chmod +x /blast/bin/blastp && \ 73 | chmod +x /blast/bin/blastx && chmod +x /blast/bin/tblastn && \ 74 | chmod +x /blast/bin/tblastx 75 | 76 | 77 | WORKDIR /blast 78 | 79 | CMD ["/bin/bash"] 80 | 81 | -------------------------------------------------------------------------------- /blast/2.14.0/VERSION: -------------------------------------------------------------------------------- 1 | 2.14.0 2 | -------------------------------------------------------------------------------- /blast/2.14.0/blastn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | #echo database name: $dbname 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype nucl -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | blastn.REAL "$@" 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /blast/2.14.0/blastp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | #echo database name: $dbname 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype prot -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | blastp.REAL "$@" 26 | 27 | -------------------------------------------------------------------------------- /blast/2.14.0/blastx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | #echo database name: $dbname 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype prot -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | blastx.REAL "$@" 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /blast/2.14.0/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | DOCKERHUB_USERNAME=${1:-"ncbi"} 4 | IMAGE=blast 5 | VERSION=$(cat VERSION) 6 | # Check the latest ncbi-vdb release version in https://github.com/ncbi/ncbi-vdb/tags 7 | # To see which VDB version is currently used by C++ Toolkit do: 8 | # grep local_vdb_base src/build-system/config.site.ncbi 9 | VDB_VERSION=3.0.1 10 | NP=`grep -c ^proc /proc/cpuinfo` 11 | 12 | docker build --build-arg version=${VERSION} --build-arg num_procs=${NP} --build-arg vdb_version=${VDB_VERSION} -t $DOCKERHUB_USERNAME/$IMAGE:$VERSION . 13 | docker tag $DOCKERHUB_USERNAME/$IMAGE:$VERSION $DOCKERHUB_USERNAME/$IMAGE:latest 14 | -------------------------------------------------------------------------------- /blast/2.14.0/tblastn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | #echo database name: $dbname 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype nucl -getvolumespath) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | tblastn.REAL "$@" 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /blast/2.14.0/tblastx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | #echo database name: $dbname 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype nucl -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | tblastx.REAL "$@" 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /blast/2.14.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/edirect:12.5 as edirect 2 | FROM ubuntu:18.04 as blastbuild 3 | ARG blast_version 4 | ARG vdb_version 5 | ARG num_procs=8 6 | LABEL Description="NCBI BLAST" Vendor="NCBI/NLM/NIH" Version=${blast_version} Maintainer=camacho@ncbi.nlm.nih.gov 7 | 8 | USER root 9 | WORKDIR /root/ 10 | 11 | RUN apt-get -y -m update && apt-get install -y build-essential curl libidn11 libnet-perl perl-doc liblmdb-dev wget 12 | 13 | # cmake installed by apt is currently too old 14 | RUN wget https://github.com/Kitware/CMake/releases/download/v3.22.3/cmake-3.22.3-linux-x86_64.tar.gz && tar xfz cmake-3.22.3-linux-x86_64.tar.gz && rm cmake-3.22.3-linux-x86_64.tar.gz 15 | ENV PATH="${PATH}:/root/cmake-3.22.3-linux-x86_64/bin" 16 | 17 | # Download and build ncbi-vdb 18 | RUN wget https://github.com/ncbi/ncbi-vdb/archive/refs/tags/${vdb_version}.tar.gz && \ 19 | tar xfz ${vdb_version}.tar.gz && rm ${vdb_version}.tar.gz && \ 20 | mv ncbi-vdb-${vdb_version} ncbi-vdb && \ 21 | cd ncbi-vdb && ./configure --prefix /root/vdb && make install -j ${num_proc} 22 | 23 | # Arrange ncbi-vdb libraries and header files in a form that C++ toolkit 24 | # build can consume them. 25 | ARG VDB=/root/VDB 26 | RUN mkdir -p ${VDB}/linux/release/x86_64/lib && \ 27 | cp -R /root/vdb/lib64/* ${VDB}/linux/release/x86_64/lib && \ 28 | mkdir -p ${VDB}/interfaces && cp -R /root/vdb/include/* ${VDB}/interfaces 29 | 30 | # Build BLAST binaries 31 | RUN curl -sS https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${blast_version}/ncbi-blast-${blast_version}+-src.tar.gz | \ 32 | tar xzf - && \ 33 | cd ncbi-blast-${blast_version}+-src/c++ && \ 34 | ./configure --with-mt --with-strip --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --with-openmp --with-vdb=${VDB} --without-gnutls --without-gcrypt --without-zstd --without-lzo --prefix=/blast && \ 35 | cd ReleaseMT/build && \ 36 | make -j ${num_procs} -f Makefile.flat blastdb_aliastool.exe blastdbcheck.exe blastdbcmd.exe blast_formatter.exe blastn.exe blastp.exe blastx.exe convert2blastmask.exe deltablast.exe dustmasker.exe makeblastdb.exe makembindex.exe makeprofiledb.exe psiblast.exe rpsblast.exe rpstblastn.exe segmasker.exe tblastn.exe tblastx.exe windowmasker.exe blastn_vdb.exe tblastn_vdb.exe blast_formatter_vdb.exe blast_vdb_cmd.exe blastdb_path.exe 37 | 38 | FROM google/cloud-sdk:slim as gsutil 39 | ARG blast_version 40 | COPY VERSION . 41 | 42 | USER root 43 | WORKDIR /root/ 44 | 45 | RUN apt-get -y -m update && apt-get install -y libgomp1 libnet-perl libxml-simple-perl libjson-perl perl-doc liblmdb-dev parallel vmtouch cpanminus curl && rm -rf /var/lib/apt/lists/* && cpanm HTML::Entities 46 | 47 | RUN mkdir -p /blast/bin /blast/lib 48 | COPY --from=blastbuild /root/ncbi-blast-${blast_version}+-src/c++/ReleaseMT/bin /blast/bin 49 | COPY --from=blastbuild /root/ncbi-blast-${blast_version}+-src/c++/ReleaseMT/lib /blast/lib 50 | COPY --from=blastbuild /root/VDB/linux/release/x86_64/lib /blast/lib 51 | 52 | COPY --from=edirect /usr/local/ncbi/edirect /root/edirect 53 | 54 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 55 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 56 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 57 | ENV BLAST_DOCKER true 58 | ENV PATH="/root/edirect:/blast/bin:${PATH}" 59 | 60 | RUN cp /blast/bin/blastp /blast/bin/blastp.REAL && \ 61 | cp /blast/bin/blastn /blast/bin/blastn.REAL && \ 62 | cp /blast/bin/blastx /blast/bin/blastx.REAL && \ 63 | cp /blast/bin/tblastn /blast/bin/tblastn.REAL && \ 64 | cp /blast/bin/tblastx /blast/bin/tblastx.REAL 65 | 66 | COPY blastn.sh /blast/bin/blastn 67 | COPY blastp.sh /blast/bin/blastp 68 | COPY blastx.sh /blast/bin/blastx 69 | COPY tblastn.sh /blast/bin/tblastn 70 | COPY tblastx.sh /blast/bin/tblastx 71 | 72 | RUN chmod +x /blast/bin/blastn && chmod +x /blast/bin/blastp && \ 73 | chmod +x /blast/bin/blastx && chmod +x /blast/bin/tblastn && \ 74 | chmod +x /blast/bin/tblastx 75 | 76 | 77 | WORKDIR /blast 78 | 79 | CMD ["/bin/bash"] 80 | 81 | -------------------------------------------------------------------------------- /blast/2.14.1/VERSION: -------------------------------------------------------------------------------- 1 | 2.14.1 2 | -------------------------------------------------------------------------------- /blast/2.14.1/blastn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | #echo database name: $dbname 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype nucl -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | blastn.REAL "$@" 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /blast/2.14.1/blastp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | #echo database name: $dbname 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype prot -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | blastp.REAL "$@" 26 | 27 | -------------------------------------------------------------------------------- /blast/2.14.1/blastx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | #echo database name: $dbname 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype prot -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | blastx.REAL "$@" 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /blast/2.14.1/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | DOCKERHUB_USERNAME=${1:-"ncbi"} 4 | IMAGE=blast 5 | VERSION=$(cat VERSION) 6 | # Check the latest ncbi-vdb release version in https://github.com/ncbi/ncbi-vdb/tags 7 | # To see which VDB version is currently used by C++ Toolkit do: 8 | # grep local_vdb_base src/build-system/config.site.ncbi 9 | VDB_VERSION=3.0.6 10 | NP=`grep -c ^proc /proc/cpuinfo` 11 | 12 | docker build --progress=plain --build-arg blast_version=${VERSION} --build-arg num_procs=${NP} --build-arg vdb_version=${VDB_VERSION} -t $DOCKERHUB_USERNAME/$IMAGE:$VERSION . 2>&1 | tee build.log 13 | docker tag $DOCKERHUB_USERNAME/$IMAGE:$VERSION $DOCKERHUB_USERNAME/$IMAGE:latest 14 | -------------------------------------------------------------------------------- /blast/2.14.1/tblastn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | #echo database name: $dbname 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype nucl -getvolumespath) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | tblastn.REAL "$@" 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /blast/2.14.1/tblastx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | #echo database name: $dbname 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype nucl -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | tblastx.REAL "$@" 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /blast/2.15.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/edirect:20.6 as edirect 2 | FROM ubuntu:22.04 3 | ARG blast_version 4 | ARG vdb_version 5 | ARG num_procs=8 6 | LABEL Description="NCBI BLAST" Vendor="NCBI/NLM/NIH" Version=${blast_version} Maintainer=camacho@ncbi.nlm.nih.gov 7 | 8 | USER root 9 | WORKDIR /root/ 10 | RUN mkdir -p /blast/bin /blast/lib 11 | 12 | RUN apt-get -y -m update && apt-get install -y build-essential curl libidn12 libnet-perl perl-doc liblmdb-dev wget libsqlite3-dev cmake \ 13 | libgomp1 libxml-simple-perl libjson-perl parallel vmtouch cpanminus && \ 14 | rm -fr /var/lib/apt/lists/* && \ 15 | cpanm HTML::Entities 16 | 17 | # Download and build ncbi-vdb 18 | RUN wget https://github.com/ncbi/ncbi-vdb/archive/refs/tags/${vdb_version}.tar.gz && \ 19 | tar xfz ${vdb_version}.tar.gz && rm ${vdb_version}.tar.gz && \ 20 | mv ncbi-vdb-${vdb_version} ncbi-vdb && \ 21 | cd ncbi-vdb && ./configure --prefix /root/vdb && make install -j ${num_proc} 22 | 23 | # For debugging 24 | #RUN ldd --version 25 | 26 | # Arrange ncbi-vdb libraries and header files in a form that C++ toolkit 27 | # build can consume them. 28 | ARG VDB=/root/VDB 29 | RUN mkdir -p ${VDB}/linux/release/x86_64/lib && \ 30 | cp -R /root/vdb/lib64/* ${VDB}/linux/release/x86_64/lib && \ 31 | cp -R /root/vdb/lib64/* /blast/lib/ && \ 32 | mkdir -p ${VDB}/interfaces && cp -R /root/vdb/include/* ${VDB}/interfaces 33 | 34 | # Build BLAST binaries 35 | RUN curl -sS -H 'Cache-Control: no-cache, no-store' https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${blast_version}/ncbi-blast-${blast_version}+-src.tar.gz | \ 36 | tar xvzf - && \ 37 | cd ncbi-blast-${blast_version}+-src/c++ && \ 38 | ./configure --with-mt --with-strip --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --with-openmp --with-sqlite3 --with-vdb=${VDB} --without-gnutls --without-gcrypt --without-zstd --without-lzo --prefix=/blast && \ 39 | cd ReleaseMT/build && \ 40 | make -j ${num_procs} -f Makefile.flat blastdb_aliastool.exe blastdbcheck.exe blastdbcmd.exe blast_formatter.exe blastn.exe blastp.exe blastx.exe convert2blastmask.exe deltablast.exe dustmasker.exe makeblastdb.exe makembindex.exe makeprofiledb.exe psiblast.exe rpsblast.exe rpstblastn.exe segmasker.exe tblastn.exe tblastx.exe windowmasker.exe blastn_vdb.exe tblastn_vdb.exe blast_formatter_vdb.exe blast_vdb_cmd.exe blastdb_path.exe && \ 41 | find /root/ncbi-blast-${blast_version}+-src/c++/ReleaseMT && \ 42 | cp -pv /root/ncbi-blast-${blast_version}+-src/c++/ReleaseMT/bin/* /blast/bin/ && \ 43 | cp -pv /root/ncbi-blast-${blast_version}+-src/c++/ReleaseMT/lib/* /blast/lib/ 44 | 45 | # For debugging 46 | #RUN ldd --version 47 | 48 | COPY --from=edirect /home/docker/edirect /root/edirect 49 | COPY --from=edirect /home/docker/installconfirm /root/edirect 50 | 51 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 52 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 53 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 54 | ENV BLAST_DOCKER true 55 | ENV PATH="/root/edirect:/blast/bin:${PATH}" 56 | 57 | RUN cp /blast/bin/blastp /blast/bin/blastp.REAL && \ 58 | cp /blast/bin/blastn /blast/bin/blastn.REAL && \ 59 | cp /blast/bin/blastx /blast/bin/blastx.REAL && \ 60 | cp /blast/bin/tblastn /blast/bin/tblastn.REAL && \ 61 | cp /blast/bin/tblastx /blast/bin/tblastx.REAL 62 | 63 | COPY blastn.sh /blast/bin/blastn 64 | COPY blastp.sh /blast/bin/blastp 65 | COPY blastx.sh /blast/bin/blastx 66 | COPY tblastn.sh /blast/bin/tblastn 67 | COPY tblastx.sh /blast/bin/tblastx 68 | 69 | RUN chmod +x /blast/bin/blastn && chmod +x /blast/bin/blastp && \ 70 | chmod +x /blast/bin/blastx && chmod +x /blast/bin/tblastn && \ 71 | chmod +x /blast/bin/tblastx 72 | 73 | RUN curl -sSL https://sdk.cloud.google.com | bash 74 | ENV PATH="${PATH}:/root/google-cloud-sdk/bin" 75 | 76 | RUN rm -fr /root/ncbi-blast-${version}+-src 77 | 78 | WORKDIR /blast 79 | 80 | CMD ["/bin/bash"] 81 | 82 | -------------------------------------------------------------------------------- /blast/2.15.0/VERSION: -------------------------------------------------------------------------------- 1 | 2.15.0 2 | -------------------------------------------------------------------------------- /blast/2.15.0/blastn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype nucl -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | blastn.REAL "$@" 26 | -------------------------------------------------------------------------------- /blast/2.15.0/blastp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype prot -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | blastp.REAL "$@" 26 | -------------------------------------------------------------------------------- /blast/2.15.0/blastx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype prot -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | blastx.REAL "$@" 26 | -------------------------------------------------------------------------------- /blast/2.15.0/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -xeuo pipefail 3 | 4 | DOCKERHUB_USERNAME=${1:-"ncbi"} 5 | IMAGE=blast 6 | VERSION=$(cat VERSION) 7 | # Check the latest ncbi-vdb release version in https://github.com/ncbi/ncbi-vdb/tags 8 | # To see which VDB version is currently used by C++ Toolkit do: 9 | # grep local_vdb_base src/build-system/config.site.ncbi 10 | VDB_VERSION=3.0.8 11 | NP=$(grep -c ^proc /proc/cpuinfo) 12 | 13 | docker build --progress=plain --build-arg blast_version="${VERSION}" --build-arg num_procs="${NP}" --build-arg vdb_version=${VDB_VERSION} -t "$DOCKERHUB_USERNAME"/$IMAGE:"$VERSION" --pull --no-cache . 2>&1 | tee build.log 14 | docker tag "$DOCKERHUB_USERNAME"/$IMAGE:"$VERSION" "$DOCKERHUB_USERNAME"/$IMAGE:latest 15 | -------------------------------------------------------------------------------- /blast/2.15.0/tblastn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype nucl -getvolumespath) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | tblastn.REAL "$@" 26 | -------------------------------------------------------------------------------- /blast/2.15.0/tblastx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype nucl -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | tblastx.REAL "$@" 26 | -------------------------------------------------------------------------------- /blast/2.16.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/edirect:20.6 as edirect 2 | FROM ubuntu:22.04 3 | ARG blast_version 4 | ARG vdb_version 5 | ARG num_procs=8 6 | ARG CLOUD_SDK_VERSION=472.0.0 7 | LABEL Description="NCBI BLAST" Vendor="NCBI/NLM/NIH" Version=${blast_version} Maintainer=camacho@ncbi.nlm.nih.gov 8 | 9 | USER root 10 | WORKDIR /root/ 11 | RUN mkdir -p /blast/bin /blast/lib 12 | 13 | RUN apt-get -y -m update && apt-get install -y build-essential curl libidn12 libnet-perl perl-doc liblmdb-dev wget libsqlite3-dev cmake \ 14 | libgomp1 libxml-simple-perl libjson-perl parallel vmtouch cpanminus python3 python3-openssl && \ 15 | rm -fr /var/lib/apt/lists/* && \ 16 | cpanm HTML::Entities && rm -fr .cpanm 17 | 18 | # Download and build ncbi-vdb 19 | RUN wget -q https://github.com/ncbi/ncbi-vdb/archive/refs/tags/${vdb_version}.tar.gz && \ 20 | tar xfz ${vdb_version}.tar.gz && rm ${vdb_version}.tar.gz && \ 21 | mv ncbi-vdb-${vdb_version} ncbi-vdb && \ 22 | cd ncbi-vdb && ./configure --prefix /root/vdb && make install -j ${num_proc} && \ 23 | rm -fr ncbi-outdir 24 | 25 | # For debugging 26 | #RUN ldd --version 27 | 28 | # Arrange ncbi-vdb libraries and header files in a form that C++ toolkit 29 | # build can consume them. 30 | ARG VDB=/root/VDB 31 | RUN mkdir -p ${VDB}/linux/release/x86_64/lib && \ 32 | cp -R /root/vdb/lib64/* ${VDB}/linux/release/x86_64/lib && \ 33 | cp -R /root/vdb/lib64/* /blast/lib/ && \ 34 | mkdir -p ${VDB}/interfaces && cp -R /root/vdb/include/* ${VDB}/interfaces 35 | 36 | # Build BLAST binaries 37 | RUN curl -sS -H 'Cache-Control: no-cache, no-store' https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${blast_version}/ncbi-blast-${blast_version}+-src.tar.gz | \ 38 | tar xzf - && \ 39 | cd ncbi-blast-${blast_version}+-src/c++ && \ 40 | ./configure --with-mt --with-strip --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --with-openmp --with-sqlite3 --with-vdb=${VDB} --without-gnutls --without-gcrypt --without-zstd --without-lzo --prefix=/blast && \ 41 | cd ReleaseMT/build && \ 42 | make -j ${num_procs} -f Makefile.flat blastdb_aliastool.exe blastdbcheck.exe blastdbcmd.exe blast_formatter.exe blastn.exe blastp.exe blastx.exe convert2blastmask.exe deltablast.exe dustmasker.exe makeblastdb.exe makembindex.exe makeprofiledb.exe psiblast.exe rpsblast.exe rpstblastn.exe segmasker.exe tblastn.exe tblastx.exe windowmasker.exe blastn_vdb.exe tblastn_vdb.exe blast_formatter_vdb.exe blast_vdb_cmd.exe blastdb_path.exe && \ 43 | find /root/ncbi-blast-${blast_version}+-src/c++/ReleaseMT && \ 44 | cp -pv /root/ncbi-blast-${blast_version}+-src/c++/ReleaseMT/bin/*blast* /blast/bin/ && \ 45 | cp -pv /root/ncbi-blast-${blast_version}+-src/c++/ReleaseMT/bin/*masker /blast/bin/ && \ 46 | cp -pv /root/ncbi-blast-${blast_version}+-src/c++/ReleaseMT/bin/makembindex /blast/bin/ && \ 47 | cp -pv /root/ncbi-blast-${blast_version}+-src/c++/ReleaseMT/bin/makeprofiledb /blast/bin/ && \ 48 | cp -pv /root/ncbi-blast-${blast_version}+-src/c++/ReleaseMT/lib/* /blast/lib/ && \ 49 | rm -fr /root/ncbi-blast-${blast_version}+-src /root/ncbi-outdir 50 | 51 | # For debugging 52 | #RUN ldd --version 53 | 54 | COPY --from=edirect /home/docker/edirect /root/edirect 55 | COPY --from=edirect /home/docker/installconfirm /root/edirect 56 | 57 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 58 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 59 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 60 | ENV BLAST_DOCKER true 61 | ENV PATH="/root/edirect:/blast/bin:${PATH}" 62 | 63 | RUN cp /blast/bin/blastp /blast/bin/blastp.REAL && \ 64 | cp /blast/bin/blastn /blast/bin/blastn.REAL && \ 65 | cp /blast/bin/blastx /blast/bin/blastx.REAL && \ 66 | cp /blast/bin/tblastn /blast/bin/tblastn.REAL && \ 67 | cp /blast/bin/tblastx /blast/bin/tblastx.REAL 68 | 69 | COPY blastn.sh /blast/bin/blastn 70 | COPY blastp.sh /blast/bin/blastp 71 | COPY blastx.sh /blast/bin/blastx 72 | COPY tblastn.sh /blast/bin/tblastn 73 | COPY tblastx.sh /blast/bin/tblastx 74 | 75 | RUN chmod +x /blast/bin/blastn && chmod +x /blast/bin/blastp && \ 76 | chmod +x /blast/bin/blastx && chmod +x /blast/bin/tblastn && \ 77 | chmod +x /blast/bin/tblastx 78 | 79 | ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION 80 | ENV PATH /root/google-cloud-sdk/bin:$PATH 81 | ENV CLOUDSDK_PYTHON=/usr/bin/python3 82 | RUN ARCH=x86_64 && \ 83 | curl -s -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-${CLOUD_SDK_VERSION}-linux-${ARCH}.tar.gz && \ 84 | tar xzf google-cloud-cli-${CLOUD_SDK_VERSION}-linux-${ARCH}.tar.gz && \ 85 | rm google-cloud-cli-${CLOUD_SDK_VERSION}-linux-${ARCH}.tar.gz && \ 86 | rm -rf google-cloud-sdk/platform/bundledpythonunix && \ 87 | gcloud components remove -q bq && \ 88 | rm -fr $(find google-cloud-sdk/ -regex ".*/__pycache__") && \ 89 | rm -rf google-cloud-sdk/.install/.backup && \ 90 | rm -fr google-cloud-sdk/bin/anthoscli && \ 91 | rm -fr google-cloud-sdk/lib/third_party/{botocore,kubernetes} && \ 92 | rm -fr google-cloud-sdk/lib/googlecloudsdk/generated_clients/apis/compute/{alpha,beta} && \ 93 | rm -fr google-cloud-sdk/lib/googlecloudsdk/generated_clients/apis/{healthcare,gkehub,cloudbuild,containeranalysis,dialogflow,aiplatform} && \ 94 | rm -fr google-cloud-sdk/lib/surface && \ 95 | rm -fr $(find google-cloud-sdk/ -name doc -o -name docs) && \ 96 | gsutil --version && \ 97 | gsutil ls gs://blast-db 98 | ENV PATH /root/google-cloud-sdk/bin:$PATH 99 | ENV CLOUDSDK_PYTHON=/usr/bin/python3 100 | 101 | 102 | WORKDIR /blast 103 | 104 | CMD ["/bin/bash"] 105 | 106 | -------------------------------------------------------------------------------- /blast/2.16.0/VERSION: -------------------------------------------------------------------------------- 1 | 2.16.0 2 | -------------------------------------------------------------------------------- /blast/2.16.0/blastn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype nucl -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | blastn.REAL "$@" 26 | -------------------------------------------------------------------------------- /blast/2.16.0/blastp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype prot -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | blastp.REAL "$@" 26 | -------------------------------------------------------------------------------- /blast/2.16.0/blastx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype prot -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | blastx.REAL "$@" 26 | -------------------------------------------------------------------------------- /blast/2.16.0/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -xeuo pipefail 3 | 4 | DOCKERHUB_USERNAME=${1:-"ncbi"} 5 | IMAGE=blast 6 | VERSION=$(cat VERSION) 7 | # Check the latest ncbi-vdb release version in https://github.com/ncbi/ncbi-vdb/tags 8 | # To see which VDB version is currently used by C++ Toolkit do: 9 | # grep local_vdb_base src/build-system/config.site.ncbi 10 | VDB_VERSION=3.1.1 11 | NP=$(grep -c ^proc /proc/cpuinfo) 12 | 13 | docker build --progress=plain --build-arg blast_version="${VERSION}" --build-arg num_procs="${NP}" --build-arg vdb_version=${VDB_VERSION} -t "$DOCKERHUB_USERNAME"/$IMAGE:"$VERSION" --pull --no-cache . 2>&1 | tee build.log 14 | docker tag "$DOCKERHUB_USERNAME"/$IMAGE:"$VERSION" "$DOCKERHUB_USERNAME"/$IMAGE:latest 15 | 16 | #docker history --format json --no-trunc -H "$DOCKERHUB_USERNAME"/$IMAGE:"$VERSION" | jq -M . | tee docker-"$DOCKERHUB_USERNAME"-$IMAGE-"$VERSION".json 17 | docker history --format '{{json .}}' --no-trunc -H "$DOCKERHUB_USERNAME"/$IMAGE:"$VERSION" | jq -M . | tee docker-"$DOCKERHUB_USERNAME"-$IMAGE-"$VERSION".json 18 | docker image ls 19 | -------------------------------------------------------------------------------- /blast/2.16.0/tblastn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype nucl -getvolumespath) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | tblastn.REAL "$@" 26 | -------------------------------------------------------------------------------- /blast/2.16.0/tblastx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dbnametopass=0 4 | for i in $*; do 5 | #echo item: $i 6 | if [ $i = "-db" ]; then 7 | dbnametopass=1 8 | #echo dbnametopass: $dbnametopass 9 | elif [ $dbnametopass = 1 ]; then 10 | dbname=$i 11 | #echo database name: $dbname 12 | break 13 | else 14 | continue 15 | fi 16 | done 17 | 18 | if [ -n "$dbname" ]; then 19 | filelist=$(blastdb_path -db $dbname -dbtype nucl -getvolumespath 2>/dev/null) 20 | if [ $? = 0 ]; then 21 | #echo $filelist 22 | parallel vmtouch -tqm 5G ::: $filelist & 23 | fi 24 | fi 25 | tblastx.REAL "$@" 26 | -------------------------------------------------------------------------------- /blast/2.7.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:17.10 as blastbuild 2 | 3 | ARG version 4 | 5 | USER root 6 | WORKDIR /root/ 7 | 8 | RUN apt-get -y -m update && apt-get install -y build-essential wget libidn11 libnet-perl liblist-moreutils-perl perl-doc 9 | 10 | RUN wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/ncbi-blast-2.7.1+-src.tar.gz 11 | RUN tar xvf ncbi-blast-2.7.1+-src.tar.gz 12 | WORKDIR /root/ncbi-blast-2.7.1+-src/c++ 13 | RUN ./configure --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --prefix=/blast 14 | WORKDIR /root/ncbi-blast-2.7.1+-src/c++/ReleaseMT/build 15 | RUN make -f Makefile.flat blastdb_aliastool.exe blastdbcheck.exe blastdbcmd.exe blast_formatter.exe blastn.exe blastp.exe blastx.exe convert2blastmask.exe deltablast.exe dustmasker.exe makeblastdb.exe makembindex.exe makeprofiledb.exe psiblast.exe rpsblast.exe rpstblastn.exe segmasker.exe tblastn.exe tblastx.exe windowmasker.exe 16 | 17 | 18 | FROM ubuntu:17.10 19 | 20 | COPY VERSION . 21 | 22 | USER root 23 | WORKDIR /root/ 24 | 25 | RUN apt-get -y -m update && apt-get install -y libgomp1 26 | 27 | RUN mkdir -p /blast/bin /blast/lib 28 | COPY --from=blastbuild /root/ncbi-blast-2.7.1+-src/c++/ReleaseMT/bin /blast/bin 29 | COPY --from=blastbuild /root/ncbi-blast-2.7.1+-src/c++/ReleaseMT/lib /blast/lib 30 | 31 | WORKDIR /blast/blastdb 32 | ENV BLASTDB /blast/blastdb 33 | ENV PATH="/blast/bin:${PATH}" 34 | 35 | CMD ["/bin/bash"] 36 | 37 | -------------------------------------------------------------------------------- /blast/2.7.1/VERSION: -------------------------------------------------------------------------------- 1 | 18.02 -------------------------------------------------------------------------------- /blast/2.7.1/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | USERNAME=ncbi 4 | IMAGE=blast 5 | VERSION=`cat VERSION` 6 | 7 | #wget -nc ftp://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/ncbi-blast-${VERSION}+-src.tar.gz 8 | 9 | docker build --build-arg version=${VERSION} -t $USERNAME/$IMAGE:$VERSION . 10 | docker tag $USERNAME/$IMAGE:$VERSION $USERNAME/$IMAGE:latest 11 | -------------------------------------------------------------------------------- /blast/2.8.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 as blastbuild 2 | 3 | ARG version 4 | ARG num_procs=8 5 | LABEL Description="NCBI BLAST" Vendor="NCBI/NLM/NIH" Version=${version} Maintainer=camacho@ncbi.nlm.nih.gov 6 | 7 | USER root 8 | WORKDIR /root/ 9 | 10 | RUN apt-get -y -m update && apt-get install -y build-essential curl libidn11 libnet-perl perl-doc liblmdb-dev 11 | 12 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}alpha/ncbi-blast-${version}-alpha+-src.tar.gz | \ 13 | tar xzf - && \ 14 | cd ncbi-blast-${version}+-src/c++ && \ 15 | ./configure --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --with-openmp --prefix=/blast && \ 16 | cd ReleaseMT/build && \ 17 | make -j ${num_procs} -f Makefile.flat blastdb_aliastool.exe blastdbcheck.exe blastdbcmd.exe blast_formatter.exe blastn.exe blastp.exe blastx.exe convert2blastmask.exe deltablast.exe dustmasker.exe makeblastdb.exe makembindex.exe makeprofiledb.exe psiblast.exe rpsblast.exe rpstblastn.exe segmasker.exe tblastn.exe tblastx.exe windowmasker.exe 18 | 19 | 20 | FROM ubuntu:18.04 21 | ARG version 22 | COPY VERSION . 23 | 24 | USER root 25 | WORKDIR /root/ 26 | 27 | RUN apt-get -y -m update && apt-get install -y libgomp1 libnet-perl libxml-simple-perl libjson-perl perl-doc liblmdb-dev parallel vmtouch cpanminus curl && rm -rf /var/lib/apt/lists/* && cpanm HTML::Entities 28 | 29 | RUN mkdir -p /blast/bin /blast/lib 30 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/bin /blast/bin 31 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/lib /blast/lib 32 | 33 | COPY --from=ncbi/edirect /usr/local/ncbi/edirect /root/edirect 34 | 35 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 36 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 37 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 38 | ENV PATH="/root/edirect:/blast/bin:${PATH}" 39 | 40 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/update_blastdb.pl -o update_blastdb.pl && install -m 755 update_blastdb.pl /blast/bin/ && rm -f update_blastdb.pl 41 | 42 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/blastdb_path -o /blast/bin/blastdb_path && chmod +x /blast/bin/blastdb_path && \ 43 | cp /blast/bin/blastp /blast/bin/blastp.REAL && \ 44 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/blastp.sh -o /blast/bin/blastp && chmod +x /blast/bin/blastp && \ 45 | cp /blast/bin/blastn /blast/bin/blastn.REAL && \ 46 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/blastn.sh -o /blast/bin/blastn && chmod +x /blast/bin/blastn && \ 47 | cp /blast/bin/blastx /blast/bin/blastx.REAL && \ 48 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/blastx.sh -o /blast/bin/blastx && chmod +x /blast/bin/blastx && \ 49 | cp /blast/bin/tblastn /blast/bin/tblastn.REAL && \ 50 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/tblastn.sh -o /blast/bin/tblastn && chmod +x /blast/bin/tblastn && \ 51 | cp /blast/bin/tblastx /blast/bin/tblastx.REAL && \ 52 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/tblastx.sh -o /blast/bin/tblastx && chmod +x /blast/bin/tblastx 53 | RUN echo 'will cite' | parallel --citation 54 | 55 | WORKDIR /blast 56 | 57 | CMD ["/bin/bash"] 58 | 59 | -------------------------------------------------------------------------------- /blast/2.8.0/VERSION: -------------------------------------------------------------------------------- 1 | 2.8.0 2 | -------------------------------------------------------------------------------- /blast/2.8.0/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | USERNAME=ncbi 4 | IMAGE=blast 5 | VERSION=`cat VERSION` 6 | NP=`grep -c ^proc /proc/cpuinfo` 7 | 8 | docker build --build-arg version=${VERSION} --build-arg num_procs=${NP} -t $USERNAME/$IMAGE:$VERSION . 9 | docker tag $USERNAME/$IMAGE:$VERSION $USERNAME/$IMAGE:latest 10 | -------------------------------------------------------------------------------- /blast/2.8.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/edirect as edirect 2 | FROM ubuntu:18.04 as blastbuild 3 | 4 | ARG version 5 | ARG num_procs=8 6 | LABEL Description="NCBI BLAST" Vendor="NCBI/NLM/NIH" Version=${version} Maintainer=camacho@ncbi.nlm.nih.gov 7 | 8 | USER root 9 | WORKDIR /root/ 10 | 11 | RUN apt-get -y -m update && apt-get install -y build-essential curl libidn11 libnet-perl perl-doc liblmdb-dev 12 | 13 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz | \ 14 | tar xzf - && \ 15 | cd ncbi-blast-${version}+-src/c++ && \ 16 | ./configure --with-mt --with-strip --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --with-openmp --without-vdb --without-gnutls --without-gcrypt --prefix=/blast && \ 17 | cd ReleaseMT/build && \ 18 | make -j ${num_procs} -f Makefile.flat blastdb_aliastool.exe blastdbcheck.exe blastdbcmd.exe blast_formatter.exe blastn.exe blastp.exe blastx.exe convert2blastmask.exe deltablast.exe dustmasker.exe makeblastdb.exe makembindex.exe makeprofiledb.exe psiblast.exe rpsblast.exe rpstblastn.exe segmasker.exe tblastn.exe tblastx.exe windowmasker.exe 19 | 20 | 21 | FROM ubuntu:18.04 22 | ARG version 23 | COPY VERSION . 24 | 25 | USER root 26 | WORKDIR /root/ 27 | 28 | RUN apt-get -y -m update && apt-get install -y libgomp1 libnet-perl libxml-simple-perl libjson-perl perl-doc liblmdb-dev parallel vmtouch cpanminus curl && rm -rf /var/lib/apt/lists/* && cpanm HTML::Entities 29 | 30 | RUN mkdir -p /blast/bin /blast/lib 31 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/bin /blast/bin 32 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/lib /blast/lib 33 | 34 | COPY --from=edirect /usr/local/ncbi/edirect /root/edirect 35 | 36 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 37 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 38 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 39 | ENV PATH="/root/edirect:/blast/bin:${PATH}" 40 | 41 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/update_blastdb.pl -o update_blastdb.pl && install -m 755 update_blastdb.pl /blast/bin/ && rm -f update_blastdb.pl 42 | 43 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastdb_path -o /blast/bin/blastdb_path && chmod +x /blast/bin/blastdb_path && \ 44 | cp /blast/bin/blastp /blast/bin/blastp.REAL && \ 45 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastp.sh -o /blast/bin/blastp && chmod +x /blast/bin/blastp && \ 46 | cp /blast/bin/blastn /blast/bin/blastn.REAL && \ 47 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastn.sh -o /blast/bin/blastn && chmod +x /blast/bin/blastn && \ 48 | cp /blast/bin/blastx /blast/bin/blastx.REAL && \ 49 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastx.sh -o /blast/bin/blastx && chmod +x /blast/bin/blastx && \ 50 | cp /blast/bin/tblastn /blast/bin/tblastn.REAL && \ 51 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastn.sh -o /blast/bin/tblastn && chmod +x /blast/bin/tblastn && \ 52 | cp /blast/bin/tblastx /blast/bin/tblastx.REAL && \ 53 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastx.sh -o /blast/bin/tblastx && chmod +x /blast/bin/tblastx 54 | RUN echo 'will cite' | parallel --citation 55 | 56 | WORKDIR /blast 57 | 58 | CMD ["/bin/bash"] 59 | 60 | -------------------------------------------------------------------------------- /blast/2.8.1/VERSION: -------------------------------------------------------------------------------- 1 | 2.8.1 2 | -------------------------------------------------------------------------------- /blast/2.8.1/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | USERNAME=ncbi 4 | IMAGE=blast 5 | VERSION=`cat VERSION` 6 | NP=`grep -c ^proc /proc/cpuinfo` 7 | 8 | docker build --build-arg version=${VERSION} --build-arg num_procs=${NP} -t $USERNAME/$IMAGE:$VERSION . 9 | docker tag $USERNAME/$IMAGE:$VERSION $USERNAME/$IMAGE:latest 10 | -------------------------------------------------------------------------------- /blast/2.9.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/edirect as edirect 2 | FROM ubuntu:18.04 as blastbuild 3 | 4 | ARG version 5 | ARG num_procs=8 6 | LABEL Description="NCBI BLAST" Vendor="NCBI/NLM/NIH" Version=${version} Maintainer=camacho@ncbi.nlm.nih.gov 7 | 8 | USER root 9 | WORKDIR /root/ 10 | 11 | RUN apt-get -y -m update && apt-get install -y build-essential curl libidn11 libnet-perl perl-doc liblmdb-dev 12 | 13 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz | \ 14 | tar xzf - && \ 15 | cd ncbi-blast-${version}+-src/c++ && \ 16 | ./configure --with-mt --with-strip --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --with-openmp --without-vdb --without-gnutls --without-gcrypt --prefix=/blast && \ 17 | cd ReleaseMT/build && \ 18 | make -j ${num_procs} -f Makefile.flat blastdb_aliastool.exe blastdbcheck.exe blastdbcmd.exe blast_formatter.exe blastn.exe blastp.exe blastx.exe convert2blastmask.exe deltablast.exe dustmasker.exe makeblastdb.exe makembindex.exe makeprofiledb.exe psiblast.exe rpsblast.exe rpstblastn.exe segmasker.exe tblastn.exe tblastx.exe windowmasker.exe 19 | 20 | 21 | FROM ubuntu:18.04 22 | ARG version 23 | COPY VERSION . 24 | 25 | USER root 26 | WORKDIR /root/ 27 | 28 | RUN apt-get -y -m update && apt-get install -y libgomp1 libnet-perl libxml-simple-perl libjson-perl perl-doc liblmdb-dev parallel vmtouch cpanminus curl && rm -rf /var/lib/apt/lists/* && cpanm HTML::Entities 29 | 30 | RUN mkdir -p /blast/bin /blast/lib 31 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/bin /blast/bin 32 | COPY --from=blastbuild /root/ncbi-blast-${version}+-src/c++/ReleaseMT/lib /blast/lib 33 | 34 | COPY --from=edirect /usr/local/ncbi/edirect /root/edirect 35 | 36 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 37 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 38 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 39 | ENV PATH="/root/edirect:/blast/bin:${PATH}" 40 | 41 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastdb_path -o /blast/bin/blastdb_path && chmod +x /blast/bin/blastdb_path && \ 42 | cp /blast/bin/blastp /blast/bin/blastp.REAL && \ 43 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastp.sh -o /blast/bin/blastp && chmod +x /blast/bin/blastp && \ 44 | cp /blast/bin/blastn /blast/bin/blastn.REAL && \ 45 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastn.sh -o /blast/bin/blastn && chmod +x /blast/bin/blastn && \ 46 | cp /blast/bin/blastx /blast/bin/blastx.REAL && \ 47 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/blastx.sh -o /blast/bin/blastx && chmod +x /blast/bin/blastx && \ 48 | cp /blast/bin/tblastn /blast/bin/tblastn.REAL && \ 49 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastn.sh -o /blast/bin/tblastn && chmod +x /blast/bin/tblastn && \ 50 | cp /blast/bin/tblastx /blast/bin/tblastx.REAL && \ 51 | curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/temp/${version}/tblastx.sh -o /blast/bin/tblastx && chmod +x /blast/bin/tblastx 52 | RUN echo 'will cite' | parallel --citation 53 | 54 | WORKDIR /blast 55 | 56 | CMD ["/bin/bash"] 57 | 58 | -------------------------------------------------------------------------------- /blast/2.9.0/VERSION: -------------------------------------------------------------------------------- 1 | 2.9.0 2 | -------------------------------------------------------------------------------- /blast/2.9.0/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | DOCKERHUB_USERNAME=${1:-"ncbi"} 4 | IMAGE=blast 5 | VERSION=`cat VERSION` 6 | NP=`grep -c ^proc /proc/cpuinfo` 7 | 8 | docker build --build-arg version=${VERSION} --build-arg num_procs=${NP} -t $DOCKERHUB_USERNAME/$IMAGE:$VERSION . 9 | docker tag $DOCKERHUB_USERNAME/$IMAGE:$VERSION $DOCKERHUB_USERNAME/$IMAGE:latest 10 | -------------------------------------------------------------------------------- /blast/LICENSE: -------------------------------------------------------------------------------- 1 | PUBLIC DOMAIN NOTICE 2 | National Center for Biotechnology Information 3 | 4 | This software/database is a "United States Government Work" under the 5 | terms of the United States Copyright Act. It was written as part of 6 | the author's official duties as a United States Government employee and 7 | thus cannot be copyrighted. This software/database is freely available 8 | to the public for use. The National Library of Medicine and the U.S. 9 | Government have not placed any restriction on its use or reproduction. 10 | 11 | Although all reasonable efforts have been taken to ensure the accuracy 12 | and reliability of the software and data, the NLM and the U.S. 13 | Government do not and cannot warrant the performance or results that 14 | may be obtained by using this software or data. The NLM and the U.S. 15 | Government disclaim all warranties, express or implied, including 16 | warranties of performance, merchantability or fitness for any particular 17 | purpose. 18 | 19 | Please cite the author in any work or product based on this material. 20 | -------------------------------------------------------------------------------- /blast/README.md: -------------------------------------------------------------------------------- 1 | # Official NCBI BLAST+ Docker image 2 | 3 | Please see https://github.com/ncbi/blast_plus_docs for additional 4 | documentation. 5 | 6 | # Support 7 | 8 | ## Supported tags and respective Dockerfile links 9 | * [2.11.0](https://github.com/ncbi/docker/blob/master/blast/2.11.0/Dockerfile): [release notes](https://www.ncbi.nlm.nih.gov/books/NBK131777) 10 | * [2.10.1](https://github.com/ncbi/docker/blob/master/blast/2.10.1/Dockerfile): [release notes](https://www.ncbi.nlm.nih.gov/books/NBK131777/#Blast_ReleaseNotes.BLAST_2_10_1_June_8_2) 11 | * [2.10.0](https://github.com/ncbi/docker/blob/master/blast/2.10.0/Dockerfile): [release notes](https://www.ncbi.nlm.nih.gov/books/NBK131777/#Blast_ReleaseNotes.BLAST_2_10_0_December) 12 | 13 | ## Where to get help with: 14 | 15 | BLAST: Check out the [BLAST+ Cookbook](https://www.ncbi.nlm.nih.gov/books/NBK279696/), consult the [BLAST Knowledge Base](https://support.nlm.nih.gov/knowledgebase/category/?id=CAT-01239), or email us at blast-help@ncbi.nlm.nih.gov. 16 | Docker: [the Docker Community Forums](https://forums.docker.com), [the Docker Community Slack](https://blog.docker.com/2016/11/introducing-docker-community-directory-docker-community-slack/), or [Stack Overflow](https://stackoverflow.com/search?tab=newest&q=docker+blast) 17 | 18 | ## Where to file issues: 19 | 20 | Please email us at blast-help@ncbi.nlm.nih.gov. 21 | 22 | ## Supported architectures 23 | 24 | `amd64` 25 | -------------------------------------------------------------------------------- /blast/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # test.sh: Perform some sanity checks on the BLAST docker image 3 | # 4 | # Author: Christiam Camacho (camacho@ncbi.nlm.nih.gov) 5 | # Created: Fri 07 Dec 2018 03:45:23 PM EST 6 | 7 | export PATH=/bin:/usr/bin 8 | set -uo pipefail 9 | shopt -s nullglob 10 | 11 | IMG=${1:-"ncbi/blast:latest"} 12 | DB=taxdb 13 | 14 | 15 | SCRIPT_DIR=$(cd "`dirname "$0"`"; pwd) 16 | TMP=`mktemp -dp $SCRIPT_DIR/` # Creates tmp directory 17 | trap " /bin/rm -fr $TMP " INT QUIT EXIT HUP KILL ALRM 18 | 19 | time docker run --rm ${IMG} /bin/bash -c "printenv BLASTDB" 20 | 21 | time docker run --rm ${IMG} blastn -version 22 | time docker run --rm ${IMG} blastn_vdb -version-full 23 | time docker run --rm ${IMG} installconfirm 24 | time docker run --rm -v $TMP:/blast/blastdb:rw -w /blast/blastdb ${IMG} efetch -db nucleotide -id u00001 -format fasta | tee $TMP/u00001.fna 25 | time docker run --rm -v $TMP:/blast/blastdb:rw -w /blast/blastdb ${IMG} makeblastdb -in u00001.fna -dbtype nucl -out test-blastdb -title TEST 26 | time docker run --rm -v $TMP:/blast/blastdb:rw ${IMG} blastdbcmd -info -db test-blastdb 27 | time docker run --rm -v $TMP:/blast/blastdb:rw -w /blast/blastdb ${IMG} blastn -query u00001.fna -db test-blastdb -outfmt 6 | tee $TMP/blastn.out 28 | NUM_LINES=`wc -l $TMP/blastn.out | cut -f 1 -d ' '` 29 | [ $NUM_LINES -eq 1 ] || "BLASTn search failed!" 30 | 31 | time docker run --rm ${IMG} gsutil --version 32 | 33 | time docker run --rm -v $TMP:/blast/blastdb:rw -w /blast/blastdb ${IMG} update_blastdb.pl --decompress --source ncbi $DB 34 | time docker run --rm -v $TMP:/blast/blastdb:rw -w /blast/blastdb ${IMG} update_blastdb.pl --decompress --source gcp $DB 35 | time docker run --rm -v $TMP:/blast/blastdb:rw -w /blast/blastdb ${IMG} update_blastdb.pl --decompress --source aws $DB 36 | ls -l $TMP 37 | 38 | time docker run --rm ${IMG} get_species_taxids.sh -n squirrel 39 | -------------------------------------------------------------------------------- /blastdbs/amr/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/blast:18.02 as etl 2 | 3 | USER root 4 | 5 | WORKDIR ${BLASTDB} 6 | COPY AMRProt ${BLASTDB} 7 | RUN makeblastdb -in AMRProt -dbtype prot 8 | 9 | FROM ncbi/blast:18.02 10 | 11 | COPY VERSION . 12 | 13 | USER root 14 | 15 | WORKDIR ${BLASTDB} 16 | 17 | COPY --from=etl ${BLASTDB} ${BLASTDB}/. 18 | 19 | CMD ["/bin/sh"] 20 | -------------------------------------------------------------------------------- /blastdbs/amr/VERSION: -------------------------------------------------------------------------------- 1 | 18.02 -------------------------------------------------------------------------------- /blastdbs/amr/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #set -ex 3 | 4 | wget -nc ftp://ftp.ncbi.nlm.nih.gov/pub/slottad/amr/AMRProt 5 | 6 | USERNAME=ncbi 7 | IMAGE=blast_amr 8 | VERSION=`cat VERSION` 9 | 10 | docker build -t $USERNAME/$IMAGE:$VERSION . 11 | docker tag $USERNAME/$IMAGE:$VERSION $USERNAME/$IMAGE:latest 12 | -------------------------------------------------------------------------------- /blastdbs/contam_filter/Dockerfile: -------------------------------------------------------------------------------- 1 | # Set the base image to Ubuntu 2 | FROM ncbi/blast:18.02 3 | 4 | COPY VERSION . 5 | 6 | USER root 7 | 8 | RUN apt-get -y -m update && apt-get install -y gawk 9 | 10 | # get and setup blast applications 11 | COPY binaries /usr/bin 12 | RUN chmod 755 /usr/bin/vecscreen && chown root:root /usr/bin/vecscreen 13 | RUN chmod 755 /usr/bin/VSlistTo1HitPerLine.awk && chown root:root /usr/bin/VSlistTo1HitPerLine.awk 14 | 15 | WORKDIR ${BLASTDB} 16 | 17 | COPY databases ${BLASTDB} 18 | 19 | RUN gzip -d contam_in_euks.fa.gz \ 20 | && makeblastdb -in contam_in_euks.fa -dbtype nucl \ 21 | && makeblastdb -in contam_in_prok.fa -dbtype nucl \ 22 | && makeblastdb -in contam_in_euks.fa -dbtype nucl \ 23 | && makeblastdb -in adaptors_for_screening_proks.fa -dbtype nucl \ 24 | && makeblastdb -in adaptors_for_screening_euks.fa -dbtype nucl \ 25 | && gzip -d mito.nt.gz \ 26 | && makeblastdb -in mito.nt -dbtype nucl \ 27 | && gzip -d rrna.gz \ 28 | && makeblastdb -in rrna -dbtype nucl \ 29 | && makeblastdb -in UniVec -dbtype nucl 30 | 31 | CMD ["/bin/sh"] 32 | -------------------------------------------------------------------------------- /blastdbs/contam_filter/VERSION: -------------------------------------------------------------------------------- 1 | 18.02 2 | -------------------------------------------------------------------------------- /blastdbs/contam_filter/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | mkdir -p binaries 5 | cd binaries 6 | wget -nc ftp://ftp.ncbi.nlm.nih.gov/blast/demo/vecscreen 7 | wget -nc ftp://ftp.ncbi.nlm.nih.gov/pub/kitts/VSlistTo1HitPerLine.awk 8 | 9 | mkdir -p ../databases 10 | cd ../databases 11 | wget -nc ftp://ftp.ncbi.nlm.nih.gov/pub/kitts/contam_in_euks.fa.gz 12 | wget -nc ftp://ftp.ncbi.nlm.nih.gov/pub/kitts/contam_in_prok.fa 13 | wget -nc ftp://ftp.ncbi.nlm.nih.gov/pub/kitts/adaptors_for_screening_euks.fa 14 | wget -nc ftp://ftp.ncbi.nlm.nih.gov/pub/kitts/adaptors_for_screening_proks.fa 15 | wget -nc ftp://ftp.ncbi.nlm.nih.gov/blast/db/FASTA/mito.nt.gz 16 | wget -nc ftp://ftp.ncbi.nlm.nih.gov/pub/kitts/rrna.gz 17 | wget -nc ftp://ftp.ncbi.nlm.nih.gov/pub/UniVec/UniVec 18 | cd .. 19 | 20 | USERNAME=ncbi 21 | IMAGE=blast_contamfilter 22 | VERSION=`cat VERSION` 23 | 24 | docker build -t $USERNAME/$IMAGE:$VERSION . 25 | docker tag $USERNAME/$IMAGE:$VERSION $USERNAME/$IMAGE:latest 26 | 27 | 28 | -------------------------------------------------------------------------------- /blastdbs/human_genomic/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/blast:18.02 as etl 2 | 3 | USER root 4 | WORKDIR /tarballs 5 | 6 | RUN apt-get -y -m update && apt-get install -y wget curl 7 | 8 | #COPY tarballs /tarballs 9 | RUN curl -s -l ftp://ftp.ncbi.nlm.nih.gov/blast/db/ | grep ^human_genomic\..*\.tar\.gz$ > tarfiles.txt 10 | RUN while read i; do wget -nc ftp://ftp.ncbi.nlm.nih.gov/blast/db/${i}; done < tarfiles.txt 11 | RUN while read i; do tar xvf ${i} -C ${BLASTDB}; done < tarfiles.txt 12 | 13 | FROM ncbi/blast:18.02 14 | 15 | COPY VERSION . 16 | 17 | USER root 18 | 19 | WORKDIR ${BLASTDB} 20 | 21 | # Do this to break the image into more managable layers. 22 | COPY --from=etl ${BLASTDB}/human_genomic.0[0-4].* ${BLASTDB}/ 23 | COPY --from=etl ${BLASTDB}/human_genomic.0[5-9].* ${BLASTDB}/ 24 | COPY --from=etl ${BLASTDB}/human_genomic.1[0-4].* ${BLASTDB}/ 25 | COPY --from=etl ${BLASTDB}/human_genomic.1[5-9].* ${BLASTDB}/ 26 | COPY --from=etl ${BLASTDB}/human_genomic.2[0-4].* ${BLASTDB}/ 27 | #COPY --from=etl ${BLASTDB}/human_genomic.2[5-9].* ${BLASTDB}/ 28 | 29 | CMD ["/bin/sh"] 30 | -------------------------------------------------------------------------------- /blastdbs/human_genomic/VERSION: -------------------------------------------------------------------------------- 1 | 18.02 2 | -------------------------------------------------------------------------------- /blastdbs/human_genomic/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #set -ex 3 | 4 | # mkdir -p tarballs 5 | # cd tarballs 6 | # files=`curl -s -l ftp://ftp.ncbi.nlm.nih.gov/blast/db/ | grep ^human_genomic\..*\.tar\.gz$` 7 | # for i in ${files}; do 8 | # wget -nc ftp://ftp.ncbi.nlm.nih.gov/blast/db/${i} 9 | # done 10 | # cd .. 11 | 12 | USERNAME=ncbi 13 | IMAGE=blast_human_genomic 14 | VERSION=`cat VERSION` 15 | 16 | docker build -t $USERNAME/$IMAGE:$VERSION . 17 | docker tag $USERNAME/$IMAGE:$VERSION $USERNAME/$IMAGE:latest 18 | -------------------------------------------------------------------------------- /edirect/.dockerignore: -------------------------------------------------------------------------------- 1 | VERSION 2 | build-image.sh 3 | README.md 4 | test.sh 5 | -------------------------------------------------------------------------------- /edirect/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | ARG version 4 | ARG username=docker 5 | ARG grpname=docker 6 | 7 | LABEL Description="NCBI EDirect" 8 | LABEL Vendor="NCBI/NLM/NIH" 9 | LABEL Version=${version} 10 | LABEL Maintainer=camacho@ncbi.nlm.nih.gov 11 | 12 | RUN apt-get -y -m update && \ 13 | apt-get install -y curl libxml-simple-perl libwww-perl libnet-perl build-essential && \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | RUN groupadd ${grpname} && \ 17 | useradd --no-log-init -r -g ${grpname} ${username} && \ 18 | mkdir -vp /home/${username} && \ 19 | chown -Rc ${username}:${grpname} /home/${username} 20 | 21 | USER ${username} 22 | WORKDIR /home/${username}/ 23 | 24 | RUN sh -c "$(curl -fsSL https://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/install-edirect.sh)" 25 | 26 | COPY --chown=${username}:${grpname} installconfirm /home/${username}/ 27 | 28 | ENV PATH="/home/${username}/edirect:${PATH}" 29 | ENV EMAIL=docker@ncbi.nlm.nih.gov 30 | 31 | CMD ["/bin/bash"] 32 | 33 | -------------------------------------------------------------------------------- /edirect/README.md: -------------------------------------------------------------------------------- 1 | # Official NCBI EDirect docker image 2 | 3 | [Entrez Direct](https://www.ncbi.nlm.nih.gov/books/NBK179288/) command line applications in a Docker image. 4 | 5 | ## Example usage 6 | 7 | ### Fetch a nucleotide sequence in FASTA format 8 | 9 | ```bash 10 | docker run --rm -it ncbi/edirect efetch -db nucleotide -id u00001 -format fasta 11 | docker run --rm -it ncbi/edirect /bin/sh -c " esearch -db nucleotide -query u00001 | efetch -format fasta" 12 | ``` 13 | 14 | ### Check installation 15 | 16 | `docker run --rm -it ncbi/edirect installconfirm` 17 | 18 | -------------------------------------------------------------------------------- /edirect/VERSION: -------------------------------------------------------------------------------- 1 | 20.6 2 | -------------------------------------------------------------------------------- /edirect/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | DOCKERHUB_USERNAME=${1:-"ncbi"} 4 | IMAGE=edirect 5 | VERSION=`cat VERSION` 6 | 7 | docker build --build-arg version=${VERSION} -t $DOCKERHUB_USERNAME/$IMAGE:$VERSION . 8 | docker tag $DOCKERHUB_USERNAME/$IMAGE:$VERSION $DOCKERHUB_USERNAME/$IMAGE:latest 9 | -------------------------------------------------------------------------------- /edirect/installconfirm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "***********************" 3 | echo "esearch version:" 4 | esearch -version 5 | echo "xtract version:" 6 | xtract -version 7 | echo "EDirect install status:" 8 | esearch -db pubmed -query "Babalobi OO[au] AND 2008[pdat]" | \ 9 | efetch -format xml | \ 10 | xtract -pattern Author -if Affiliation -contains Medicine \ 11 | -element Initials 12 | echo "***********************" 13 | -------------------------------------------------------------------------------- /edirect/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # test.sh: Perform some sanity checks on the edirect docker image 3 | # 4 | # Author: Christiam Camacho (camacho@ncbi.nlm.nih.gov) 5 | # Created: Fri 07 Dec 2018 03:45:23 PM EST 6 | IMG=${1:-"ncbi/edirect:latest"} 7 | docker run --rm -it ${IMG} ./installconfirm 8 | docker run --rm -it ${IMG} efetch -db nucleotide -id u00001 -format fasta 9 | -------------------------------------------------------------------------------- /hmmer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:17.10 as hmmerbuild 2 | 3 | ARG VERSION 4 | 5 | USER root 6 | WORKDIR /root/ 7 | 8 | 9 | RUN apt-get -y -m update && apt-get install -y build-essential wget 10 | 11 | RUN wget http://eddylab.org/software/hmmer3/3.1b2/hmmer-3.1b2.tar.gz 12 | RUN tar xvf hmmer-3.1b2.tar.gz 13 | 14 | 15 | WORKDIR /root/hmmer-3.1b2 16 | RUN ./configure --enable-portable-binary --prefix=/hmmer && make && make install 17 | WORKDIR easel 18 | RUN make install 19 | 20 | FROM ubuntu:17.10 21 | 22 | COPY VERSION . 23 | 24 | USER root 25 | COPY --from=hmmerbuild /hmmer/bin /hmmer/bin 26 | 27 | WORKDIR /hmmer/hmmerdb 28 | ENV HMMERDB=/hmmer/hmmerdb 29 | ENV PATH="/hmmer/bin:${PATH}" 30 | 31 | CMD ["/bin/bash"] 32 | 33 | -------------------------------------------------------------------------------- /hmmer/VERSION: -------------------------------------------------------------------------------- 1 | 18.02 -------------------------------------------------------------------------------- /hmmer/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | USERNAME=ncbi 4 | IMAGE=hmmer 5 | VERSION=`cat VERSION` 6 | 7 | docker build --build-arg VERSION=${VERSION} -t $USERNAME/$IMAGE:$VERSION . \ 8 | && docker tag $USERNAME/$IMAGE:$VERSION $USERNAME/$IMAGE:latest 9 | -------------------------------------------------------------------------------- /hmmerdbs/hmmer_amr/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/hmmer:18.02 2 | 3 | COPY VERSION . 4 | USER root 5 | 6 | WORKDIR ${HMMERDB} 7 | COPY AMR.LIB ${HMMERDB} 8 | 9 | CMD ["/bin/bash"] 10 | -------------------------------------------------------------------------------- /hmmerdbs/hmmer_amr/VERSION: -------------------------------------------------------------------------------- 1 | 18.02 -------------------------------------------------------------------------------- /hmmerdbs/hmmer_amr/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #set -ex 3 | 4 | wget -nc ftp://ftp.ncbi.nlm.nih.gov/pub/slottad/amr/AMR.LIB 5 | 6 | USERNAME=ncbi 7 | IMAGE=hmmer_amr 8 | VERSION=`cat VERSION` 9 | 10 | docker build -t $USERNAME/$IMAGE:$VERSION . 11 | docker tag $USERNAME/$IMAGE:$VERSION $USERNAME/$IMAGE:latest 12 | -------------------------------------------------------------------------------- /igblast/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | ARG version=1.22.0 3 | LABEL Description="NCBI IgBLAST" Vendor="NCBI/NLM/NIH" Version=${version} Maintainer=jianye@ncbi.nlm.nih.gov 4 | 5 | USER root 6 | RUN apt-get -y -m update && apt-get install -y curl libgomp1 libxml2-dev 7 | 8 | WORKDIR /usr/bin 9 | RUN ln -s python3 python 10 | 11 | WORKDIR / 12 | RUN curl -s ftp://ftp.ncbi.nih.gov/blast/executables/igblast/release/${version}/ncbi-igblast-${version}-x64-linux.tar.gz | tar zxf - 13 | 14 | env IGDATA=/ncbi-igblast-${version} 15 | env PATH "/ncbi-igblast-${version}/bin:${PATH}" 16 | 17 | CMD ["/bin/sh"] 18 | -------------------------------------------------------------------------------- /igblast/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/bash 2 | .PHONY: all clean build publish check 3 | 4 | USERNAME?=ncbi 5 | IMG=igblast 6 | VERSION?=1.22.0 7 | 8 | build: 9 | docker build --build-arg version=${VERSION} -t ${USERNAME}/${IMG}:${VERSION} . 10 | docker tag ${USERNAME}/${IMG}:${VERSION} ${USERNAME}/${IMG}:latest 11 | 12 | publish: build 13 | docker push ${USERNAME}/${IMG}:${VERSION} 14 | docker push ${USERNAME}/${IMG}:latest 15 | 16 | clean: 17 | docker image rm ${USERNAME}/${IMG} ${USERNAME}/${IMG}:${VERSION} 18 | 19 | check: 20 | docker run --rm ${USERNAME}/${IMG} igblastn -version 21 | -------------------------------------------------------------------------------- /igblast/README.md: -------------------------------------------------------------------------------- 1 | # NCBI IgBLAST docker image 2 | 3 | [NCBI IgBLAST][1] command line application in a Docker image. 4 | 5 | ## Running IgBLAST 6 | 7 | IgBLAST image can be run following standard docker methods. Some examples are shown below (assuming your image version is 1.21.0 and work directory 8 | has a folder named "database" that has the germline gene databases you want to search and a folder named "query" that has your query sequence file). 9 | 10 | 1. To run interactively, issue the command: 11 | ``` 12 | docker run -e IGDATA=/ncbi-igblast-1.21.0 -v $HOME/database:/d -v $HOME/query:/q -it ncbi/igblast 13 | ``` 14 | You will get a docker terminal like this: 15 | ``` 16 | root@27af8892c20b:/# 17 | ``` 18 | 19 | To run igblastn, simply issue: 20 | ``` 21 | igblastn -query /q/temp.query -germline_db_V /d/human_gl_V -germline_db_D /d/human_gl_D -germline_db_J /d/human_gl_J -show_translation -auxiliary_data optional_file/human_gl.aux -organism human 22 | ``` 23 | 24 | 2. You can also run the image directly as follows: 25 | ``` 26 | docker run -e IGDATA=/ncbi-igblast-1.21.0 -v $HOME/database:/d -v $HOME/query:/q ncbi/igblast igblastn -query /q/temp.query -germline_db_V /d/human_gl_V -germline_db_D /d/human_gl_D -germline_db_J /d/human_gl_J -show_translation -auxiliary_data optional_file/human_gl.aux -organism human 27 | ``` 28 | 29 | Note that this image contains only IgBLAST executable for Linux platform. The IgBLAST documentation is at https://ncbi.github.io/igblast/ 30 | 31 | ## Maintainer's notes 32 | 33 | A `Makefile` is provided to conveniently maintain this docker image. In the commands below, the value of `$X` represents the version of NCBI IgBLAST to base this image on. 34 | 35 | * `make build VERSION=$X`: builds the docker image 36 | * `make publish VERSION=$X`: publishes the image to Docker Hub 37 | * `make check`: performs a sanity check on the most recently built image 38 | 39 | [1]: https://pubmed.ncbi.nlm.nih.gov/23671333/ 40 | -------------------------------------------------------------------------------- /magicblast/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 as blastbuild 2 | ARG version=1.7.2 3 | ARG vdb_version=3.0.7 4 | ARG num_procs=8 5 | LABEL Description="NCBI MagicBLAST" Vendor="NCBI/NLM/NIH" Version=${version} Maintainer=boratyng@ncbi.nlm.nih.gov 6 | 7 | USER root 8 | WORKDIR /root/ 9 | 10 | RUN apt-get -y -m update && apt-get install -y build-essential curl wget libxml2-dev libgomp1 cmake && rm -rf /var/lib/apt/lists/* 11 | 12 | 13 | # Download and build ncbi-vdb 14 | RUN wget https://github.com/ncbi/ncbi-vdb/archive/refs/tags/${vdb_version}.tar.gz && \ 15 | tar xfz ${vdb_version}.tar.gz && rm ${vdb_version}.tar.gz && \ 16 | mv ncbi-vdb-${vdb_version} ncbi-vdb && \ 17 | cd ncbi-vdb && ./configure --prefix /root/vdb && make install -j ${num_proc} 18 | 19 | # Arrange ncbi-vdb libraries and header files in a form that C++ toolkit 20 | # build can consume them. 21 | ARG VDB=/root/VDB 22 | RUN mkdir -p ${VDB}/linux/release/x86_64/lib && \ 23 | cp -R /root/vdb/lib64/* ${VDB}/linux/release/x86_64/lib && \ 24 | mkdir -p ${VDB}/interfaces && cp -R /root/vdb/include/* ${VDB}/interfaces 25 | 26 | 27 | # Build Magic-BLAST 28 | RUN curl -s ftp://ftp.ncbi.nlm.nih.gov/blast/executables/magicblast/${version}/ncbi-magicblast-${version}-src.tar.gz | \ 29 | tar zxf - && \ 30 | cd ncbi-magicblast-${version}-src/c++ && \ 31 | ./configure --with-mt --with-strip --with-optimization --with-dll --with-experimental=Int8GI --with-flat-makefile --with-vdb=${VDB} --with-openmp --without-gnutls --without-gcrypt --without-zstd --without-lzo --prefix=/blast && \ 32 | cd ReleaseMT/build && \ 33 | make -j ${num_procs} -f Makefile.flat magicblast.exe makeblastdb.exe 34 | 35 | FROM ubuntu:22.04 36 | ARG version 37 | COPY VERSION . 38 | 39 | USER root 40 | WORKDIR /root/ 41 | 42 | RUN apt-get -y -m update && apt-get install -y libxml2-dev libgomp1 ca-certificates && \ 43 | rm -rf /var/lib/apt/lists/* 44 | 45 | RUN mkdir -p /blast/bin /blast/lib 46 | 47 | COPY --from=blastbuild /root/ncbi-magicblast-${version}-src/c++/ReleaseMT/lib /blast/lib 48 | COPY --from=blastbuild /root/VDB/linux/release/x86_64/lib /blast/lib 49 | COPY --from=blastbuild /root/ncbi-magicblast-${version}-src/c++/ReleaseMT/bin /blast/bin 50 | 51 | RUN mkdir -p /blast/blastdb /blast/blastdb_custom 52 | RUN sed -i '$ a BLASTDB=/blast/blastdb:/blast/blastdb_custom' /etc/environment 53 | ENV BLASTDB /blast/blastdb:/blast/blastdb_custom 54 | ENV PATH "/blast/bin:${PATH}" 55 | 56 | WORKDIR /blast 57 | 58 | CMD ["/bin/bash"] 59 | 60 | -------------------------------------------------------------------------------- /magicblast/README.md: -------------------------------------------------------------------------------- 1 | # NCBI MagicBLAST docker image 2 | 3 | [NCBI MagicBLAST][1] command line application in a Docker image. 4 | 5 | # Usage instructions 6 | 7 | You may run the MagicBLAST docker image in a few different ways. The simplest is the interactive mode, which simply executes a command and exits, and this is ideal if MagicBLAST is executed only once. Running in detached mode is a two step process. First, you start the MagicBLAST docker image, giving it a name and specifying the directories containing your queries, databases etc. and how they map to the directory structure inside the docker image. Second, you execute your command specifying the name of your detached image. Examples are below. 8 | 9 | ### Interactive command: 10 | 11 | `docker run --rm -it -v $BLASTDB:/blast/blastdb ncbi/magicblast magicblast -version` 12 | 13 | ### Starting Detached mode: 14 | 15 | ``` bash 16 | docker run --rm -d --name mblast \ 17 | -v $BLASTDB:/blast/blastdb:ro -v $HOME/blastdb_custom:/blast/blastdb_custom:ro \ 18 | -v $HOME/queries:/blast/queries:ro \ 19 | -v $HOME/results:/blast/results:rw \ 20 | ncbi/magicblast sleep infinity 21 | ``` 22 | 23 | ### Check that it is running: 24 | ``` bash 25 | docker ps 26 | ``` 27 | 28 | ### Running search with detached docker: 29 | 30 | ``` bash 31 | docker exec mblast magicblast -db GCF_000001405.38_top_level \ 32 | -sra DRR138536 -out /blast/results/DRR138536.tab -num_threads 8 33 | ``` 34 | 35 | The above command will align the reads in https://www.ncbi.nlm.nih.gov/sra/DRR138536 to GCF_000001405.38_top_level (human genome) using eight threads. This command assumes that the human database has been downloaded to $BLASTDB, or that remote fuser will perform the download for you, and that a detached image with the name "mblast" has been started. This also assumes that your machine has the directory structure suggested at https://github.com/ncbi/docker/blob/master/blast/README.md 36 | 37 | Please note that this docker image contains only the magicblast executable. The blast-workbench container (see https://github.com/ncbi/docker/blob/master/blast-workbench/README.md) hosts magicblast as well as utilities to update databases, fetch lists of taxids or make BLAST databases. 38 | 39 | The magicBLAST documentaton is at https://ncbi.github.io/magicblast/ 40 | 41 | [1]: https://www.ncbi.nlm.nih.gov/pubmed/31345161 42 | -------------------------------------------------------------------------------- /magicblast/VDB_VERSION: -------------------------------------------------------------------------------- 1 | 3.0.7 2 | -------------------------------------------------------------------------------- /magicblast/VERSION: -------------------------------------------------------------------------------- 1 | 1.7.2 2 | -------------------------------------------------------------------------------- /magicblast/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -xe 2 | 3 | USERNAME=ncbi 4 | IMAGE=magicblast 5 | VERSION=`cat VERSION` 6 | # Check the latest ncbi-vdb release version in https://github.com/ncbi/ncbi-vdb/tags 7 | # To see which VDB version is currently used by C++ Toolkit do: 8 | # grep local_vdb_base src/build-system/config.site.ncbi 9 | VDB_VERSION=`cat VDB_VERSION` 10 | NP=`grep -c proc /proc/cpuinfo` 11 | 12 | docker build --build-arg num_procs=${NP} --build-arg version=${VERSION} --build-arg vdb_version=${VDB_VERSION} -t $USERNAME/$IMAGE:$VERSION . 13 | docker tag $USERNAME/$IMAGE:$VERSION $USERNAME/$IMAGE:latest 14 | -------------------------------------------------------------------------------- /magicblast/test-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -xe 2 | 3 | mkdir -p db 4 | echo NZ_DS499579.1 >db/subject 5 | docker run --rm -v $(pwd)/db:/blast/blastdb:rw \ 6 | -v /etc/ssl/certs:/etc/ssl/certs:ro \ 7 | ncbi/magicblast magicblast -sra SRR000066 \ 8 | -subject /blast/blastdb/subject -out /blast/blastdb/out.sam 9 | 10 | -------------------------------------------------------------------------------- /ncbi-workbench/.dockerignore: -------------------------------------------------------------------------------- 1 | *.log 2 | test.sh 3 | -------------------------------------------------------------------------------- /ncbi-workbench/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ncbi/sra-toolkit as srat 2 | FROM ncbi/blast-workbench 3 | 4 | LABEL Description="NCBI tools" \ 5 | Vendor="NCBI/NLM/NIH" \ 6 | URL="https://www.ncbi.nlm.nih.gov" \ 7 | Maintainer=camacho@ncbi.nlm.nih.gov 8 | 9 | COPY --from=srat /usr/local/ncbi/sra-toolkit /usr/local/ncbi/sra-toolkit 10 | RUN apt-get -y -m update && apt-get install -y \ 11 | libidn11 fuse && \ 12 | rm -rf /var/lib/apt/lists/* 13 | 14 | ENV PATH "/usr/local/ncbi/sra-toolkit/bin:${PATH}" 15 | ENV BLASTDB "/blast/blastdb:/blast/blastdb_custom" 16 | CMD ["/bin/bash"] 17 | -------------------------------------------------------------------------------- /ncbi-workbench/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for building a container with NCBI tools 2 | # 3 | # Author: Christiam Camacho (camacho@ncbi.nlm.nih.gov) 4 | # Created: Wed 12 Dec 2018 05:06:03 PM EST 5 | 6 | SHELL=/bin/bash 7 | .PHONY: all clean build-gcp build-ncbi publish 8 | 9 | USERNAME?=ncbi 10 | IMG=workbench 11 | VERSION?=0.3 12 | 13 | build: 14 | docker build --build-arg version=${VERSION} -t ${USERNAME}/${IMG}:${VERSION} . 15 | docker tag ${USERNAME}/${IMG}:${VERSION} ${USERNAME}/${IMG}:latest 16 | 17 | publish: build 18 | docker push ${USERNAME}/${IMG}:${VERSION} 19 | docker push ${USERNAME}/${IMG}:latest 20 | 21 | clean: 22 | docker image rm ${USERNAME}/${IMG} ${USERNAME}/${IMG}:${VERSION} 23 | 24 | check: 25 | ./test.sh ${USERNAME}/${IMG}:${VERSION} 26 | -------------------------------------------------------------------------------- /ncbi-workbench/README.md: -------------------------------------------------------------------------------- 1 | # ncbi-workbench 2 | 3 | This (experimental) Docker image contains the latest versions of the following [NCBI][1] software: 4 | 5 | * [BLAST+][blast_man] command line applications 6 | * [MagicBLAST][mb_doc] 7 | * [EDirect][edir_doc] 8 | * [SRA Toolkit][srat_doc] 9 | 10 | # How to use this image? 11 | 12 | ## How to run BLAST? 13 | 14 | Please see the [NCBI BLAST+ Docker image documentation][blast_docker] and replace `ncbi/blast` with 15 | `ncbi/workbench`. 16 | 17 | ## How to run EDirect? 18 | 19 | ```bash 20 | docker run --rm \ 21 | -v $HOME/queries:/blast/queries:rw \ 22 | ncbi/workbench \ 23 | sh -c 'efetch -db protein -id NP_002377 -format fasta > /blast/queries/NP_002377.fsa' 24 | ``` 25 | 26 | You can verify the results of this command on the local host as follows: 27 | 28 | `ls -l $HOME/queries` 29 | 30 | The [test.sh](./test.sh) script shows some additional sample commands. 31 | 32 | ## How to run SRA toolkit tools? 33 | 34 | ```bash 35 | docker run --rm -it ncbi/workbench fastq-dump --stdout SRR390728 | head -n 8 36 | ``` 37 | 38 | ## Maintainer's notes 39 | 40 | A `Makefile` is provided to conveniently maintain this docker image. It 41 | contains the variables `USERNAME` and `VERSION` which can be configured 42 | at runtime to faciliate maintenance, e.g.: 43 | 44 | * `make build VERSION=0.2`: builds the docker image and tags it with version `0.2` and `latest` 45 | * `make publish USERNAME=ronaldo`: publishes the image to Docker Hub under the name `ronaldo/workbench` 46 | * `make check`: performs a sanity check on the most recently built image using default values (e.g.: `ncbi/workbench`) 47 | 48 | 49 | [1]: https://www.ncbi.nlm.nih.gov 50 | [blast_man]: https://www.ncbi.nlm.nih.gov/books/NBK279690/ 51 | [mb_doc]: https://ncbi.github.io/magicblast/ 52 | [edir_doc]: https://dataguide.nlm.nih.gov/edirect/documentation.html 53 | [srat_doc]: https://github.com/ncbi/sra-tools/wiki 54 | [blast_docker]: https://github.com/ncbi/docker/blob/master/blast/README.md 55 | 56 | -------------------------------------------------------------------------------- /ncbi-workbench/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | # test.sh: simple test script 3 | # 4 | # Author: Christiam Camacho (camacho@ncbi.nlm.nih.gov) 5 | # Created: Wed 12 Dec 2018 05:12:29 PM EST 6 | 7 | IMG=${1:-"ncbi/workbench:latest"} 8 | 9 | time docker run --rm ${IMG} /bin/bash -c "printenv BLASTDB" 10 | time docker run --rm ${IMG} blastn -version 11 | time docker run --rm ${IMG} magicblast -version 12 | time docker run --rm ${IMG} installconfirm 13 | time docker run --rm ${IMG} efetch -db nucleotide -id u00001 -format fasta 14 | time docker run --rm ${IMG} get_species_taxids.sh -n squirrel 15 | time docker run --rm ${IMG} update_blastdb.pl --decompress taxdb 16 | time docker run --rm ${IMG} update_blastdb.pl taxdb --source gcp 17 | time docker run --rm ${IMG} fastq-dump --stdout SRR390728 | head -n 8 18 | -------------------------------------------------------------------------------- /pgap-standalone/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PGAP_VERSION 2 | #FROM ncbi/pgap:${PGAP_VERSION} as pgtemp 3 | FROM ubuntu:latest as pgtemp 4 | 5 | USER root 6 | 7 | WORKDIR /pgap 8 | 9 | COPY *.tar.gz /pgap 10 | 11 | RUN tar -xv --strip-components=1 -f *.tar.gz 12 | RUN rm *.tar.gz 13 | RUN rm -rf .git* 14 | #RUN rm -rf pgap-${PGAP_VERSION}/.git* 15 | #RUN mv pgap-${PGAP_VERSION}/* . 16 | #RUN rmdir pgap-${PGAP_VERSION} 17 | 18 | # COPY input*.tgz /pgap 19 | # RUN tar xvf input-${PGAP_VERSION}.tgz 20 | # RUN rm input-${PGAP_VERSION}.tgz 21 | 22 | FROM ncbi/pgap:${PGAP_VERSION} 23 | 24 | COPY --from=pgtemp /pgap /pgap/. 25 | 26 | USER root 27 | 28 | WORKDIR /pgap 29 | 30 | RUN echo "ip_resolve=4" >> /etc/yum.conf 31 | RUN yum -y update && yum -y install yum-utils && yum -y groupinstall development 32 | RUN yum -y install https://centos7.iuscommunity.org/ius-release.rpm 33 | RUN yum -y install python36u python36u-pip python36u-devel nodejs 34 | RUN pip3.6 install -U cwltool[deps] PyYAML cwlref-runner 35 | 36 | RUN cat input.yaml MG37/input.yaml > mg37_input.yaml 37 | RUN mkdir /pgap/input 38 | 39 | CMD ["/bin/sh"] 40 | -------------------------------------------------------------------------------- /pgap-standalone/VERSION: -------------------------------------------------------------------------------- 1 | 2018-09-18.build3030 2 | -------------------------------------------------------------------------------- /pgap-standalone/build-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | USERNAME=ncbi 5 | IMAGE=pgap-standalone 6 | VERSION=`cat VERSION` 7 | 8 | docker build --build-arg PGAP_VERSION="${VERSION}" -t $USERNAME/$IMAGE:$VERSION . 9 | docker tag $USERNAME/$IMAGE:$VERSION $USERNAME/$IMAGE:latest 10 | -------------------------------------------------------------------------------- /pgap-standalone/fetch_files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | VERSION=`cat VERSION` 5 | curl -O https://github.com/ncbi/pgap/archive/${VERSION}-beta.tar.gz 6 | curl -O https://s3.amazonaws.com/pgap-data/input-${VERSION}.tgz 7 | -------------------------------------------------------------------------------- /sra-toolkit/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | LABEL Description="NCBI SRA toolkit" \ 3 | Vendor="NCBI/NLM/NIH" \ 4 | URL="https://github.com/ncbi/sra-tools" \ 5 | Maintainer=camacho@ncbi.nlm.nih.gov 6 | ARG version 7 | 8 | USER root 9 | WORKDIR /tmp 10 | 11 | RUN apt-get -y -m update && \ 12 | apt-get install -y \ 13 | libidn11 fuse libxml2-dev \ 14 | curl && \ 15 | rm -rf /var/lib/apt/lists/* 16 | 17 | RUN mkdir -p /usr/local/ncbi/sra-toolkit 18 | WORKDIR /usr/local/ncbi/sra-toolkit 19 | RUN curl -s https://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/${version}/sratoolkit.${version}-ubuntu64.tar.gz | \ 20 | tar zxf - --strip-components=1 21 | 22 | ENV PATH="/usr/local/ncbi/sra-toolkit/bin:${PATH}" 23 | WORKDIR /tmp 24 | CMD ["/bin/bash"] 25 | -------------------------------------------------------------------------------- /sra-toolkit/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for building a container with the NCBI SRA toolkit 2 | # 3 | # Author: Christiam Camacho (camacho@ncbi.nlm.nih.gov) 4 | # Created: Mon 03 Dec 2018 07:49:37 PM EST 5 | 6 | SHELL=/bin/bash 7 | .PHONY: all clean build-gcp build-ncbi publish 8 | 9 | USERNAME?=ncbi 10 | IMG=sra-toolkit 11 | VERSION?=2.9.2 12 | 13 | build: 14 | docker build --build-arg version=${VERSION} -t ${USERNAME}/${IMG}:${VERSION} . 15 | docker tag ${USERNAME}/${IMG}:${VERSION} ${USERNAME}/${IMG}:latest 16 | 17 | publish: build 18 | docker push ${USERNAME}/${IMG}:${VERSION} 19 | docker push ${USERNAME}/${IMG}:latest 20 | 21 | clean: 22 | docker image rm ${USERNAME}/${IMG} ${USERNAME}/${IMG}:${VERSION} 23 | 24 | check: 25 | docker run --rm -ti ${USERNAME}/${IMG} fastq-dump --stdout SRR390728 | head -n 8 26 | -------------------------------------------------------------------------------- /sra-toolkit/README.md: -------------------------------------------------------------------------------- 1 | # Docker container for NCBI SRA toolkit 2 | 3 | ## Maintainer's notes 4 | 5 | A `Makefile` is provided to conveniently maintain this docker image. In the commands below, the value of `$X` represents the version of the SRA toolkit to base this image on. 6 | 7 | * `make build VERSION=$X`: builds the docker image 8 | * `make publish VERSION=$X`: publishes the image to Docker Hub 9 | * `make check`: performs a sanity check on the most recently built image 10 | -------------------------------------------------------------------------------- /utils/docker_clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker rm $(docker ps -a -q -f status=exited) 3 | docker rmi $(docker images -f "dangling=true" -q) 4 | --------------------------------------------------------------------------------