|
| 1 | +ARG MINIPOLISH_VER=0.2.1 |
| 2 | +ARG MINIMAP2_VER=2.30 |
| 3 | +ARG RACON_VER=1.5.0 |
| 4 | +ARG MINIASM_VER=0.3 |
| 5 | + |
| 6 | +FROM ubuntu:noble AS builder |
| 7 | +ARG MINIPOLISH_VER |
| 8 | +ARG MINIMAP2_VER |
| 9 | +ARG RACON_VER |
| 10 | +ARG MINIASM_VER |
| 11 | + |
| 12 | +# Install dependencies |
| 13 | +RUN apt-get update && apt-get install --no-install-recommends -y \ |
| 14 | + perl \ |
| 15 | + default-jre \ |
| 16 | + gnuplot \ |
| 17 | + libgomp1 \ |
| 18 | + maven \ |
| 19 | + git \ |
| 20 | + wget \ |
| 21 | + python3 \ |
| 22 | + build-essential \ |
| 23 | + cmake \ |
| 24 | + zlib1g-dev \ |
| 25 | + curl \ |
| 26 | + bzip2 && \ |
| 27 | + apt-get autoclean && rm -rf /var/lib/apt/lists/* |
| 28 | + |
| 29 | +# Install Racon |
| 30 | +RUN wget https://github.com/lbcb-sci/racon/archive/refs/tags/${RACON_VER}.tar.gz && \ |
| 31 | + tar -xvf ${RACON_VER}.tar.gz && \ |
| 32 | + cd racon-${RACON_VER} && \ |
| 33 | + mkdir build && \ |
| 34 | + cd build && \ |
| 35 | + cmake -DCMAKE_BUILD_TYPE=Release .. && \ |
| 36 | + make |
| 37 | + |
| 38 | +# Add Racon to PATH |
| 39 | +ENV PATH="/racon-${RACON_VER}/build/bin:${PATH}" |
| 40 | + |
| 41 | +# Test Racon |
| 42 | +RUN racon_test |
| 43 | + |
| 44 | +# Install Minimap2 |
| 45 | +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 && \ |
| 46 | + mv minimap2-${MINIMAP2_VER}_x64-linux /usr/local/bin/minimap2 |
| 47 | + |
| 48 | +# miniasm |
| 49 | +RUN wget https://github.com/lh3/miniasm/archive/v${MINIASM_VER}.tar.gz && \ |
| 50 | + mkdir miniasm && \ |
| 51 | + tar -xzvf v${MINIASM_VER}.tar.gz -C miniasm --strip-components 1 && \ |
| 52 | + rm v${MINIASM_VER}.tar.gz && \ |
| 53 | + cd miniasm && \ |
| 54 | + make && \ |
| 55 | + mv miniasm /usr/local/bin/. |
| 56 | + |
| 57 | +FROM ubuntu:noble AS app |
| 58 | +ARG MINIPOLISH_VER |
| 59 | +ARG RACON_VER |
| 60 | + |
| 61 | +# metadata |
| 62 | +LABEL base.image="ubuntu:noble" |
| 63 | +LABEL dockerfile.version="1" |
| 64 | +LABEL software="minipolish" |
| 65 | +LABEL software.version="${MINIPOLISH_VER}" |
| 66 | +LABEL description="Racon polishing for GFA graphs produced by miniasm" |
| 67 | +LABEL website="https://github.com/rrwick/Minipolish" |
| 68 | +LABEL license="https://github.com/rrwick/Minipolish/blob/main/LICENSE" |
| 69 | +LABEL maintainer="Erin Young" |
| 70 | +LABEL maintainer.email="eriny@utah.gov" |
| 71 | + |
| 72 | +# install dependencies via apt-get or yum if using a centos or fedora base |
| 73 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 74 | + wget \ |
| 75 | + ca-certificates \ |
| 76 | + python3-pip && \ |
| 77 | + apt-get autoclean && rm -rf /var/lib/apt/lists/* |
| 78 | + |
| 79 | +COPY --from=builder /racon-${RACON_VER}/build/bin/* /usr/local/bin/ |
| 80 | +COPY --from=builder /usr/local/bin/* /usr/local/bin/ |
| 81 | + |
| 82 | +# install minipolish |
| 83 | +RUN wget https://github.com/rrwick/Minipolish/archive/refs/tags/v${MINIPOLISH_VER}.tar.gz && \ |
| 84 | + tar -vxf v${MINIPOLISH_VER}.tar.gz && \ |
| 85 | + pip install --break-system-packages v${MINIPOLISH_VER}.tar.gz && \ |
| 86 | + rm v${MINIPOLISH_VER}.tar.gz |
| 87 | +# in theory, this can be tested with python3 -m pytest |
| 88 | + |
| 89 | +# set environmental variables e.g. $PATH and locale settings for singularity compatibility |
| 90 | +ENV PATH="/Minipolish-${MINIPOLISH_VER}:${PATH}" \ |
| 91 | + TERM=xterm-256color \ |
| 92 | + LC_ALL=C |
| 93 | + |
| 94 | +# set working directory |
| 95 | +WORKDIR /data |
| 96 | + |
| 97 | +CMD ["minipolish", "--help"] |
| 98 | + |
| 99 | +FROM app AS test |
| 100 | + |
| 101 | +RUN minipolish --help |
| 102 | + |
| 103 | +# checking dependencies |
| 104 | +RUN minimap2 --version && racon --help && miniasm -V |
| 105 | + |
| 106 | +WORKDIR /test |
| 107 | + |
| 108 | +RUN wget https://github.com/rrwick/Unicycler/raw/refs/heads/main/sample_data/long_reads_high_depth.fastq.gz |
| 109 | + |
| 110 | +#RUN miniasm_and_minipolish.sh long_reads_high_depth.fastq.gz 4 > test.gfa && head test.gfa |
| 111 | + |
| 112 | +# Testing the test data without using the wrapper script |
| 113 | +RUN minimap2 -x ava-ont -t 4 long_reads_high_depth.fastq.gz long_reads_high_depth.fastq.gz > overlaps.paf && \ |
| 114 | + miniasm -f long_reads_high_depth.fastq.gz overlaps.paf -s 50 -e 1 > test.gfa && \ |
| 115 | + minipolish --threads 4 long_reads_high_depth.fastq.gz test.gfa > polished.gfa && \ |
| 116 | + head polished.gfa |
0 commit comments