forked from StaPH-B/docker-builds
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
126 lines (97 loc) · 3.36 KB
/
Dockerfile
File metadata and controls
126 lines (97 loc) · 3.36 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
# Set global variables
ARG CAT_VER="6.0.1"
ARG SAMTOOLS_VER="1.21"
ARG BWA_VER="0.7.18"
ARG DIAMOND_VER="2.1.10"
FROM ubuntu:jammy AS builder
ARG SAMTOOLS_VER
ARG BWA_VER
ARG DIAMOND_VER
# install dependencies required for compiling samtools
RUN apt-get update && apt-get install --no-install-recommends -y \
libncurses5-dev \
libbz2-dev \
liblzma-dev \
libcurl4-gnutls-dev \
zlib1g-dev \
libssl-dev \
libdeflate-dev \
gcc \
wget \
make \
perl \
bzip2 \
gnuplot \
ca-certificates
# download, compile, and install 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
RUN wget -q 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/
RUN wget -q https://github.com/bbuchfink/diamond/releases/download/v${DIAMOND_VER}/diamond-linux64.tar.gz &&\
tar -C /usr/local/bin -xvf diamond-linux64.tar.gz && \
rm diamond-linux64.tar.gz
# Application Stage
FROM ubuntu:jammy AS app
ARG CAT_VER
LABEL base.image="ubuntu:jammy"
LABEL dockerfile.version="1"
LABEL software="CAT"
LABEL software.version=${CAT_VER}
LABEL description="CAT: a tool for taxonomic classification of contigs and metagenome-assembled genomes (MAGs)."
LABEL website="https://github.com/MGXlab/CAT_pack"
LABEL license.url="https://github.com/MGXlab/CAT_pack/blob/master/LICENSE.md"
LABEL maintainer="Taylor K. Paisie"
LABEL maintainer.email='ltj8@cdc.gov'
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
unzip \
ca-certificates \
python3 \
python3-pip \
prodigal && \
apt-get autoclean && rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/bin/* /usr/local/bin/
RUN wget -q https://github.com/MGXlab/CAT_pack/archive/refs/tags/v${CAT_VER}.tar.gz && \
tar -xvzf v${CAT_VER}.tar.gz && \
chmod +x /CAT_pack-${CAT_VER}/CAT_pack/CAT_pack && \
rm v${CAT_VER}.tar.gz
# Add CAT to PATH
ENV PATH="${PATH}:/CAT_pack-${CAT_VER}/CAT_pack"
CMD ["CAT_pack", "--help"]
WORKDIR /data
# Optional stage: Test data
FROM app AS test
ARG CAT_VER
WORKDIR /data/test
RUN CAT_pack --help && CAT_pack --version
RUN wget -nv --no-check-certificate \
https://raw.githubusercontent.com/taylorpaisie/docker_containers/main/checkm2/1.0.2/burk_wgs.fa \
-O burk_wgs_pos_ctrl.fa &&\
wget -nv --no-check-certificate \
https://merenlab.org/data/refining-mags/files/GN02_MAG_IV_B_1-contigs.fa \
-O GN02_MAG_IV_B_1-contigs.fa
# Prepare testing database
RUN mkdir -p db_tests && \
gzip -d /CAT_pack-${CAT_VER}/tests/data/prepare/small.fa.gz && \
CAT_pack prepare --db_fasta /CAT_pack-${CAT_VER}/tests/data/prepare/small.fa \
--acc2tax /CAT_pack-${CAT_VER}/tests/data/prepare/prot2acc.txt \
--names /CAT_pack-${CAT_VER}/tests/data/prepare/names.dmp \
--nodes /CAT_pack-${CAT_VER}/tests/data/prepare/nodes.dmp \
--db_dir db_tests/
# Running CAT on contigs
RUN CAT_pack contigs -c burk_wgs_pos_ctrl.fa \
-d db_tests/db \
-t db_tests/tax
# Running BAT on a set of MAGs
RUN CAT_pack bins -b GN02_MAG_IV_B_1-contigs.fa \
-d db_tests/db \
-t db_tests/tax
WORKDIR /data