Skip to content

Conversation

@erinyoung
Copy link
Contributor

There's a new version of abricate!

According to the release notes the database links are fixed and there are some new options.

Closes #1508

I copied the files from a prior version and updated the abricate version. I also updated the base image, added a CMD line, fixed the tests, and some other changes.

Also attached to this PR is a github action that will rebuild this image every month with whatever links abricate uses to download the databases.

The full diff:

$ diff build-files/abricate/{1.0.1-A*,1.2.0}/Dockerfile
1c1
< ARG ABRICATE_VER="1.0.1"
---
> ARG ABRICATE_VER="1.2.0"
3c3
< FROM ubuntu:focal as app
---
> FROM ubuntu:noble AS app
7c7
< ARG ANY2FASTA_VERSION="0.4.2"
---
> ARG ANY2FASTA_VERSION="0.8.1"
9c9
< LABEL base.image="ubuntu:focal"
---
> LABEL base.image="ubuntu:noble"
12c12
< LABEL software.version="1.0.1"
---
> LABEL software.version="${ABRICATE_VER}"
17a18,19
> LABEL maintainer2="Inês Mendes"
> LABEL maintainer2.email="[email protected]"
42,44c44,45
<   cd any2fasta-${ANY2FASTA_VERSION} && \
<   chmod +x any2fasta && \
<   cp any2fasta /usr/local/bin
---
>   cd /any2fasta-${ANY2FASTA_VERSION} && \
>   chmod +x any2fasta
50,51c51
<   mkdir /data && \
<   /abricate-${ABRICATE_VER}/bin/abricate --check
---
>   mkdir /data
55,56c55
< ENV PATH="/abricate-${ABRICATE_VER}/bin:\
< $PATH"\
---
> ENV PATH="/abricate-${ABRICATE_VER}/bin:/any2fasta-${ANY2FASTA_VERSION}:$PATH"\
59,64c58,59
< # add custom database; rename FASTA file as 'sequences'; index database with --setupdb
< ADD AcinetobacterPlasmidTyping.fasta /
< RUN mkdir -v /abricate-${ABRICATE_VER}/db/AcinetobacterPlasmidTyping && \
<   cp -v /AcinetobacterPlasmidTyping.fasta /abricate-${ABRICATE_VER}/db/AcinetobacterPlasmidTyping/sequences && \
<   abricate --setupdb && \
<   abricate --list
---
> # set up default databases
> RUN abricate --setupdb
70c65,69
< FROM app as test
---
> FROM app AS test
> 
> # Grab test Vcholerae genome, uncompress, and save to /data
> RUN wget -O - https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/018/083/565/GCA_018083565.2_PDT000793508.2/GCA_018083565.2_PDT000793508.2_genomic.fna.gz \
>   | gunzip -c > /data/GCA_018083565.2_PDT000793508.2_genomic.fna
78c77
< # tests shamelessly stolen and modified from: https://github.com/tseemann/abricate/blob/master/.travis.yml
---
> # tests shamelessly stolen and modified from: https://github.com/tseemann/abricate/blob/master/.github/workflows/ci.yml
80,104c79,106
< cd /abricate-${ABRICATE_VER}/ && \
< abricate --version && \
< abricate --help && \
< abricate --check && \
< abricate --list && \
< ! abricate --doesnotexist  && \
< ! abricate --threads 0 && \
< ! (abricate test/assembly.fa | grep '~~~') && \
< abricate test/assembly.fa > 1.tab && \
< abricate test/assembly.fa.gz > 2.tab && \
< abricate test/assembly.gbk > 3.tab && \
< abricate test/assembly.gbk.gz > 4.tab && \
< abricate --nopath test/assembly.gbk.gz | grep '^assembly.gbk.gz' && \
< abricate --summary {1,2,3,4}.tab > summary.tab && \
< abricate --summary 1.tab 2.tab 1.tab 2>&1 | grep 'duplicate' && \
< abricate --summary <(cat 1.tab 2.tab 3.tab) | wc -l | grep -w 4 && \
< abricate test/assembly.txt |& grep ERROR && \
< abricate not_exist.embl |& grep ERROR && \
< abricate --threads `nproc` test/assembly.fa.bz2 | grep -i FOSFOMYCIN && \
< abricate --threads `nproc` test/assembly.fa.bz2 | grep -i lactam && \
< for DB in `abricate --list | cut -f1 | tail -n +2`; do abricate --db ${DB} test/assembly.fa > /dev/null ; done && \
< abricate-get_db --help && \
< abricate-get_db --db ncbi --dbdir . && \
< ! grep 'FUSIDIC ACID' ncbi/sequences && \
< abricate --threads `nproc` --fofn test/fofn.txt
\ No newline at end of file
---
>   cd /abricate-${ABRICATE_VER}/ && \
>   abricate --setupdb
>   abricate --version
>   abricate --help
>   abricate --check
>   abricate --list
>   ! abricate --doesnotexist || echo "fail expected"
>   ! abricate --threads 0
>   ! (abricate test/assembly.fa | grep '~~~')
>   abricate test/assembly.fa > 1.tab
>   abricate test/assembly.fa.gz > 2.tab
>   abricate test/assembly.gbk > 3.tab
>   abricate test/assembly.gbk.gz > 4.tab
>   abricate --nopath test/assembly.gbk.gz | grep '^assembly.gbk.gz'
>   abricate --summary {1,2,3,4}.tab > summary.tab
>   abricate --summary 1.tab 2.tab 1.tab |& grep 'duplicate'
>   abricate --summary <(cat 1.tab 2.tab 3.tab) | wc -l | grep -w 4
>   abricate test/assembly.txt |& grep ERROR
>   abricate not_exist.embl |& grep ERROR
>   abricate --threads `nproc` test/assembly.fa.bz2 | grep -i FOSFOMYCIN
>   abricate --threads `nproc` test/assembly.fa.bz2 | grep -i lactam
>   for DB in `abricate --list | cut -f1 | tail -n +2`; do abricate --db $DB test/assembly.fa > /dev/null ; done
>   abricate-get_db --help
>   abricate-get_db --db ncbi --dbdir .
>   ! grep 'FUSIDIC ACID' ncbi/sequences
>   abricate --threads `nproc` --fofn test/fofn.txt
> 
> RUN abricate --list
\ No newline at end of file

