Skip to content

Commit

Permalink
Adding Dr. PRG (#776)
Browse files Browse the repository at this point in the history
* initial Dockerfile

* adding drprg 0.1.1

* attempted downloading index at new location

* added htslib

* working version

* made lowercase
  • Loading branch information
erinyoung authored Nov 16, 2023
1 parent 41a5747 commit 192e871
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 0 deletions.
1 change: 1 addition & 0 deletions Program_Licenses.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The licenses of the open-source software that is contained in these Docker image
| datasets-sars-cov-2 | Apache 2.0 | https://github.com/CDCgov/datasets-sars-cov-2/blob/master/LICENSE |
| dnaapler | MIT | https://github.com/gbouras13/dnaapler/blob/main/LICENSE |
| dragonflye | GNU GPLv3 | https://github.com/rpetit3/dragonflye/blob/main/LICENSE |
| drprg | MIT | https://github.com/mbhall88/drprg/blob/main/LICENSE |
| DSK | GNU Affero GPLv3 | https://github.com/GATB/dsk/blob/master/LICENSE |
| emboss | GNU GPLv3 | http://emboss.sourceforge.net/licence/ |
| emmtyper | GNU GPLv3 | https://github.com/MDU-PHL/emmtyper/blob/master/LICENSE |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ To learn more about the docker pull rate limits and the open source software pro
| [datasets-sars-cov-2](https://github.com/CDCgov/datasets-sars-cov-2) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/datasets-sars-cov-2)](https://hub.docker.com/r/staphb/datasets-sars-cov-2) | <ul><li>0.6.2</li><li>0.6.3</li><li>0.7.2</li></ul> | https://github.com/CDCgov/datasets-sars-cov-2 |
| [dnaapler](https://hub.docker.com/r/staphb/dnaapler) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/dnaapler)](https://hub.docker.com/r/staphb/dnaapler) | <ul><li>[0.1.0](dnaapler/0.1.0/)</li></ul> <ul><li>[0.4.0](dnaapler/0.4.0/)</li></ul> | https://github.com/gbouras13/dnaapler |
| [dragonflye](https://hub.docker.com/r/staphb/dragonflye) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/dragonflye)](https://hub.docker.com/r/staphb/dragonflye) | <ul><li>1.0.14</li><li>[1.1.1](dragonflye/1.1.1/)</li></ul> | https://github.com/rpetit3/dragonflye |
| [Dr. PRG ](https://hub.docker.com/r/staphb/drprg) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/drprg)](https://hub.docker.com/r/staphb/drprg) | <ul><li>[0.1.1](drprg/0.1.1/)</li></ul> | https://mbh.sh/drprg/ |
| [DSK](https://hub.docker.com/r/staphb/dsk) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/dsk)](https://hub.docker.com/r/staphb/dsk) | <ul><li>0.0.100</li></ul> | https://gatb.inria.fr/software/dsk/ |
| [emboss](https://hub.docker.com/r/staphb/emboss) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/emboss)](https://hub.docker.com/r/staphb/emboss) | <ul><li>6.6.0 (no version)</li></ul> | http://emboss.sourceforge.net |
| [emmtyper](https://hub.docker.com/r/staphb/emmtyper) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/emmtyper)](https://hub.docker.com/r/staphb/emmtyper) | <ul><li>0.2.0</li></ul> | https://github.com/MDU-PHL/emmtyper |
Expand Down
69 changes: 69 additions & 0 deletions drprg/0.1.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 'FROM' defines the base docker image. This command has to come first in the file
# The 'as' keyword lets you name the folowing stage. The production image uses everything to the 'app' stage.
FROM mambaorg/micromamba:1.5.1 as app

# List all software versions are ARGs near the top of the dockerfile
# 'ARG' sets environment variables during the build stage
ARG DRPRG_VER="0.1.1"
ARG MTB_VER="20230308"

# build and run as root users since micromamba image has 'mambauser' set as the $USER
USER root
# set workdir to default for building; set to /data at the end
WORKDIR /

# 'LABEL' instructions tag the image with metadata that might be important to the user

LABEL base.image="mambaorg/micromamba:1.4.9"
LABEL dockerfile.version="1"
LABEL software="Dr. PRG"
LABEL software.version="${DRPRG_VER}"
LABEL description="Antimicrobial resistance prediction"
LABEL website="https://github.com/mbhall88/drprg"
LABEL license="https://github.com/mbhall88/drprg/blob/main/LICENSE"
LABEL maintainer="Erin Young"
LABEL maintainer.email="[email protected]"

# 'RUN' executes code during the build
# Install dependencies via apt-get or yum if using a centos or fedora base
RUN apt-get update && apt-get install --no-install-recommends -y \
wget \
ca-certificates \
procps && \
rm -rf /var/lib/apt/lists/* && apt-get autoclean

# Install your desired software into the base conda/micromamba environment, pinning the version
# clean up conda garbage
# make /data to use as a working directory
RUN micromamba install --name base -c conda-forge -c bioconda -c defaults drprg=${DRPRG_VER} && \
micromamba clean -a -y && \
mkdir /data

# 'ENV' instructions set environment variables that persist from the build into the resulting image
# set the environment, add base conda/micromamba bin directory into path
# set locale settings to UTF-8
ENV PATH="/opt/conda/bin/:${PATH}" \
LC_ALL=C.UTF-8

# download MTB index and change the name
RUN mkdir /drprg && \
drprg index --download mtb@${MTB_VER} --outdir /drprg && \
mv /drprg/mtb/mtb-${MTB_VER} /drprg/mtb/mtb

CMD drprg --help

WORKDIR /data

FROM app as test

WORKDIR /test

RUN drprg --help

# testing prediction
RUN wget -q ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR230/005/SRR23086705/SRR23086705_1.fastq.gz && \
drprg predict -x /drprg/mtb/mtb -i SRR23086705_1.fastq.gz --illumina -o outdir/ && \
ls outdir/*

# list available databases for download
RUN drprg index --list
48 changes: 48 additions & 0 deletions drprg/0.1.1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
Please edit this readme with some basic information about the tool and how to use this container.
- Include information about databases and additional files that are included.
- Keep it short - you don't need to recreate the documentation from the creators.
- Do not just copy and paste the readme or help for the tool.
-->

# Dr. PRG - Drug resistance Prediction with Reference Graphs️ container

Main tool: [Dr. PRG](https://mbh.sh/drprg/)

Code repository: https://github.com/mbhall88/drprg

Basic information on how to use this tool:
- executable: drprg
- help: --help
- version: --version
- description: Drug Resistance Prediction with Reference Graphs

Additional information:

Imagine contains the mtb@20230308 database located at `/drprg/mtb/mtb`.

Full documentation: https://mbh.sh/drprg/guide/download.html

## Example Usage

Using the index in from the image

```bash

# prediction (paired-end fastq files much be contatenated together into one)
drprg predict -x /drprg/mtb/mtb -i input.fastq.gz --illumina -o outdir/
```

Getting the latest index and using it

```bash

# download latest TB database
drprg index --download mtb

# list available indices
drprg index --list

# prediction (paired-end fastq files much be contatenated together into one)
drprg predict -x mtb -i input.fastq.gz --illumina -o outdir/
```

0 comments on commit 192e871

Please sign in to comment.