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 assembly_snptyper version 0.1.1 #1016

Merged
merged 2 commits into from
Sep 30, 2024
Merged
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
1 change: 1 addition & 0 deletions Program_Licenses.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The licenses of the open-source software that is contained in these Docker image
| artic-ncov2019-epi2me | MPL 2.0 | https://github.com/epi2me-labs/wf-artic/blob/master/LICENSE |
| any2fasta | GNU GPLv3 | https://github.com/tseemann/any2fasta/blob/master/LICENSE |
| ARIBA | GNU GPLv3 | https://github.com/sanger-pathogens/ariba/blob/master/LICENSE |
| assembly_snptyper | MIT | https://github.com/boasvdp/assembly_snptyper/blob/main/LICENSE |
| Augur | GNU Affero GPLv3 | https://github.com/nextstrain/augur/blob/master/LICENSE.txt |
| Auspice | GNU Affero GPLv3 | https://github.com/nextstrain/auspice/blob/master/LICENSE.txt |
| Bakta | GNU GPLv3 | https://github.com/oschwengers/bakta/blob/main/LICENSE |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ To learn more about the docker pull rate limits and the open source software pro
| [artic-ncov2019-epi2me](https://hub.docker.com/r/staphb/artic-ncov2019-epi2me) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/artic-ncov2019-epi2me)](https://hub.docker.com/r/staphb/artic-ncov2019-epi2me) | <ul><li>0.3.10</ul> | https://github.com/epi2me-labs/wf-artic |
| [artic-ncov2019-medaka](https://hub.docker.com/r/staphb/artic-ncov2019-medaka) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/artic-ncov2019-medaka)](https://hub.docker.com/r/staphb/artic-ncov2019-medaka) | <ul><li>1.1.0</ul> | https://github.com/artic-network/artic-ncov2019 |
| [artic-ncov2019-nanopolish](https://hub.docker.com/r/staphb/artic-ncov2019-nanopolish) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/artic-ncov2019-nanopolish)](https://hub.docker.com/r/staphb/artic-ncov2019-nanopolish) | <ul><li>1.1.0</ul> | https://github.com/artic-network/artic-ncov2019 |
| [assembly_snptyper](https://hub.docker.com/r/staphb/assembly_snptyperh) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/assembly_snptyper)](https://hub.docker.com/r/staphb/assembly_snptyper) | <ul><li>[0.1.1](./assembly_snptyper/0.1.1/)</li></ul> | https://github.com/boasvdp/assembly_snptyper |
| [Augur](https://hub.docker.com/r/staphb/augur) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/augur)](https://hub.docker.com/r/staphb/augur) | <ul><li>[6.3.0](./augur/6.3.0/)</li><li>[7.0.2](./augur/7.0.2/)</li><li>[8.0.0](./augur/8.0.0/)</li><li>[9.0.0](./augur/9.0.0/)</li><li>[16.0.3](./augur/16.0.3/)</li><li>[24.2.2](./augur/24.2.2/)</li><li>[24.2.3](./augur/24.2.3/)</li><li>[24.3.0](./augur/24.3.0/)</li><li>[24.4.0](./augur/24.4.0/)</li></ul> | https://github.com/nextstrain/augur |
| [Auspice](https://hub.docker.com/r/staphb/auspice) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/auspice)](https://hub.docker.com/r/staphb/auspice) | <ul><li>2.12.0</li></ul> | https://github.com/nextstrain/auspice |
| [bakta](https://hub.docker.com/r/staphb/bakta) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/bakta)](https://hub.docker.com/r/staphb/bakta) | <ul><li>[1.9.2](./bakta/1.9.2/)</li><li>[1.9.2-light](./bakta/1.9.2-5.1-light/)</li><li>[1.9.3](./bakta/1.9.3/)</li><li>[1.9.3-light](./bakta/1.9.3-5.1-light/)</li><li>[1.9.4](./bakta/1.9.4/)</li></ul> | https://github.com/oschwengers/bakta |
Expand Down
109 changes: 109 additions & 0 deletions assembly_snptyper/0.1.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
ARG ASSEMBLYSNPTYPER_VER="0.1.1"
ARG SAMTOOLS_VER="1.19"
ARG MINIMAP2_VER="2.28"

FROM ubuntu:jammy as builder

ARG SAMTOOLS_VER
ARG MINIMAP2_VER

# install dependencies required for compiling samtools
RUN apt-get update && apt-get install --no-install-recommends -y \
libncurses5-dev \
libbz2-dev \
liblzma-dev \
libcurl4-gnutls-dev \
zlib1g-dev \
libssl-dev \
gcc \
wget \
make \
perl \
bzip2 \
gnuplot \
ca-certificates \
curl

# download, compile, and install samtools
RUN wget https://github.com/samtools/samtools/releases/download/${SAMTOOLS_VER}/samtools-${SAMTOOLS_VER}.tar.bz2 && \
tar -xjf samtools-${SAMTOOLS_VER}.tar.bz2 && \
cd samtools-${SAMTOOLS_VER} && \
./configure && \
make && \
make install

WORKDIR /usr/local/bin

RUN curl -L https://github.com/lh3/minimap2/releases/download/v${MINIMAP2_VER}/minimap2-${MINIMAP2_VER}_x64-linux.tar.bz2 | tar -jxvf - --no-same-owner

### start of app stage ###
FROM ubuntu:jammy as app

ARG ASSEMBLYSNPTYPER_VER="0.1.1"

# 'LABEL' instructions tag the image with metadata that might be important to the user
LABEL base.image="ubuntu:jammy"
LABEL dockerfile.version="1"
LABEL software="assembly_snptyper"
LABEL software.version="${ASSEMBLYSNPTYPER_VER}"
LABEL description="Type assembly based on a VCF using minimap2 + samtools"
LABEL website="https://github.com/boasvdp/assembly_snptyper"
LABEL license="https://github.com/boasvdp/assembly_snptyper/blob/main/LICENSE"
LABEL maintainer="Erin Young"
LABEL maintainer.email="[email protected]"

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --no-install-recommends -y \
perl \
zlib1g \
libncurses5 \
bzip2 \
liblzma-dev \
libcurl4-gnutls-dev \
wget \
ca-certificates \
procps \
python3 \
python3-pip \
python-is-python3 \
curl \
unzip \
&& apt-get autoclean && rm -rf /var/lib/apt/lists/*

# copy in samtools and minimap2 executables from builder stage
COPY --from=builder /usr/local/bin/* /usr/local/bin/

RUN pip install pandas

# install assembly_snptyper; make /data dir
RUN wget -q https://github.com/boasvdp/assembly_snptyper/archive/refs/tags/v${ASSEMBLYSNPTYPER_VER}.tar.gz && \
pip install --no-cache-dir v${ASSEMBLYSNPTYPER_VER}.tar.gz && \
tar -vxf v${ASSEMBLYSNPTYPER_VER}.tar.gz && \
mv /assembly_snptyper-${ASSEMBLYSNPTYPER_VER} /assembly_snptyper && \
rm v${ASSEMBLYSNPTYPER_VER}.tar.gz && \
mkdir /data

ENV LC_ALL=C

CMD [ "assembly_snptyper", "--help" ]

# 'WORKDIR' sets working directory
WORKDIR /data

# A second FROM insruction creates a new stage
FROM app as test

RUN assembly_snptyper --help && \
assembly_snptyper --version

WORKDIR /test

# running on S. pyogenes representative genome
RUN wget -q https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/900/475/035/GCA_900475035.1_41965_F01/GCA_900475035.1_41965_F01_genomic.fna.gz && \
gunzip GCA_900475035.1_41965_F01_genomic.fna.gz && \
ls *genomic.fna > fastas.txt && \
assembly_snptyper --list_input fastas.txt -p 4 --reference /assembly_snptyper/data/MGAS5005.fa --vcf /assembly_snptyper/data/M1UK.vcf > m1uk.txt && \
head m1uk.txt

RUN cd /assembly_snptyper && \
bash tests/test_e2e.sh
34 changes: 34 additions & 0 deletions assembly_snptyper/0.1.1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# assembly_snptyper container

Main tool: [assembly_snptyper](https://github.com/boasvdp/assembly_snptyper)

Code repository: https://github.com/boasvdp/assembly_snptyper

Additional tools:
- samtools: 1.19
- minimap2: 2.28

Basic information on how to use this tool:
- executable: assembly_snptyper
- help: -h
- version: -v
- description: |

> This software can take a bacterial genome assembly in fasta format, align it to a reference genome and search for specific SNPs based on the alignment. It uses minimap2 and samtools to do this. You would typically only run this tool instead of a read mapping tool if you don't have access to the sequence reads.


> The tool was written with M1UK typing in mind. In this specific case, the reference genome is an M1global strain, from which M1UK can be discerned by only 27 lineage-specific SNPs. Important assumptions here are that the type of interest (here, M1UK) is closely related to the reference genome, warranting the use of the asm5 preset for minimap2.

Additional information:

M1UK reference and SNP vcf are located in /assembly_snptyper/data

Full documentation: https://github.com/boasvdp/assembly_snptyper

## Example Usage

```bash
# with a list of fasta files listed in fastas.txt
assembly_snptyper --list_input fastas.txt -p 20 --reference /assembly_snptyper/data/MGAS5005.fa --vcf /assembly_snptyper/data/M1UK.vcf > m1uk.txt
```