Pull Request (PR) checklist:

  • Include a description of what is in this pull request in this message.
  • The dockerfile successfully builds to a test target for the user creating the PR. (i.e. docker build --tag samtools:1.15test --target test docker-builds/build-files/samtools/1.15 )
  • Directory structure as name of the tool in lower case with special characters removed with a subdirectory of the version number in build-files (i.e. docker-builds/build-files/spades/3.12.0/Dockerfile)
    • (optional) All test files are located in same directory as the Dockerfile (i.e. build-files/shigatyper/2.0.1/test.sh)
  • Create a simple container-specific README.md in the same directory as the Dockerfile (i.e. docker-builds/build-files/spades/3.12.0/README.md)
    • If this README is longer than 30 lines, there is an explanation as to why more detail was needed
  • Dockerfile includes the recommended LABELS
  • Main README.md has been updated to include the tool and/or version of the dockerfile(s) in this PR
  • Program_Licenses.md contains the tool(s) used in this PR and has been updated for any missing


# Grab test Vcholerae genome, uncompress, and save to /data
RUN wget -O - https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/018/083/565/GCA_018083565.2_PDT000793508.2/GCA_018083565.2_PDT000793508.2_genomic.fna.gz \
| gunzip -c > /data/GCA_018083565.2_PDT000793508.2_genomic.fna
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove these 3 lines, they were for testing the custom V cholerae DB and are unnecessary here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept this one because this is a "real world" use-case. The rest of the tests use the toy data.

Updated example usage in README.md to include new commands and database options.
Removed redundant information about image rebuilding frequency.
@erinyoung
Copy link
Contributor Author

I have removed the github action, because it was pointed out to me that the databases are downloaded from the github repo, so rebuilding every month won't be useful.

@kapsakcj
Copy link
Collaborator

kapsakcj commented Jan 8, 2026

The most recent github actions workflow had all the docker image layers cached, so here's the one where it rebuilt the image from scratch, everything passed ✅ https://github.com/StaPH-B/docker-builds/actions/runs/20724012532/job/59495003575

some of the last few lines of output to show success:

