-
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 #1115 from fraser-combe/racon-minimap2
Update Racon 1.5.0 to include minimap2
- Loading branch information
Showing
4 changed files
with
160 additions
and
2 deletions.
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,112 @@ | ||
ARG RACON_VER="1.5.0" | ||
ARG MINIMAP2_VER="2.28" | ||
|
||
# Use ubuntu as base image | ||
FROM ubuntu:jammy AS builder | ||
|
||
ARG RACON_VER | ||
ARG MINIMAP2_VER | ||
|
||
# Install dependencies | ||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
perl \ | ||
default-jre \ | ||
gnuplot \ | ||
libgomp1 \ | ||
maven \ | ||
git \ | ||
wget \ | ||
python3 \ | ||
build-essential \ | ||
cmake \ | ||
zlib1g-dev \ | ||
curl \ | ||
bzip2 && \ | ||
apt-get autoclean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Racon | ||
RUN wget https://github.com/lbcb-sci/racon/archive/refs/tags/${RACON_VER}.tar.gz && \ | ||
tar -xvf ${RACON_VER}.tar.gz && \ | ||
cd racon-${RACON_VER} && \ | ||
mkdir build && \ | ||
cd build && \ | ||
cmake -DCMAKE_BUILD_TYPE=Release .. && \ | ||
make | ||
|
||
# Add Racon to PATH | ||
ENV PATH="/racon-${RACON_VER}/build/bin:${PATH}" | ||
|
||
# Test Racon | ||
RUN racon_test | ||
|
||
# Install Minimap2 | ||
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 && \ | ||
mv minimap2-${MINIMAP2_VER}_x64-linux /usr/local/minimap2 | ||
|
||
# Add Minimap2 to PATH | ||
ENV PATH="/usr/local/minimap2:${PATH}" | ||
|
||
# Test Minimap2 | ||
RUN minimap2 --version | ||
|
||
FROM ubuntu:jammy AS app | ||
|
||
ARG RACON_VER | ||
ARG MINIMAP2_VER | ||
|
||
# Metadata | ||
LABEL base.image="ubuntu:jammy" | ||
LABEL dockerfile.version="1" | ||
LABEL software="Racon + Minimap2" | ||
LABEL racon.version="${RACON_VER}" | ||
LABEL software.version="Racon-${RACON_VER}, Minimap2-${MINIMAP2_VER}" | ||
LABEL racon.version="${RACON_VER}" | ||
LABEL minimap2.version="${MINIMAP2_VER}" | ||
LABEL description="Racon for assembly polishing and Minimap2 for alignment" | ||
LABEL website="https://github.com/lbcb-sci/racon, https://github.com/lh3/minimap2" | ||
LABEL license="https://github.com/lbcb-sci/racon/blob/master/LICENSE, https://github.com/lh3/minimap2/blob/master/LICENSE.txt" | ||
LABEL maintainer="Fraser Combe" | ||
LABEL maintainer.email="[email protected]" | ||
|
||
# Install Python and essential tools | ||
RUN apt-get update && apt-get install -y \ | ||
procps \ | ||
wget \ | ||
python3 && \ | ||
apt-get autoclean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy Racon and Minimap2 binaries | ||
COPY --from=builder /racon-${RACON_VER}/build/bin/* /usr/local/bin/ | ||
COPY --from=builder /usr/local/minimap2/* /usr/local/bin/ | ||
|
||
RUN mkdir /data | ||
|
||
WORKDIR /data | ||
|
||
# Set locale settings | ||
ENV PATH=${PATH} LC_ALL=C | ||
|
||
CMD racon --help | ||
|
||
FROM app AS test | ||
|
||
# Test Racon and Minimap2 | ||
RUN racon --help && racon --version && minimap2 --version | ||
|
||
COPY --from=builder /racon-${RACON_VER}/test/data/* /test/ | ||
|
||
WORKDIR /test | ||
|
||
# Minimap2 alignment test | ||
RUN wget -q https://raw.githubusercontent.com/lh3/minimap2/master/test/MT-human.fa && \ | ||
wget -q https://raw.githubusercontent.com/lh3/minimap2/master/test/MT-orang.fa && \ | ||
minimap2 -a MT-human.fa MT-orang.fa > test.sam && \ | ||
head test.sam | ||
|
||
# Example polishing workflow | ||
RUN wget -q https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/prokaryotes/bacteroides_fragilis/genome/genome.paf && \ | ||
wget -q https://github.com/nf-core/test-datasets/raw/modules/data/genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz && \ | ||
wget -q https://github.com/nf-core/test-datasets/raw/modules/data/genomics/prokaryotes/bacteroides_fragilis/nanopore/fastq/test.fastq.gz && \ | ||
minimap2 -x map-ont genome.fna.gz test.fastq.gz > test.paf && \ | ||
racon -t 2 test.fastq.gz test.paf genome.fna.gz > test_polished.fasta && \ | ||
head test_polished.fasta |
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,46 @@ | ||
# Racon + Minimap2 Container | ||
|
||
This container combines [Racon](https://github.com/lbcb-sci/racon) and [Minimap2](https://github.com/lh3/minimap2) for efficient polishing and alignment in long-read assembly workflows. | ||
|
||
## Tools Included | ||
- **Racon**: Polishes long-read assemblies. | ||
- **Minimap2**: Generates alignments for use with Racon and other polishing tools. | ||
|
||
### Code Repositories | ||
- Racon: [GitHub Repository](https://github.com/lbcb-sci/racon) | ||
- Minimap2: [GitHub Repository](https://github.com/lh3/minimap2) | ||
|
||
## Basic Information | ||
|
||
### Racon | ||
- **Executable**: `racon` | ||
- **Help**: `racon -h` | ||
- **Version**: `racon -v` | ||
- **Description**: | ||
> Racon is intended as a standalone consensus module to correct raw contigs generated by rapid assembly methods that do not include a consensus step. | ||
### Minimap2 | ||
- **Executable**: `minimap2` | ||
- **Help**: `minimap2 -h` | ||
- **Version**: `minimap2 --version` | ||
- **Description**: | ||
> Minimap2 is a versatile sequence alignment program that aligns DNA or mRNA sequences against a large reference database. | ||
## Example Usage | ||
|
||
```bash | ||
# Racon general | ||
racon <sequences> <overlaps> <target sequences> | ||
|
||
# more specific | ||
racon --match 8 --mismatch -6 --gap -8 --window-length 500 --threads {threads} {input.reads} {input.alignment} {input.assembly} | ||
|
||
#Combined Racon and Minimap2 Workflow | ||
|
||
#Align Reads to Assembly Using Minimap2: | ||
minimap2 -x map-ont <assembly.fasta> <reads.fastq> > overlaps.paf | ||
|
||
#polish assembly using Racon | ||
racon --threads {threads} <reads.fastq> overlaps.paf <assembly.fasta> > polished_assembly.fasta | ||
``` | ||
|
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