Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
229 lines (200 loc) · 8.96 KB
/
Copy pathDockerfile
File metadata and controls
229 lines (200 loc) · 8.96 KB
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
FROM debian:bookworm-slim AS binary
LABEL authors="Erik Garrison, Simon Heumos, Andrea Guarracino"
LABEL description="Preliminary docker image containing all requirements for pggb pipeline"
LABEL base_image="debian:bookworm-slim"
LABEL software="pggb"
LABEL about.home="https://github.com/pangenome/pggb"
LABEL about.license="SPDX:MIT"
# dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
bash \
cmake \
make \
g++-11 \
python3-dev \
python3-pip \
python3-venv \
pybind11-dev \
libbz2-dev \
bc \
libatomic-ops-dev \
autoconf \
libgsl-dev \
zlib1g-dev \
libzstd-dev \
libjemalloc-dev \
libhts-dev \
build-essential \
pkg-config \
time \
curl \
pigz \
tabix \
samtools \
wget \
pip \
libcairo2-dev \
unzip \
parallel \
r-base \
libclang-dev \
gnuplot \
&& apt-get clean \
&& apt-get purge \
&& rm -rf /var/lib/apt/lists/*
# current bcftools
RUN wget https://github.com/samtools/bcftools/releases/download/1.19/bcftools-1.19.tar.bz2 \
&& tar xjf bcftools-1.19.tar.bz2 \
&& cd bcftools-1.19/ && ./configure --prefix=/usr/local/bin/ && make && make install && export PATH=/usr/local/bin/bin:$PATH && cd .. && cp /usr/local/bin/bin/* /usr/local/bin/
# AGC (Assembled Genomes Compressor): the agc binary lets pggb list and extract the sequences
# of an .agc input, and libagc is linked into wfmash so it can read archives directly.
# PLATFORM=sse2 keeps the build portable (AGC defaults to -march=native).
# Only the few files wfmash links against are kept, the source tree is dropped.
RUN git clone --recursive --branch v3.2.1 https://github.com/refresh-bio/agc /opt/agc-src \
&& cd /opt/agc-src \
&& make PLATFORM=sse2 -j $(nproc) \
&& cp bin/agc /usr/local/bin/agc \
&& mkdir -p /opt/agc/bin /opt/agc/src/lib-cxx /opt/agc/3rd_party/zstd/lib \
&& cp bin/libagc.a /opt/agc/bin/ \
&& cp src/lib-cxx/agc-api.h /opt/agc/src/lib-cxx/ \
&& cp 3rd_party/zstd/lib/libzstd.a /opt/agc/3rd_party/zstd/lib/ \
&& cd / \
&& rm -rf /opt/agc-src
RUN git clone --recursive https://github.com/waveygang/wfmash \
&& cd wfmash \
&& git pull \
&& git checkout v0.14.1 \
&& git submodule update --init --recursive \
&& find . \( -name CMakeLists.txt -o -name Makefile \) -exec sed -i 's/-march=native/-march=x86-64-v2/g' {} + \
&& cmake -H. -DCMAKE_BUILD_TYPE=Generic -DEXTRA_FLAGS='-march=x86-64-v2 -Ofast' -DAGC_ROOT=/opt/agc -Bbuild && cmake --build build -- -j $(nproc) \
&& cp build/bin/wfmash /usr/local/bin/wfmash \
# Libraries aren't getting installed
&& cp build/lib/* /usr/local/lib/ \
&& cp scripts/paf2dotplot /usr/local/bin/paf2dotplot \
&& chmod +x /usr/local/bin/paf2dotplot \
&& sed -i 's/kill 1, \$child;/kill 1, \$child if \$child > 1;/' /usr/local/bin/paf2dotplot \
&& cd ../ \
&& rm -rf wfmash
RUN git clone --recursive https://github.com/pangenome/smoothxg \
&& cd smoothxg \
&& git pull \
&& git checkout 0ea0470a6034b29776689b05b75916c609d06d1e \
&& git submodule update --init --recursive \
&& find . \( -name CMakeLists.txt -o -name Makefile \) -exec sed -i 's/-march=native/-march=x86-64-v2/g' {} + \
&& sed -i 's/-msse4.1/-march=x86-64-v2/g' deps/spoa/CMakeLists.txt \
&& cmake -H. -DCMAKE_BUILD_TYPE=Generic -DEXTRA_FLAGS='-march=x86-64-v2 -Ofast' -Bbuild && cmake --build build -- -j $(nproc) \
&& cp bin/smoothxg /usr/local/bin/smoothxg \
&& cp deps/odgi/bin/odgi /usr/local/bin/odgi \
&& cd ../ \
&& rm -rf odgi
# Rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN cargo --help
# seqwish is a Rust crate, so it is built after the Rust toolchain is available.
# RUSTFLAGS overrides the target-cpu=native in the crate's .cargo/config.toml, which would
# otherwise bake the build machine's instruction set (AVX) into the image.
RUN git clone https://github.com/pangenome/seqwish \
&& cd seqwish \
&& git checkout aab5beeb8d734134dfb7cc0c44fc5a38cb580a4b \
&& RUSTFLAGS="-C target-cpu=x86-64-v2" cargo install --force --locked --path . \
&& mv /root/.cargo/bin/seqwish /usr/local/bin/seqwish \
&& cd ../ \
&& rm -rf seqwish
RUN git clone https://github.com/marschall-lab/GFAffix.git \
&& cd GFAffix \
&& git pull \
&& git checkout 460e0dd798a9da7d12aef4f9181419d71489da95 \
&& cargo install --force --path . \
&& mv /root/.cargo/bin/gfaffix /usr/local/bin/gfaffix \
&& cd ../ \
&& rm -rf GFAffix
RUN wget https://github.com/vgteam/vg/releases/download/v1.71.0/vg && chmod +x vg && mv vg /usr/local/bin/vg
RUN git clone https://github.com/pangenome/vcfbub \
&& cd vcfbub \
&& git pull \
&& git checkout 77289654b246a4e3422902d04277e258d9fabe9a \
&& cargo install --force --locked --path . \
&& mv /root/.cargo/bin/vcfbub /usr/local/bin/vcfbub \
&& cd ../ \
&& rm -rf vcfbub
RUN git clone --recursive https://github.com/vcflib/vcflib.git \
&& cd vcflib \
&& git checkout b118a9bfd99b07da9d40d0bd8b3c2bdc4523b568 \
&& mkdir -p build \
&& cd build \
&& cmake -DZIG=OFF -DCMAKE_BUILD_TYPE=Debug -DWFA_GITMODULE=ON .. && cmake --build . -- -j $(nproc) \
&& mv vcfwave /usr/local/bin/vcfwave \
&& mv vcfuniq /usr/local/bin/vcfuniq \
&& cd ../ \
&& rm -rf vcflib
# Additional tools
RUN git clone https://github.com/ekg/fastix.git \
&& cd fastix \
&& git pull \
&& git checkout 331c1159ea16625ee79d1a82522e800c99206834 \
&& cargo install --force --locked --path . && \
mv /root/.cargo/bin/fastix /usr/local/bin/fastix \
&& cd ../ \
&& rm -rf fastix
RUN PORTABLE=1 git clone --recursive https://github.com/pangenome/impg.git \
&& cd impg \
&& git pull \
&& git checkout f773342a75da244f05bc93663857b77c3bc8a9f7 \
&& git submodule update --init --recursive \
&& PORTABLE=1 cargo install --force --locked --path . \
&& mv /root/.cargo/bin/impg /usr/local/bin/impg \
&& cd ../ \
&& rm -rf impg
RUN git clone https://github.com/pangenome/gfalook.git \
&& cd gfalook \
&& git pull \
&& git checkout 5199d77ecc4980b181177c16b94f6e56c0d06e4c \
&& cargo install --force --locked --path . \
&& mv /root/.cargo/bin/gfalook /usr/local/bin/gfalook \
&& cd ../ \
&& rm -rf gfalook
RUN git clone https://github.com/ekg/pafplot.git \
&& cd pafplot \
&& git pull \
&& git checkout 2785b0ef30d37300afc77fd4b04d1d949c143551 \
&& cargo install --force --locked --path . \
&& mv /root/.cargo/bin/pafplot /usr/local/bin/ \
&& cd ../ \
&& rm -rf pafplot
COPY pggb /usr/local/bin/pggb
RUN chmod 777 /usr/local/bin/pggb
COPY partition-before-pggb /usr/local/bin/partition-before-pggb
RUN chmod a+rx /usr/local/bin/partition-before-pggb
# MUMMER adjustments
RUN wget https://github.com/mummer4/mummer/releases/download/v4.0.0rc1/mummer-4.0.0rc1.tar.gz \
&& tar -xf mummer-4.0.0rc1.tar.gz && cd mummer-4.0.0rc1 && ./configure && make && make install && cd ../
RUN ldconfig
RUN wget https://github.com/RealTimeGenomics/rtg-tools/releases/download/3.12.1/rtg-tools-3.12.1-linux-x64.zip \
&& unzip rtg-tools-3.12.1-linux-x64.zip && sed -i 's/read -r -p "Would you like to enable automatic usage logging (y\/n)? " REPLY/REPLY="n"/g' /rtg-tools-3.12.1/rtg \
&& ln -s /rtg-tools-3.12.1/rtg /usr/local/bin/ && rtg help
# Install R package
RUN wget https://cran.r-project.org/src/contrib/Archive/data.table/data.table_1.15.2.tar.gz \
&& R CMD INSTALL data.table_1.15.2.tar.gz \
&& rm data.table_1.15.2.tar.gz
RUN wget https://github.com/arq5x/bedtools2/releases/download/v2.31.0/bedtools.static \
&& mv bedtools.static /usr/local/bin/bedtools \
&& chmod +x /usr/local/bin/bedtools
# Set up Python virtual environment
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# Install Python packages in virtual environment
RUN pip install multiqc==1.33 \
&& pip install igraph==1.0.0 \
&& pip install pycairo==1.29.0
# copy required scripts
COPY scripts/* /usr/local/bin/
COPY scripts /usr/local/bin/scripts/
# Hacky-way to easily get versioning info
COPY .git /usr/local/bin/
# .git is root-owned, so `git describe` in /usr/local/bin fails with "dubious
# ownership" when the container runs as another user; trust the directory
RUN git config --system --add safe.directory /usr/local/bin
SHELL ["/bin/bash", "-c"]