#13 418.6 + grep 'FUSIDIC ACID' ncbi/sequences
#13 418.6 ++ nproc
#13 418.6 + abricate --threads 4 --fofn test/fofn.txt
#13 418.6 Using files from --fofn and ignoring any provided on the command line.
#13 418.7 Using nucl database ncbi:  8035 sequences -  2026-Jan-5
#13 418.7 Processing: test/assembly.fa
#13 418.7 #FILE	SEQUENCE	START	END	STRAND	GENE	COVERAGE	COVERAGE_MAP	GAPS	%COVERAGE	%IDENTITY	DATABASE	ACCESSION	PRODUCT	RESISTANCE
#13 421.1 Found 5 genes in test/assembly.fa
#13 421.1 test/assembly.fa	LGJG01000038	62416	62796	-	blaI_of_Z	1-381/381	===============	0/0	100.00	95.28	ncbi	NG_047499.1	penicillinase repressor BlaI	BETA-LACTAM
#13 421.1 test/assembly.fa	LGJG01000038	62786	64543	-	blaR1	1-1758/1758	===============	0/0	100.00	92.83	ncbi	NG_047539.1	beta-lactam sensor/signal transducer BlaR1	BETA-LACTAM
#13 421.1 test/assembly.fa	LGJG01000038	64650	65495	+	blaZ	1-846/846	===============	0/0	100.00	96.81	ncbi	NG_055999.1	penicillin-hydrolyzing class A beta-lactamase BlaZ	BETA-LACTAM
#13 421.1 test/assembly.fa	LGJG01000040	190796	191281	+	dfrS1	1-486/486	===============	0/0	100.00	99.38	ncbi	NG_077973.1	trimethoprim-resistant dihydrofolate reductase DfrS1	TRIMETHOPRIM
#13 421.1 test/assembly.fa	LGJG01000041	35416	35844	-	fosB-Sepi	1-429/429	===============	0/0	100.00	100.00	ncbi	NG_047889.1	FosB family fosfomycin resistance bacillithiol transferase	FOSFOMYCIN
#13 421.1 Tip: abricate can also find virulence factors; use --list to see all supported databases.
#13 421.1 Done.
#13 421.1 Processing: test/assembly.fa.bz2
#13 423.2 Found 5 genes in test/assembly.fa.bz2
#13 423.2 Tip: the abricate manual is at https://github.com/tseemann/abricate/blob/master/README.md
#13 423.2 Done.
#13 423.2 Processing: test/assembly.fa.gz
#13 423.2 test/assembly.fa.bz2	LGJG01000038	62416	62796	-	blaI_of_Z	1-381/381	===============	0/0	100.00	95.28	ncbi	NG_047499.1	penicillinase repressor BlaI	BETA-LACTAM
#13 423.2 test/assembly.fa.bz2	LGJG01000038	62786	64543	-	blaR1	1-1758/1758	===============	0/0	100.00	92.83	ncbi	NG_047539.1	beta-lactam sensor/signal transducer BlaR1	BETA-LACTAM
#13 423.2 test/assembly.fa.bz2	LGJG01000038	64650	65495	+	blaZ	1-846/846	===============	0/0	100.00	96.81	ncbi	NG_055999.1	penicillin-hydrolyzing class A beta-lactamase BlaZ	BETA-LACTAM
#13 423.2 test/assembly.fa.bz2	LGJG01000040	190796	191281	+	dfrS1	1-486/486	===============	0/0	100.00	99.38	ncbi	NG_077973.1	trimethoprim-resistant dihydrofolate reductase DfrS1	TRIMETHOPRIM
#13 423.2 test/assembly.fa.bz2	LGJG01000041	35416	35844	-	fosB-Sepi	1-429/429	===============	0/0	100.00	100.00	ncbi	NG_047889.1	FosB family fosfomycin resistance bacillithiol transferase	FOSFOMYCIN
#13 425.2 Found 5 genes in test/assembly.fa.gz
#13 425.2 Tip: found a bug in abricate? Post it at https://github.com/tseemann/abricate/issues.
#13 425.2 Done.
#13 425.2 Processing: test/assembly.gbk
#13 425.2 test/assembly.fa.gz	LGJG01000038	62416	62796	-	blaI_of_Z	1-381/381	===============	0/0	100.00	95.28	ncbi	NG_047499.1	penicillinase repressor BlaI	BETA-LACTAM
#13 425.2 test/assembly.fa.gz	LGJG01000038	62786	64543	-	blaR1	1-1758/1758	===============	0/0	100.00	92.83	ncbi	NG_047539.1	beta-lactam sensor/signal transducer BlaR1	BETA-LACTAM
#13 425.2 test/assembly.fa.gz	LGJG01000038	64650	65495	+	blaZ	1-846/846	===============	0/0	100.00	96.81	ncbi	NG_055999.1	penicillin-hydrolyzing class A beta-lactamase BlaZ	BETA-LACTAM
#13 425.2 test/assembly.fa.gz	LGJG01000040	190796	191281	+	dfrS1	1-486/486	===============	0/0	100.00	99.38	ncbi	NG_077973.1	trimethoprim-resistant dihydrofolate reductase DfrS1	TRIMETHOPRIM
#13 425.2 test/assembly.fa.gz	LGJG01000041	35416	35844	-	fosB-Sepi	1-429/429	===============	0/0	100.00	100.00	ncbi	NG_047889.1	FosB family fosfomycin resistance bacillithiol transferase	FOSFOMYCIN
#13 427.5 Found 5 genes in test/assembly.gbk
#13 427.5 Tip: the --fofn option allows you to feed in a big list of files to run on.
#13 427.5 Done.
#13 427.5 Processing: test/assembly.gbk.gz
#13 427.5 test/assembly.gbk	LGJG01000038	62416	62796	-	blaI_of_Z	1-381/381	===============	0/0	100.00	95.28	ncbi	NG_047499.1	penicillinase repressor BlaI	BETA-LACTAM
#13 427.5 test/assembly.gbk	LGJG01000038	62786	64543	-	blaR1	1-1758/1758	===============	0/0	100.00	92.83	ncbi	NG_047539.1	beta-lactam sensor/signal transducer BlaR1	BETA-LACTAM
#13 427.5 test/assembly.gbk	LGJG01000038	64650	65495	+	blaZ	1-846/846	===============	0/0	100.00	96.81	ncbi	NG_055999.1	penicillin-hydrolyzing class A beta-lactamase BlaZ	BETA-LACTAM
#13 427.5 test/assembly.gbk	LGJG01000040	190796	191281	+	dfrS1	1-486/486	===============	0/0	100.00	99.38	ncbi	NG_077973.1	trimethoprim-resistant dihydrofolate reductase DfrS1	TRIMETHOPRIM
#13 427.5 test/assembly.gbk	LGJG01000041	35416	35844	-	fosB-Sepi	1-429/429	===============	0/0	100.00	100.00	ncbi	NG_047889.1	FosB family fosfomycin resistance bacillithiol transferase	FOSFOMYCIN
#13 429.7 Found 5 genes in test/assembly.gbk.gz
#13 429.7 Tip: did you know? abricate was named after 'A'nti 'B'acterial 'R'esistiance
#13 429.7 Done.
#13 429.7 test/assembly.gbk.gz	LGJG01000038	62416	62796	-	blaI_of_Z	1-381/381	===============	0/0	100.00	95.28	ncbi	NG_047499.1	penicillinase repressor BlaI	BETA-LACTAM
#13 429.7 test/assembly.gbk.gz	LGJG01000038	62786	64543	-	blaR1	1-1758/1758	===============	0/0	100.00	92.83	ncbi	NG_047539.1	beta-lactam sensor/signal transducer BlaR1	BETA-LACTAM
#13 429.7 test/assembly.gbk.gz	LGJG01000038	64650	65495	+	blaZ	1-846/846	===============	0/0	100.00	96.81	ncbi	NG_055999.1	penicillin-hydrolyzing class A beta-lactamase BlaZ	BETA-LACTAM
#13 429.7 test/assembly.gbk.gz	LGJG01000040	190796	191281	+	dfrS1	1-486/486	===============	0/0	100.00	99.38	ncbi	NG_077973.1	trimethoprim-resistant dihydrofolate reductase DfrS1	TRIMETHOPRIM
#13 429.7 test/assembly.gbk.gz	LGJG01000041	35416	35844	-	fosB-Sepi	1-429/429	===============	0/0	100.00	100.00	ncbi	NG_047889.1	FosB family fosfomycin resistance bacillithiol transferase	FOSFOMYCIN
#13 DONE 429.7s

