-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
151 lines (124 loc) · 3.85 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
FROM condaforge/miniforge3:23.3.1-1
ARG MLST_VER=2.23.0
ARG ANY2FASTA_VER=0.4.2
ARG SAMTOOLSVER=1.16.1
ARG SAMBAMBAVER=0.8.2
ARG BBTOOLSVER=39.01
ARG PHX_VER=2.0.0
LABEL base.image="condaforge/miniforge3:23.3.1-1"
LABEL dockerfile.version="1"
LABEL software="ODHL_AR"
LABEL description="ODHL_AR Pipeline"
LABEL maintainer="Michal Babinski"
LABEL maintainer2="Andrew Hale"
LABEL maintainer.email="[email protected]"
LABEL maintainer2.email="[email protected]"
ENV LC_ALL=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
ca-certificates \
libmoo-perl \
liblist-moreutils-perl \
libjson-perl \
gzip \
file \
build-essential \
libbz2-dev \
liblzma-dev \
libncurses5-dev \
python3-dev \
python3-pip \
libssl-dev \
libreadline-dev \
libsqlite3-dev \
make \
llvm \
tk-dev \
libffi-dev \
bc \
pigz \
rsync \
unzip \
tar \
curl \
git \
&& apt-get autoclean \
&& rm -rf /var/lib/apt/lists/*
# Create and activate conda environment with specific Python version for Phoenix
RUN mamba create -y --name odhl -c conda-forge -c bioconda -c defaults \
python=3.7 \
biopython \
pandas \
numpy \
openpyxl \
pyyaml \
&& conda clean -a
# Install additional Python packages for Phoenix
SHELL ["conda", "run", "-n", "odhl", "/bin/bash", "-c"]
# Install fastqc first (usually has fewer dependencies)
RUN mamba install -y -c bioconda fastqc=0.12.1 && conda clean -a
# Install fastani
RUN mamba install -y -c bioconda fastani=1.34 && conda clean -a
# Install SPAdes with more flexible versioning
RUN mamba install -y -c bioconda spades=3.15 && conda clean -a
# Try AMRFinderPlus with a more flexible version
RUN mamba install -y -c bioconda ncbi-amrfinderplus=3.12.8 && conda clean -a
# And fastp
RUN mamba install -y -c bioconda fastp=0.24 && conda clean -a
# And mash
RUN mamba install -y -c bioconda mash && conda clean -a
# Gamma
RUN mamba install -y -c bioconda gamma && conda clean -a
# Bioconda install of mlst
RUN mamba install -y -c bioconda mlst=2.23.0 && conda clean -a
# We need this specific version of blast
RUN mamba install -y -c bioconda blast=2.14.1 && conda clean -a
# Install remaining tools
RUN mamba install -y -c bioconda -c conda-forge \
kraken2 \
prokka \
quast \
samtools \
nextflow \
&& conda clean -a
RUN pip install \
glob2 \
argparse \
unidecode \
regex \
times \
xlsxwriter \
cryptography==36.0.2 \
pytest-shutil \
pyre2
# Install MLST and set up database
RUN wget https://github.com/tseemann/mlst/archive/v${MLST_VER}.tar.gz && \
tar -xzf v${MLST_VER}.tar.gz && \
rm v${MLST_VER}.tar.gz && \
cd /mlst-${MLST_VER} && \
chmod 755 --recursive db/*
# Add MLST to PATH
ENV PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/mlst-${MLST_VER}/bin:${PATH}"
WORKDIR /opt
# Download and install sambamba
RUN wget --progress=dot:giga https://github.com/biod/sambamba/releases/download/v${SAMBAMBAVER}/sambamba-${SAMBAMBAVER}-linux-amd64-static.gz && \
gzip -d sambamba-${SAMBAMBAVER}-linux-amd64-static.gz && \
mv /opt/sambamba-${SAMBAMBAVER}-linux-amd64-static /opt/sambamba && \
chmod +x /opt/sambamba && \
ln -s /opt/sambamba /usr/local/bin
# Download and install bbtools
RUN wget --progress=dot:giga https://sourceforge.net/projects/bbmap/files/BBMap_${BBTOOLSVER}.tar.gz && \
tar -xzf BBMap_${BBTOOLSVER}.tar.gz && \
rm BBMap_${BBTOOLSVER}.tar.gz && \
ln -s /opt/bbmap/*.sh /usr/local/bin/
WORKDIR /data
RUN conda init bash
RUN echo "conda activate odhl" >> ~/.bashrc
# Set up conda environment path
ENV CONDA_PREFIX=/opt/conda/envs/odhl
ENV PATH=$CONDA_PREFIX/bin:$PATH
COPY . /ODHL_AR
RUN chmod +x /ODHL_AR/main.nf
CMD ["/bin/bash"]