Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding resfinder version 4.6.0 #1229

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ To learn more about the docker pull rate limits and the open source software pro
| [RAxML](https://hub.docker.com/r/staphb/raxml/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/raxml)](https://hub.docker.com/r/staphb/raxml) | <ul><li>8.2.12</li><li>[8.2.13](./raxml/8.2.13/)</li></ul> | https://github.com/stamatak/standard-RAxML |
| [RAxML-NG](https://hub.docker.com/r/staphb/raxml-ng/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/raxml-ng)](https://hub.docker.com/r/staphb/raxml-ng) | <ul><li>[1.2.2](./raxml-ng/1.2.2/)</li></ul> | https://github.com/amkozlov/raxml-ng |
| [rdp](https://hub.docker.com/r/staphb/rdp) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/rdp)](https://hub.docker.com/r/staphb/rdp) | <ul><li>[2.14](./rdp/0.4.0/)</li></ul> | https://sourceforge.net/projects/rdp-classifier/files/rdp-classifier/rdp_classifier_2.14.zip/download |
| [ResFinder](https://hub.docker.com/r/staphb/resfinder/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/resfinder)](https://hub.docker.com/r/staphb/resfinder) | <ul><li>[4.1.1](./resfinder/4.1.11/)</li><li>[4.5.0](./resfinder/4.5.0/)</li></ul> | https://bitbucket.org/genomicepidemiology/resfinder/src/master/ |
| [ResFinder](https://hub.docker.com/r/staphb/resfinder/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/resfinder)](https://hub.docker.com/r/staphb/resfinder) | <ul><li>[4.1.1](./build-files/resfinder/4.1.11/)</li><li>[4.5.0](./build-files/resfinder/4.5.0/)</li><li>[4.6.0](./build-files/resfinder/4.6.0/)</li></ul> | https://bitbucket.org/genomicepidemiology/resfinder/src/master/ |
| [Roary](https://hub.docker.com/r/staphb/roary/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/roary)](https://hub.docker.com/r/staphb/roary) | <ul><li>3.12.0</li><li>3.13.0</li></ul> | https://github.com/sanger-pathogens/Roary |
| [SalmID](https://hub.docker.com/r/staphb/salmid) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/salmid)](https://hub.docker.com/r/staphb/salmid) | <ul><li>0.1.23</li></ul> | https://github.com/hcdenbakker/SalmID |
| [samclip](https://hub.docker.com/r/staphb/samclip) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/samclip)](https://hub.docker.com/r/staphb/samclip) | <ul><li>[0.4.0](./samclip/0.4.0/)</li></ul>| https://github.com/tseemann/samclip |
Expand Down
164 changes: 164 additions & 0 deletions build-files/resfinder/4.6.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
ARG RESFINDER_VER="4.6.0"

FROM ubuntu:jammy AS app

# ARG sets environment variables during the build stage
ARG RESFINDER_VER
ARG KMA_VER="1.4.18"

# Database may not be properly versioned, but using a version tag here (2024-08-06)
# see here: https://bitbucket.org/genomicepidemiology/resfinder_db/downloads/?tab=tags
ARG RESFINDER_DB_COMMIT_HASH="2.4.0"

# Database may not be properly versioned, but using a version tag here (2024-08-08)
# see here: https://bitbucket.org/genomicepidemiology/pointfinder_db/downloads/?tab=tags
ARG POINTFINDER_DB_COMMIT_HASH="4.1.1"

# Database may not be properly versioned, but using a version tag here (2023-05-31)
# see here: https://bitbucket.org/genomicepidemiology/disinfinder_db/downloads/?tab=tags
ARG DISINFINDER_DB_COMMIT_HASH="2.0.1"

# LABEL instructions tag the image with metadata that might be important to the user
# Optional, but highly recommended
LABEL base.image="ubuntu:jammy"
LABEL dockerfile.version="1"
LABEL software="resfinder"
LABEL software.version=${RESFINDER_VER}
LABEL description="Identifies acquired resistance genes and point mutations in total or partial sequenced isolates of bacteria."
LABEL website="https://bitbucket.org/genomicepidemiology/resfinder/src/master/"
LABEL license="https://bitbucket.org/genomicepidemiology/resfinder/src/master/README.md"
LABEL maintainer="Curtis Kapsak"
LABEL maintainer.email="kapsakcj@gmail.com"

# so that apt doesn't ask for a region during apt install step
ARG DEBIAN_FRONTEND noninteractive

# install dependencies; cleanup apt garbage
# ncbi-blast+ 2.12.0+ds-3build1 (ubuntu:jammy)
# python3 v3.10
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
ca-certificates \
procps \
git \
ncbi-blast+ \
python3 \
python3-pip \
python3-setuptools \
python3-dev \
gcc \
make \
libz-dev \
unzip && \
apt-get autoclean && rm -rf /var/lib/apt/lists/*

# Install resfinder ()
# It is no longer recommended to clone the ResFinder bitbucket repository unless you plan to do development work on ResFinder.
# Instead we recommend installing ResFinder using pip...
# https://bitbucket.org/genomicepidemiology/resfinder/src/master/ 2024-03-21
RUN pip3 install --no-cache-dir resfinder==${RESFINDER_VER} && \
mkdir /data

# Install kma
RUN git clone --branch ${KMA_VER} --depth 1 https://bitbucket.org/genomicepidemiology/kma.git && \
cd kma && \
make && \
mv -v kma* /usr/local/bin/

# pointfinder database install
RUN mkdir /pointfinder_db && \
git clone --branch ${POINTFINDER_DB_COMMIT_HASH} --depth 1 https://git@bitbucket.org/genomicepidemiology/pointfinder_db.git /pointfinder_db && \
cd /pointfinder_db && \
python3 INSTALL.py /usr/local/bin/kma_index non_interactive

# resfinder database install
RUN mkdir /resfinder_db && \
git clone --branch ${RESFINDER_DB_COMMIT_HASH} --depth 1 https://git@bitbucket.org/genomicepidemiology/resfinder_db.git /resfinder_db && \
cd /resfinder_db && \
python3 INSTALL.py /usr/local/bin/kma_index non_interactive

# disinfinder database install
RUN mkdir /disinfinder_db && \
git clone --branch ${DISINFINDER_DB_COMMIT_HASH} --depth 1 https://git@bitbucket.org/genomicepidemiology/disinfinder_db.git /disinfinder_db && \
cd /disinfinder_db && \
python3 INSTALL.py /usr/local/bin/kma_index non_interactive

# so that run_resfinder.py is in the PATH
ENV PATH="${PATH}" \
# specifying database locations
CGE_RESFINDER_RESGENE_DB="/resfinder_db" \
CGE_RESFINDER_RESPOINT_DB="/pointfinder_db" \
CGE_DISINFINDER_DB="/disinfinder_db"

# setting a janky alias for everyone that uses the "latest" tag
RUN echo -e '#!/bin/bash\npython3 -m resfinder "$@"' > /usr/bin/run_resfinder.py && \
chmod +x /usr/bin/run_resfinder.py

CMD python3 -m resfinder -h

WORKDIR /data

FROM app AS test

ARG RESFINDER_VER

# checking suggested usage and alias
RUN python3 -m resfinder -h && run_resfinder.py --help

WORKDIR /test

# getting test files
RUN git clone --branch ${RESFINDER_VER} --depth 1 https://git@bitbucket.org/genomicepidemiology/resfinder.git

##### short description of included test files #####
### test files for typical gene detection (or lack thereof)
# test_isolate_01.fa fasta header ">test_isolate_01 blaB-2_1_AF189300"
# test_isolate_02.fa fasta header ">test_isolate_02 blaCTX-M-33_1_AY238472"
# test_isolate_03.fa fasta header ">test_isolate_03 no_res"

### test FASTA files for point mutation detection
# test_isolate_05.fa fasta header ">test_isolate_05 gyrA_mut
# test_isolate_09a.fa fasta header ">gyrA_G81D_GGT241GAT"
# test_isolate_09b.fa fasta header ">gyrA_G81D_GAT_D82G_GGC"

# test fastq files are also available for isolates 01, 05, 09a, and 09b. They are used to test KMA's functionality

# run resfinder on supplied fasta files for gene detection (-acq for acquired genes, NOT point mutations)
RUN echo "TESTING RESFINDER ON SUPPLIED FASTA FILES FOR ACQUIRED GENES" && \
for ISOLATE in 01 02 03; do \
python3 -m resfinder -ifa /test/resfinder/tests/data/test_isolate_${ISOLATE}.fa -o test_resfinder_fastaInput_isolate_${ISOLATE} -acq -l 0.9 -t 0.9; \
done && \
ls test_resfinder_fastaInput_*

# run resfinder on supplied fastq files for gene detection (-acq for acquired genes, and -c -s "Escherichia coli" for point mutations)
RUN echo "TESTING RESFINDER ON SUPPLIED FASTQ FILES FOR ACQUIRED GENES AND POINT MUTATIONS" && \
for ISOLATE in 01 05 09a 09b ; do \
python3 -m resfinder -ifq /test/resfinder/tests/data/test_isolate_${ISOLATE}_1.fq /test/resfinder/tests/data/test_isolate_${ISOLATE}_2.fq \
-o test_resfinder_fastqInput_isolate_${ISOLATE} \
-acq -l 0.9 -t 0.9\
-c -s "Escherichia coli"; \
done && \
ls test_resfinder_fastqInput_*

# run resfinder on supplied fasta files for point mutation detection (-c and --species for point mutations, NOT acquired resistance genes)
RUN echo "TESTING RESFINDER ON SUPPLIED FASTA FILES FOR POINT MUTAITON DETECTION" && \
for ISOLATE in 05 09a 09b ; do \
python3 -m resfinder -ifa /test/resfinder/tests/data/test_isolate_${ISOLATE}.fa -o test_pointfinder_fastaInput_isolate_${ISOLATE} -c --species "Escherichia coli"; \
done && \
ls test_pointfinder*

# look for expected outputs in resulting files; grep exits 1 if term is not found, meaning test layer will not build properly
RUN echo "FASTA INPUTS, SEARCHING FOR EXPECTED (RESFINDER) OUTPUTS:" && \
grep 'blaB-2' test_resfinder_fastaInput_isolate_01/ResFinder_results_tab.txt && \
grep 'blaCTX' test_resfinder_fastaInput_isolate_02/ResFinder_results_tab.txt && \
grep -B 1 'No hit found' test_resfinder_fastaInput_isolate_03/ResFinder_results_table.txt && \
echo "FASTQ INPUT TESTS, SEARCHING FOR EXPECTED (POINTFINDER AND RESFINDER) OUTPUTS:" && \
grep "blaB-2" test_resfinder_fastqInput_isolate_01/ResFinder_results_tab.txt && \
grep "gyrA p.S83A" test_resfinder_fastqInput_isolate_05/PointFinder_table.txt && \
grep "gyrA p.G81D" test_resfinder_fastqInput_isolate_09a/PointFinder_table.txt && \
grep "gyrA p.G81D" test_resfinder_fastqInput_isolate_09b/PointFinder_table.txt && \
echo "FASTA INPUTS, SEARCHING FOR EXPECTED (POINTFINDER) OUTPUTS:" && \
grep "gyrA p.S83A" test_pointfinder_fastaInput_isolate_05/PointFinder_table.txt && \
grep "gyrA p.G81D" test_pointfinder_fastaInput_isolate_09a/PointFinder_table.txt && \
grep "gyrA p.G81D" test_pointfinder_fastaInput_isolate_09b/PointFinder_table.txt && \
grep "gyrA p.D82G" test_pointfinder_fastaInput_isolate_09b/PointFinder_table.txt
35 changes: 35 additions & 0 deletions build-files/resfinder/4.6.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# ResFinder container

Main tool : [ResFinder](https://bitbucket.org/genomicepidemiology/resfinder/src/master/)

Additional tools:

- kma 1.4.17
- ResFinder database 2.4.0
- PointFinder database 4.1.1
- DisinFinder database 2.0.1

Alternatively available as a webtool here: https://cge.cbs.dtu.dk/services/ResFinder/

Full documentation: https://bitbucket.org/genomicepidemiology/resfinder/src/master/

ResFinder identifies acquired genes and/or finds chromosomal mutations mediating antimicrobial resistance in total or partial DNA sequence of bacteria.

WARNING : The executable has changed!

## Example Usage

```bash
# run ResFinder on raw reads (FASTQs)
python3 -m resfinder -ifq /data/sample_1.fastq /data/sample_2.fastq \
-o /data/resfinder-results-fastq-input \
-acq -l 0.9 -t 0.9 \
-c -s "Escherichia coli"

# run ResFinder on assembly FASTA
python3 -m resfinder -ifa /data/sample.fasta \
-o /data/resfinder-results-fasta-input \
-c \
-acq -l 0.9 -t 0.9 \
--species "Escherichia coli" \
```
Loading