#14 [test 3/3] RUN abricate --list
#14 0.295 DATABASE	SEQUENCES	DBTYPE	DATE
#14 0.295 plasmidfinder	488	nucl	2026-Jan-5
#14 0.295 vfdb	4592	nucl	2026-Jan-5
#14 0.295 victors	4545	nucl	2026-Jan-5
#14 0.295 ecoh	597	nucl	2026-Jan-5
#14 0.295 bacmet2	746	prot	2026-Jan-5
#14 0.295 card	6052	nucl	2026-Jan-5
#14 0.295 ncbi	8035	nucl	2026-Jan-5
#14 0.295 argannot	2224	nucl	2026-Jan-5
#14 0.295 resfinder	3206	nucl	2026-Jan-5
#14 0.295 ecoli_vf	2701	nucl	2026-Jan-5
#14 0.295 megares	6635	nucl	2026-Jan-5
#14 DONE 0.3s

#15 exporting to docker image format
#15 exporting layers
#15 exporting layers 2.2s done
#15 exporting manifest sha256:f3e77b819ba315923f1cce2755920be6e41ff170970ad9972499b4f49d3435ac done
#15 exporting config sha256:f305dcc7b95fbe76eb7b0e86e765dd2bfd297105146334742eada554e9e7ebc4 done
#15 sending tarball
#15 sending tarball 4.9s done
#15 DONE 7.1s

@kapsakcj kapsakcj merged commit 27bc47a into StaPH-B:master Jan 8, 2026
2 checks passed
@kapsakcj
Copy link
Collaborator

kapsakcj commented Jan 8, 2026

Thanks for the PR! Deploy workflow here: https://github.com/StaPH-B/docker-builds/actions/runs/20824656459

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Request An Update]: add abricate 1.2.0

2 participants