Skip to content

Commit 869f432

Browse files
authored
Merge pull request #1586 from cwoodside1278/kaptive-3.2.0
Update Kaptive to 3.2.0
2 parents 8ed5f15 + 0825716 commit 869f432

File tree

3 files changed

+187
-1
lines changed

3 files changed

+187
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ To learn more about the docker pull rate limits and the open source software pro
207207
| [isPcr](https://users.soe.ucsc.edu/~kent/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/ispcr)](https://hub.docker.com/r/staphb/ispcr) | <details><summary>Click to see all versions</summary> <ul><li>[33](./build-files/ispcr/33/)</li></ul> </details> | https://users.soe.ucsc.edu/~kent/ |
208208
| [iVar](https://hub.docker.com/r/staphb/ivar/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/ivar)](https://hub.docker.com/r/staphb/ivar) | <details><summary>Click to see all versions</summary> <ul><li>[1.1](./build-files/ivar/1.1/)</li><li>[1.1 (+SARS-CoV2 reference)](./build-files/ivar/1.1-SC2/)</li><li>[1.2.1](./build-files/ivar/1.2.1/)</li><li>[1.2.1 (+SC2 ref)](./build-files/ivar/1.2.1-SC2/)</li><li>[1.2.2 (+SC2 ref and artic bedfiles)](./build-files/ivar/1.2.2_artic20200528/)</li><li>[1.3](./build-files/ivar/1.3/)</li><li>[1.3.1](./build-files/ivar/1.3.1/)</li><li>[1.3.2](./build-files/ivar/1.3.2/)</li><li>[1.4.1](./build-files/ivar/1.4.1/)</li><li>[1.4.2](./build-files/ivar/1.4.2/)</li><li>[1.4.3](./build-files/ivar/1.4.3/)</li><li>[1.4.4](./build-files/ivar/1.4.4/)</li><li>[1.4.4-aligners (+bwa and minimap2)](./build-files/ivar/1.4.4-aligners/)</li></ul> </details> | https://github.com/andersen-lab/ivar |
209209
| [Jasmine](https://hub.docker.com/r/staphb/pbjasmine/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/pbjasmine)](https://hub.docker.com/r/staphb/pbjasmine) | <details><summary>Click to see all versions</summary> <ul><li>[2.0.0](./build-files/pbjasmine/2.0.0/)</li><li>[2.4.0](./build-files/pbjasmine/2.4.0/)</li><li>[26.1.2](./build-files/pbjasmine/26.1.2/)</li></ul> </details> | https://github.com/PacificBiosciences/jasmine |
210-
| [Kaptive](https://hub.docker.com/r/staphb/kaptive/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/kaptive)](https://hub.docker.com/r/staphb/kaptive) | <details><summary>Click to see all versions</summary> <ul><li>[2.0.0](./build-files/kaptive/2.0.0/)</li><li>[2.0.3](./build-files/kaptive/2.0.3/)</li><li>[2.0.5](./build-files/kaptive/2.0.5/)</li><li>[2.0.8](./build-files/kaptive/2.0.8/)</li><li>[3.0.0b6](./build-files/kaptive/3.0.0b6/)</li><li>[3.1.0](./build-files/kaptive/3.1.0/)</li></ul> </details> | https://github.com/klebgenomics/Kaptive |
210+
| [Kaptive](https://hub.docker.com/r/staphb/kaptive/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/kaptive)](https://hub.docker.com/r/staphb/kaptive) | <details><summary>Click to see all versions</summary> <ul><li>[2.0.0](./build-files/kaptive/2.0.0/)</li><li>[2.0.3](./build-files/kaptive/2.0.3/)</li><li>[2.0.5](./build-files/kaptive/2.0.5/)</li><li>[2.0.8](./build-files/kaptive/2.0.8/)</li><li>[3.0.0b6](./build-files/kaptive/3.0.0b6/)</li><li>[3.1.0](./build-files/kaptive/3.1.0/)</li><li>[3.2.0](./build-files/kaptive/3.2.0/)</li></ul> </details> | https://github.com/klebgenomics/Kaptive |
211211
| [Kleborate](https://hub.docker.com/r/staphb/kleborate/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/kleborate)](https://hub.docker.com/r/staphb/kleborate) | <details><summary>Click to see all versions</summary> <ul><li>[2.0.4](./build-files/kleborate/2.0.4/)</li><li>[2.1.0](./build-files/kleborate/2.1.0/)</li><li>[2.2.0](./build-files/kleborate/2.2.0/)</li><li>[2.3.2](./build-files/kleborate/2.3.2)</li><li>[2.3.2-2023-05](./build-files/kleborate/2.3.2-2023-05/)</li><li>[2.4.1](./build-files/kleborate/2.4.1/)</li><li>[3.1.2](./build-files/kleborate/3.1.2/)</li><li>[3.1.3](./build-files/kleborate/3.1.3/)</li><li>[3.2.4](./build-files/kleborate/3.2.4/)</li><li>[3.2.4-micromamba](./build-files/kleborate/3.2.4-micromamba/)</li></ul> </details> | https://github.com/klebgenomics/Kleborate <br/> https://github.com/klebgenomics/Kaptive |
212212
| [kma](https://hub.docker.com/r/staphb/kma/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/kma)](https://hub.docker.com/r/staphb/kma) | <details><summary>Click to see all versions</summary> <ul><li>[1.2.21](./build-files/kma/1.2.21/)</li><li>[1.4.10 (no database)](./build-files/kma/1.4.10/)</li><li>[1.4.14](./build-files/kma/1.4.14/) (no database)</li><li>[1.4.17](./build-files/kma/1.4.17/) (no database)</li><li>[1.5.2](./build-files/kma/1.5.2/) (no database)</li><li>[1.6.4](./build-files/kma/1.6.4/)</li><</ul> </details> | https://bitbucket.org/genomicepidemiology/kma/ |
213213
| [Kraken](https://hub.docker.com/r/staphb/kraken/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/kraken)](https://hub.docker.com/r/staphb/kraken) | <details><summary>Click to see all versions</summary> <ul><li>[1.0](./build-files/kraken/1.0/)</li><li>[1.1.1](./build-files/kraken/1.1.1/)</li><li>[1.1.1 (no database)](./build-files/kraken/1.1.1-no-db/)</li></ul> </details> | https://github.com/DerrickWood/kraken |
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
FROM ubuntu:noble AS app
2+
3+
# for easy upgrade later. ARG variables only persist during image build time
4+
ARG MINIMAP2_VER="2.3"
5+
ARG MASH_VER="2.3"
6+
ARG KAPTIVE_VER="3.2.0"
7+
ARG VP_GENOMOSEROTYPING_VER="1.1"
8+
9+
LABEL base.image="ubuntu:noble"
10+
LABEL dockerfile.version="1"
11+
LABEL software="Kaptive"
12+
LABEL software.version="${KAPTIVE_VER}"
13+
LABEL description="Report information about surface polysaccharide loci for Klebsiella pneumoniae species complex and Acinetobacter baumannii genome assemblies"
14+
LABEL website="https://github.com/klebgenomics/Kaptive/"
15+
LABEL license="https://github.com/klebgenomics/Kaptive/blob/master/LICENSE"
16+
LABEL website.VPdatabase="https://github.com/aldertzomer/vibrio_parahaemolyticus_genomoserotyping"
17+
LABEL license.VPdatabase="https://github.com/aldertzomer/vibrio_parahaemolyticus_genomoserotyping/blob/main/LICENSE"
18+
LABEL maintainer="Tamas Stirling"
19+
LABEL maintainer.email="stirling.tamas@gmail.com"
20+
LABEL maintainer2="Curtis Kapsak"
21+
LABEL maintainer2.email="kapsakcj@gmail.com"
22+
LABEL maintainer3="Erin Young"
23+
LABEL maintainer3.email="eriny@utah.gov"
24+
25+
# install prerequisites. Cleanup apt garbage
26+
RUN apt-get update && apt-get install -y --no-install-recommends \
27+
python3 \
28+
python3-pip \
29+
wget \
30+
ca-certificates \
31+
bzip2 \
32+
procps \
33+
curl && \
34+
rm -rf /var/lib/apt/lists/* && apt-get autoclean
35+
36+
# mash; update UID and GID of mash files; make /data
37+
# UID and GID changes because the original owner is UID: 1081147385 and GID: 1360859114 which does NOT play well with systems that limits GIDs and UIDs
38+
RUN wget -q https://github.com/marbl/Mash/releases/download/v${MASH_VER}/mash-Linux64-v${MASH_VER}.tar && \
39+
tar -xvf mash-Linux64-v${MASH_VER}.tar --no-same-owner && \
40+
rm -rf mash-Linux64-v${MASH_VER}.tar && \
41+
chown root:root /mash-Linux64-v${MASH_VER}/*
42+
43+
# install minimap2 binary; make /data
44+
RUN curl -L https://github.com/lh3/minimap2/releases/download/v${MINIMAP2_VER}/minimap2-${MINIMAP2_VER}_x64-linux.tar.bz2 | \
45+
tar -jxvf - --no-same-owner
46+
47+
# install kaptive
48+
RUN pip install --no-cache-dir --break-system-packages kaptive==${KAPTIVE_VER}
49+
50+
# move databases
51+
RUN wget -q https://github.com/klebgenomics/Kaptive/archive/refs/tags/v${KAPTIVE_VER}.tar.gz && \
52+
tar -vxf v${KAPTIVE_VER}.tar.gz --no-same-owner && \
53+
mkdir -p /data /kaptive/ && \
54+
mv /Kaptive-${KAPTIVE_VER}/reference_database /kaptive/reference_database && \
55+
rm -rf v${KAPTIVE_VER}.tar.gz Kaptive-${KAPTIVE_VER}
56+
57+
# NOTE: in v3.2.1+, reference_database moved to src/kaptive/data/reference_database. Use line below.
58+
# mv /Kaptive-${KAPTIVE_VER}/src/kaptive/data/reference_database /kaptive/reference_database
59+
60+
# download Vibrio parahemolyticus database; mv gbk files to where the other references are
61+
RUN wget -q https://github.com/aldertzomer/vibrio_parahaemolyticus_genomoserotyping/archive/refs/tags/${VP_GENOMOSEROTYPING_VER}.tar.gz && \
62+
tar -xzf ${VP_GENOMOSEROTYPING_VER}.tar.gz && \
63+
rm -v ${VP_GENOMOSEROTYPING_VER}.tar.gz && \
64+
mv -v vibrio_parahaemolyticus_genomoserotyping-${VP_GENOMOSEROTYPING_VER}/*gbk /kaptive/reference_database/. && \
65+
rm -rf vibrio_parahaemolyticus_genomoserotyping-${VP_GENOMOSEROTYPING_VER}
66+
67+
# set PATH
68+
ENV PATH="/mash-Linux64-v${MASH_VER}:/minimap2-${MINIMAP2_VER}_x64-linux:${PATH}"
69+
70+
# set working directory
71+
WORKDIR /data
72+
73+
# default command is to print help options
74+
CMD [ "kaptive", "--help" ]
75+
76+
# test layer
77+
FROM app AS test
78+
79+
RUN kaptive --help && kaptive --version
80+
81+
WORKDIR /test1
82+
83+
# test with A. baumannii; testing both k and o locus
84+
RUN echo "downloading an A. baumannii genome & testing Kaptive..." && \
85+
wget -q https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/016/486/705/GCA_016486705.1_PDT000751301.1/GCA_016486705.1_PDT000751301.1_genomic.fna.gz && \
86+
gzip -d GCA_016486705.1_PDT000751301.1_genomic.fna.gz && \
87+
kaptive assembly /kaptive/reference_database/Acinetobacter_baumannii_k_locus_primary_reference.gbk GCA_016486705.1_PDT000751301.1_genomic.fna -o abau_k.txt && head abau_k.txt && \
88+
kaptive assembly /kaptive/reference_database/Acinetobacter_baumannii_OC_locus_primary_reference.gbk GCA_016486705.1_PDT000751301.1_genomic.fna -o abau_oc.txt && head abau_oc.txt
89+
90+
WORKDIR /test2
91+
# test with K. pneumoniae; testing both k and o locus
92+
RUN echo "downloading an K. pneumoniae genome & testing Kaptive..." && \
93+
wget -q https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/022/268/055/GCA_022268055.1_PDT000434809.1/GCA_022268055.1_PDT000434809.1_genomic.fna.gz && \
94+
gzip -d GCA_022268055.1_PDT000434809.1_genomic.fna.gz && \
95+
kaptive assembly /kaptive/reference_database/Klebsiella_k_locus_primary_reference.gbk GCA_022268055.1_PDT000434809.1_genomic.fna -o kpneu_k.txt && \
96+
kaptive assembly /kaptive/reference_database/Klebsiella_o_locus_primary_reference.gbk GCA_022268055.1_PDT000434809.1_genomic.fna -o kpneu_o.txt && \
97+
head kpneu_k.txt kpneu_o.txt
98+
99+
WORKDIR /test3
100+
# test with recommended usage in documentatation
101+
RUN echo "downloading an K. pneumoniae genome & testing Kaptive..." && \
102+
wget -q https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/022/268/055/GCA_022268055.1_PDT000434809.1/GCA_022268055.1_PDT000434809.1_genomic.fna.gz && \
103+
gzip -d GCA_022268055.1_PDT000434809.1_genomic.fna.gz && \
104+
kaptive assembly kpsc_k assemblies/*.fna -o kaptive_results.tsv && \
105+
head kaptive_results.tsv
106+
107+
WORKDIR /test4
108+
109+
### test with at 2 Vibrio parahaemolyticus genomes with a known serotype. These 2 are pulled from the publication describing custom database ##
110+
# GCA_001558495.2 - expect OL1 and KL1
111+
# GCA_001728135.1 - expect OL4 KL53
112+
# more info on test genome here: https://www.ncbi.nlm.nih.gov/data-hub/genome/GCF_001558495.2/
113+
# strain: ATCC17802
114+
# more info on 2nd test genome here: https://www.ncbi.nlm.nih.gov/data-hub/genome/GCF_001728135.1/
115+
# strain: CDC_K5009W
116+
RUN echo "downloading an 2 V. parahaemolyticus genomes & testing Kaptive..." && \
117+
wget -q https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/001/558/495/GCF_001558495.2_ASM155849v2/GCF_001558495.2_ASM155849v2_genomic.fna.gz && \
118+
wget -q https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/001/728/135/GCF_001728135.1_ASM172813v1/GCF_001728135.1_ASM172813v1_genomic.fna.gz && \
119+
gzip -d GCF_001558495.2_ASM155849v2_genomic.fna.gz && \
120+
gzip -d GCF_001728135.1_ASM172813v1_genomic.fna.gz && \
121+
kaptive assembly /kaptive/reference_database/VibrioPara_Kaptivedb_K.gbk *.fna -o Vparahaemolyticus_K.txt && \
122+
kaptive assembly /kaptive/reference_database/VibrioPara_Kaptivedb_O.gbk *.fna -o Vparahaemolyticus_O.txt && \
123+
head Vparahaemolyticus_K.txt Vparahaemolyticus_O.txt
124+
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Kaptive Container
2+
3+
Main tool: [Kaptive](https://github.com/klebgenomics/Kaptive)
4+
5+
Additional tools:
6+
7+
- minimap2 2.28
8+
- python 3.10.12
9+
- biopython 1.84
10+
- matplotlib 3.9.2
11+
- dna-features-viewer 3.1.3
12+
- numpy 2.1.3
13+
14+
## Kaptive databases
15+
16+
There are few databases included in this docker image:
17+
18+
- Klebsiella pneumoniae species complex
19+
- included w/ Kaptive
20+
- Acinetobacter baumannii
21+
- included w/ Kaptive
22+
- Vibrio parahaemolyticus
23+
- Verson 1.1
24+
- Located in separate GitHub repo: https://github.com/aldertzomer/vibrio_parahaemolyticus_genomoserotyping
25+
- Publication: https://www.microbiologyresearch.org/content/journal/mgen/10.1099/mgen.0.001007
26+
27+
The databases (Genbank/GBK files) are located as follows in the container filesystem:
28+
29+
```bash
30+
# Klebsiella pneumoniae species complex
31+
/kaptive/reference_database/Klebsiella_k_locus_primary_reference.gbk
32+
/kaptive/reference_database/Klebsiella_o_locus_primary_reference.gbk
33+
34+
# Acinetobacter baumannii
35+
/kaptive/reference_database/Acinetobacter_baumannii_k_locus_primary_reference.gbk
36+
/kaptive/reference_database/Acinetobacter_baumannii_OC_locus_primary_reference.gbk
37+
38+
# Vibrio parahaeolyticus
39+
/kaptive/reference_database/VibrioPara_Kaptivedb_K.gbk
40+
/kaptive/reference_database/VibrioPara_Kaptivedb_O.gbk
41+
```
42+
43+
Example commands for each of these databases can be found below.
44+
45+
## Example Usage
46+
47+
```bash
48+
# K locus, A. baumannii
49+
kaptive.py assembly /kaptive/reference_database/Acinetobacter_baumannii_k_locus_primary_reference.gbk assembly.fasta -o outfile.txt
50+
# O locus, A. baumannii
51+
kaptive.py assembly /kaptive/reference_database/Acinetobacter_baumannii_OC_locus_primary_reference.gbk assembly.fasta -o outfile.txt
52+
53+
# K locus, K. pneumoniae
54+
kaptive.py assembly /kaptive/reference_database/Klebsiella_k_locus_primary_reference.gbk assembly.fasta -o outfile.txt
55+
# O locus, K. pneumoniae
56+
kaptive.py assembly /kaptive/reference_database/Klebsiella_o_locus_primary_reference.gbk assembly.fasta -o outfile.txt
57+
58+
# K locus, V. parahaemolyticus
59+
kaptive.py assembly /kaptive/reference_database/VibrioPara_Kaptivedb_K.gbk assembly.fasta -o outfile.txt
60+
# O locus, V. parahaemolyticus
61+
kaptive.py assembly /kaptive/reference_database/VibrioPara_Kaptivedb_O.gbk assembly.fasta -o outfile.txt
62+
```

0 commit comments

Comments
 (0)