-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1113 from sage-wright/smw-polypolish-dev
add bwa to polypolish 0.6.0
- Loading branch information
Showing
3 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |