-
Notifications
You must be signed in to change notification settings - Fork 119
/
Dockerfile
215 lines (185 loc) · 5.99 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
ARG VIRIDIAN_VER="1.2.2"
ARG SAMTOOLS_VER="1.20"
ARG BCFTOOLS_VER=${SAMTOOLS_VER}
ARG HTSLIB_VER=${SAMTOOLS_VER}
ARG ENA_VER="1.7.1"
ARG NGMERGE_VER="0.3"
ARG VT_VER="0.57721"
ARG RACON_VER="1.5.0"
ARG MUMMER_VER="4.0.0rc1"
ARG READITANDKEEP_VER="0.3.0"
ARG CYLON_COMMIT_HASH="57d559a76254b0b95785f7c02fa58ef806713e01"
ARG VARIFIER_COMMIT_HASH="8bc8726ed3cdb337dc47b62515e709759e451137"
ARG MINIMAP2_VER="2.28"
## Builder ##
FROM ubuntu:jammy as build
ARG SAMTOOLS_VER
ARG BCFTOOLS_VER
ARG HTSLIB_VER
ARG NGMERGE_VER
ARG VT_VER
ARG RACON_VER
ARG READITANDKEEP_VER
ARG MINIMAP2_VER
ARG MUMMER_VER
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --no-install-recommends -y \
wget \
ca-certificates \
perl \
bzip2 \
cmake \
git \
autoconf \
automake \
make \
curl \
gcc \
g++ \
gnuplot \
zlib1g-dev \
libbz2-dev \
liblzma-dev \
libcurl4-gnutls-dev \
libncurses5-dev \
libssl-dev \
libperl-dev \
libgsl0-dev \
procps \
gawk \
sed \
build-essential \
unzip \
nasm \
pkgconf \
libtool \
ruby \
yaggo \
gcc-11 && \
rm -rf /var/lib/apt/lists/* && apt-get autoclean
# compile bcftools
RUN wget -q https://github.com/samtools/bcftools/releases/download/${BCFTOOLS_VER}/bcftools-${BCFTOOLS_VER}.tar.bz2 && \
tar -xjf bcftools-${BCFTOOLS_VER}.tar.bz2 && \
rm -v bcftools-${BCFTOOLS_VER}.tar.bz2 && \
cd bcftools-${BCFTOOLS_VER} && \
make && \
make install
# compile samtools
RUN wget -q 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
# compile htslib
RUN wget -q https://github.com/samtools/htslib/releases/download/${HTSLIB_VER}/htslib-${HTSLIB_VER}.tar.bz2 && \
tar -vxjf htslib-${HTSLIB_VER}.tar.bz2 && \
rm -v htslib-${HTSLIB_VER}.tar.bz2 && \
cd htslib-${HTSLIB_VER} && \
make && \
make install
# compile NGmerge
RUN wget -q https://github.com/harvardinformatics/NGmerge/archive/refs/tags/v${NGMERGE_VER}.tar.gz && \
tar -vxf v${NGMERGE_VER}.tar.gz && \
cd NGmerge-${NGMERGE_VER} && \
make && \
cp NGmerge /usr/local/bin/.
# compile vt
RUN wget -q https://github.com/atks/vt/archive/refs/tags/${VT_VER}.tar.gz && \
tar -vxf ${VT_VER}.tar.gz && \
cd vt-${VT_VER} && \
make && \
cp vt /usr/local/bin/.
# compile racon
RUN wget -q 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 && \
cp bin/racon /usr/local/bin/.
# compile read-it-and-keep
RUN wget -q https://github.com/GlobalPathogenAnalysisService/read-it-and-keep/archive/refs/tags/v${READITANDKEEP_VER}.tar.gz && \
tar -vxf v${READITANDKEEP_VER}.tar.gz && \
cd read-it-and-keep-${READITANDKEEP_VER}/src && \
make && \
cp readItAndKeep /usr/local/bin/.
# install minimap2 binary
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 && \
cp minimap2-${MINIMAP2_VER}_x64-linux/minimap2 /usr/local/bin
RUN wget -q https://github.com/mummer4/mummer/archive/refs/tags/v${MUMMER_VER}.tar.gz && \
tar -xvf v${MUMMER_VER}.tar.gz && \
cd mummer-${MUMMER_VER} && \
autoreconf -i && \
./configure CXXFLAGS="-std=c++11 -Wno-maybe-uninitialized" LDFLAGS=-static && \
make && \
make install && \
ldconfig
## App ##
FROM ubuntu:jammy as app
ARG VIRIDIAN_VER
ARG ENA_VER
ARG CYLON_COMMIT_HASH
ARG VARIFIER_COMMIT_HASH
LABEL base.image="ubuntu:jammy"
LABEL dockerfile.version="1"
LABEL software="viridian"
LABEL software.version="${VIRIDIAN_VER}"
LABEL description="Ultra-careful amplicon-aware viral assembly for tiled amplicon schemes."
LABEL website="https://github.com/iqbal-lab-org/viridian"
LABEL license="https://github.com/iqbal-lab-org/viridian/blob/master/LICENSE"
LABEL maintainer="Wilson Chan"
LABEL maintainer.email="[email protected]"
LABEL maintainer2="Kutluhan Incekara"
LABEL maintainer2.email="[email protected]"
LABEL maintainer3="Erin Young"
LABEL maintainer3.email="[email protected]"
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-dev \
gzip \
gcc \
perl \
zlib1g \
libncurses5 \
bzip2 \
liblzma-dev \
libcurl4-gnutls-dev \
wget \
&& apt-get autoclean && rm -rf /var/lib/apt/lists/*
COPY --from=build /usr/local/bin/* /usr/local/bin/
COPY --from=build /usr/local/lib/* /usr/local/lib/
RUN pip install --no-cache-dir cython
# ENA tools
RUN wget -q https://github.com/enasequence/enaBrowserTools/archive/refs/tags/v${ENA_VER}.tar.gz && \
tar -xvf v${ENA_VER}.tar.gz && \
rm v${ENA_VER}.tar.gz
RUN wget -q https://github.com/iqbal-lab-org/cylon/archive/${CYLON_COMMIT_HASH}.zip &&\
pip install --no-cache-dir ${CYLON_COMMIT_HASH}.zip && \
rm ${CYLON_COMMIT_HASH}.zip
RUN wget -q https://github.com/iqbal-lab-org/varifier/archive/${VARIFIER_COMMIT_HASH}.zip &&\
pip install --no-cache-dir ${VARIFIER_COMMIT_HASH}.zip && \
rm ${VARIFIER_COMMIT_HASH}.zip
# install viridian
RUN wget -q https://github.com/iqbal-lab-org/viridian/archive/refs/tags/v${VIRIDIAN_VER}.tar.gz && \
pip install --no-cache-dir v${VIRIDIAN_VER}.tar.gz && \
mkdir viridian && \
tar -C viridian --strip-components=1 -xvf v${VIRIDIAN_VER}.tar.gz && \
rm v${VIRIDIAN_VER}.tar.gz
WORKDIR /data
CMD ["viridian", "--help "]
ENV PATH="/enaBrowserTools-${ENA_VER}/python3:$PATH" LC_ALL=C
## Test ##
FROM app as test
WORKDIR /test
RUN cd /viridian && \
pip install --no-cache-dir pytest && \
pytest
RUN viridian run_one_sample --run_accession SRR29437696 --outdir OUT && \
wc -l OUT/consensus.fa.gz OUT/log.json.gz OUT/qc.tsv.gz && \
head OUT/variants.vcf
RUN viridian run_one_sample --run_accession SRR29437696 --outdir OUT2 --keep_bam && \
wc -l OUT2/consensus.fa.gz OUT2/log.json.gz OUT2/qc.tsv.gz OUT2/reference_mapped.bam && \
head OUT2/variants.vcf