Skip to content

Commit

Permalink
Update Dockerfile to include all dbs
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaguire committed Oct 31, 2020
1 parent 8a44a3b commit a069579
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,29 @@ RUN conda create --name rgi --channel conda-forge --channel bioconda rgi
RUN mkdir -p /card_data
WORKDIR /card_data
RUN wget -O data.tar.bz2 https://card.mcmaster.ca/latest/data && \
tar xvf data.tar.bz2 && pwd && ls
# install database
SHELL ["conda", "run", "-n", "rgi", "rgi", "load", "-i", "/card_data/card.json"]
mkdir -p canonical && tar xf data.tar.bz2 -C canonical

# download wildcard data (modified from @nebfield)
RUN wget -O wildcard_data.tar.bz2 https://card.mcmaster.ca/latest/variants && \
mkdir -p wildcard && \
tar xf wildcard_data.tar.bz2 -C wildcard && \
gunzip wildcard/*.gz

# install CARD database
SHELL ["conda", "run", "-n", "rgi", "card_annotation", "-i", "canonical/card.json", ">", "card_annotation.log", "2>&1"]
SHELL ["conda", "run", "-n", "rgi", "rgi", "load", "-i", "caonical/card.json", "--card_annotation", "card_database_*.fasta"]

# install WILDCARD database
# version number not in downloaded data so can't do this in a way that will
# automatically be entered
SHELL ["conda", "run", "-n", "rgi", "rgi", "wildcard_annotation", "-i", "wildcard", "--card_json", "canonical/card.json", "-v", "docker_version_number", ">", "wildcard_annotation.log", "2>&1"]
SHELL ["conda", "run", "-n", "rgi", "rgi", "load", "--wildcard_annotation", "wildcard_database*", "--wildcard_index", "wildcard/index-for-model-sequences.txt", "--card_annotation", "card_database*"]

# install kmer pathogen-of-origin database
SHELL ["conda", "run", "-n", "rgi", "rgi", "load", "--kmer_database", "wildcard/61_kmer_db.json", "--amr_kmers", "wildcard/all_amr_61mers.txt", "--kmer_size", "61", "--debug", ">", "kmer_load.61.log", "2>&1"]

# Remove non-loaded databases to reduce container size
RUN cp *.log /data && rm -rf /card_data

WORKDIR /data
# set rgi executable as cmd to allow overriding
Expand Down

0 comments on commit a069579

Please sign in to comment.