Skip to content

Commit

Permalink
Merge pull request #1113 from sage-wright/smw-polypolish-dev
Browse files Browse the repository at this point in the history
add bwa to polypolish 0.6.0
  • Loading branch information
erinyoung authored Dec 12, 2024
2 parents 7f86205 + 993ce6c commit db42d7f
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ To learn more about the docker pull rate limits and the open source software pro
| [PlasmidSeeker](https://hub.docker.com/r/staphb/plasmidseeker) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/plasmidseeker)](https://hub.docker.com/r/staphb/plasmidseeker) | <ul><li>1.0</li><li>1.3</li></ul> | https://github.com/bioinfo-ut/PlasmidSeeker |
| [pmga](https://hub.docker.com/r/staphb/pmga/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/pmga)](https://hub.docker.com/r/staphb/pmga) | <ul><li>3.0.2</li></ul> | https://github.com/rpetit3/pmga |
| [PolkaPox](https://hub.docker.com/r/staphb/polkapox/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/polkapox)](https://hub.docker.com/r/staphb/polkapox) | <ul><li>[1.0.0-beta](./polkapox/1.0.0-beta/)</li></ul> | https://github.com/CDCgov/polkapox |
| [polypolish](https://hub.docker.com/r/staphb/polypolish/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/polypolish)](https://hub.docker.com/r/staphb/polypolish) | <ul><li>[0.5.0](./polypolish/0.5.0/)</li><li>[0.6.0](./polypolish/0.6.0/)</li></ul> | https://github.com/rrwick/Polypolish |
| [polypolish](https://hub.docker.com/r/staphb/polypolish/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/polypolish)](https://hub.docker.com/r/staphb/polypolish) | <ul><li>[0.5.0](./polypolish/0.5.0/)</li><li>[0.6.0](./polypolish/0.6.0/)</li><li>[0.6.0-bwa](./polypolish/0.6.0-bwa/)</li></ul> | https://github.com/rrwick/Polypolish |
| [PopPUNK](https://hub.docker.com/r/staphb/poppunk/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/poppunk)](https://hub.docker.com/r/staphb/poppunk) | <ul><li>[2.4.0](./poppunk/2.4.0/)</li><li>[2.5.0](./poppunk/2.5.0/)</li><li>[2.6.0](./poppunk/2.6.0/)</li><li>[2.6.2](./poppunk/2.6.2/)</li><li>[2.6.3](./poppunk/2.6.3/)</li><li>[2.6.5](./poppunk/2.6.5/)</li></ul> | https://github.com/bacpop/PopPUNK |
| [Porechop](https://hub.docker.com/r/staphb/porechop/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/porechop)](https://hub.docker.com/r/staphb/porechop) | <ul><li>0.2.4</li></ul> | https://github.com/rrwick/Porechop |
| [PPanGGOLiN](https://hub.docker.com/r/staphb/ppanggolin/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/ppanggolin)](https://hub.docker.com/r/staphb/ppanggolin) | <ul><li>[1.2.105](./ppanggolin/1.2.105/)</li><li>[2.0.3](./ppanggolin/2.0.3/)</li><li>[2.0.5](./ppanggolin/2.0.5/)</li><li>[2.1.2](./ppanggolin/2.1.2/)</li></ul> | https://github.com/labgem/PPanGGOLiN |
Expand Down
70 changes: 70 additions & 0 deletions polypolish/0.6.0-bwa/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
ARG POLYPOLISH_VER="0.6.0"
ARG BWA_VER="0.7.18"

FROM rust:1.75 AS builder

ARG POLYPOLISH_VER
ARG BWA_VER

RUN wget -q https://github.com/rrwick/Polypolish/archive/refs/tags/v${POLYPOLISH_VER}.tar.gz && \
tar -vxf v${POLYPOLISH_VER}.tar.gz && \
cd /Polypolish-${POLYPOLISH_VER} && \
cargo build --release

RUN wget https://github.com/lh3/bwa/archive/refs/tags/v${BWA_VER}.tar.gz &&\
tar -xvf v${BWA_VER}.tar.gz &&\
cd bwa-${BWA_VER} &&\
make &&\
mv bwa /usr/local/bin/

FROM ubuntu:jammy AS app

ARG POLYPOLISH_VER

LABEL base.image="ubuntu:jammy"
LABEL dockerfile.version="1"
LABEL software="polypolish"
LABEL software.version="${POLYPOLISH_VER}"
LABEL description="Polypolish is a tool for polishing genome assemblies with short reads."
LABEL website="https://github.com/rrwick/Polypolish"
LABEL license="https://github.com/rrwick/Polypolish/blob/main/LICENSE"
LABEL maintainer="Erin Young"
LABEL maintainer.email="[email protected]"
LABEL maintainer2="Sage Wright"
LABEL maintainer2.email="[email protected]"

RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
ca-certificates \
procps \
unzip \
python3 && \
apt-get autoclean && rm -rf /var/lib/apt/lists/*

COPY --from=builder /Polypolish-${POLYPOLISH_VER}/target/release/polypolish /usr/local/bin/polypolish
COPY --from=builder /usr/local/bin/bwa /usr/local/bin/

ENV LC_ALL=C

CMD ["polypolish", "--help"]

WORKDIR /data

FROM app AS test

RUN polypolish --help && polypolish --version

# using "toy" data
RUN wget -q https://raw.githubusercontent.com/wiki/rrwick/Polypolish/files/toy_example/assembly.fasta && \
wget -q https://raw.githubusercontent.com/wiki/rrwick/Polypolish/files/toy_example/alignments.sam && \
polypolish polish assembly.fasta alignments.sam > polished.fasta

# testing bwa
RUN wget -q ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR608/003/SRR6082043/SRR6082043_1.fastq.gz -O r1.fq.gz &&\
wget -q ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR608/003/SRR6082043/SRR6082043_2.fastq.gz -O r2.fq.gz &&\
wget -q https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/006/945/GCF_000006945.2_ASM694v2/GCF_000006945.2_ASM694v2_genomic.fna.gz &&\
gunzip -c GCF_000006945.2_ASM694v2_genomic.fna.gz > ref.fa

RUN bwa index ref.fa &&\
bwa mem ref.fa r1.fq.gz r2.fq.gz > aln.sam &&\
head aln.sam
42 changes: 42 additions & 0 deletions polypolish/0.6.0-bwa/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# polypolish container

Main tool: [polypolish](https://github.com/rrwick/Polypolish/wiki/How-to-run-Polypolish) v0.6.0

Code repository: [polypolish](https://github.com/rrwick/Polypolish)

Additional tools:

- bwa: 0.7.18
- python: 3.10

Basic information on how to use this tool:

- executable: polypolish
- help: --help
- version: --version
- description: "Polypolish "polishes" consensus files created during assembly of long reads with Illumina short reads. Polypolish is a little different than other polishing tools in that paired-end reads need to be aligned separatly to generate two sam files."

Additional information: This container also includes BWA v0.7.18 so that the user can align their short reads within the same container.

Full documentation: [https://github.com/rrwick/Polypolish/wiki](https://github.com/rrwick/Polypolish/wiki)

## Example Usage

Use the included bwa software to align reads to the draft sequence. Please note that bbamp, minimap2 or any other similar software can perform a similar step that may be better suited for your use-case.

```bash
bwa index draft.fasta
bwa mem -t 16 -a draft.fasta reads_1.fastq.gz > alignments_1.sam
bwa mem -t 16 -a draft.fasta reads_2.fastq.gz > alignments_2.sam
```

Once the sam files are generated, they can be used with polypolish.

```bash
# paired end
polypolish filter --in1 alignments_1.sam --in2 alignments_2.sam --out1 filtered_1.sam --out2 filtered_2.sam
polypolish polish draft.fasta filtered_1.sam filtered_2.sam > polished.fasta

# single end
polypolish polish draft.fasta input.sam > polished.fasta
```

0 comments on commit db42d7f

Please sign in to comment.