Skip to content

Commit 65c03e3

Browse files
authored
Merge pull request #9 from adriantich/master
Ready to upgrade to v1
2 parents d853ae3 + 9c8026e commit 65c03e3

File tree

106 files changed

+4148
-144622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+4148
-144622
lines changed

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,14 @@ lib/jquery-autocomplete/
4848
lib/pandaseq/
4949
lib/papa/
5050
lib/swarm/
51+
lib/swarm2/
52+
lib/swarm3/
5153
lib/vsearch/
54+
lib/dada2/
55+
lib/lulu/
56+
lib/msi/
57+
lib/miniconda/
58+
lib/DECIPHER/
59+
lib/ASHURE/
60+
lib/miniforge3
61+

Dockerfile

+161-28
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,24 @@ RUN mkdir /app
77
WORKDIR /app
88
COPY jranke.asc /app
99

10+
RUN mkdir /app/lib
11+
1012
# Add the CRAN repos sources for install latest version of R
1113
RUN apt-get update && apt-get install -y dirmngr gnupg apt-transport-https ca-certificates software-properties-common
12-
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
14+
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
1315
RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
1416
#RUN sh -c 'echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/" >> /etc/apt/sources.list'
1517
#RUN apt-key add /app/jranke.asc
1618
#RUN apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'
1719

20+
# ----- install conda ----- #
21+
# RUN curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
22+
COPY lib/miniforge3 /app/lib/miniforge3
23+
RUN bash /app/lib/miniforge3/miniforge3.sh -b
24+
# RUN rm Miniconda3-latest-Linux-x86_64.sh
25+
ENV PATH="/root/miniforge3/bin:${PATH}"
26+
# RUN conda update conda
27+
1828
# Install packages needed for tools
1929
RUN apt-get update && apt-get install -y \
2030
libgit2-dev \
@@ -32,8 +42,12 @@ RUN apt-get update && apt-get install -y \
3242
pigz \
3343
dos2unix \
3444
python3-pip python3-dev python3-numpy python3-biopython \
35-
libc6 \
36-
r-base-dev r-base-core r-recommended r-base-html r-base
45+
libc6
46+
# libcurl4-openssl-dev
47+
48+
RUN apt-get install -y \
49+
r-base-core r-recommended r-base-html r-base r-base-dev \
50+
libfontconfig1-dev
3751

3852

3953
## solving locales issue for biopython
@@ -42,32 +56,14 @@ ENV LC_ALL=en_US.UTF-8
4256
ENV LANG=en_US.UTF-8
4357
ENV LANGUAGE=en_US.UTF-8
4458
RUN dpkg -l locales
45-
46-
#RUN python3 -m pip install biopython --upgrade
47-
48-
RUN mkdir /app/lib
49-
50-
51-
# ----- R dependancies -----
52-
53-
###RUN apt-get -y build-dep libcurl4-gnutls-dev
54-
###RUN apt-get -y install libcurl4-gnutls-dev
55-
RUN R -e 'install.packages("devtools", repos="https://stat.ethz.ch/CRAN/")'
56-
RUN R -e 'install.packages("dplyr", repos="https://stat.ethz.ch/CRAN/")'
57-
RUN R -e 'install.packages("seqinr", repos="https://stat.ethz.ch/CRAN/")'
58-
RUN R -e 'library(devtools);install_github("tobiasgf/lulu")'
59-
RUN R -e 'install.packages("BiocManager",dependencies=TRUE,repos="https://stat.ethz.ch/CRAN/")'
60-
#RUN R -e 'BiocManager::install("DECIPHER")'
61-
#RUN R -e 'BiocManager::install("dada2")'
62-
RUN R -e 'library(devtools);devtools::install_github("benjjneb/dada2", ref="v1.16")'
63-
RUN R -e 'install.packages("https://www.bioconductor.org/packages/3.11/bioc/src/contrib/Archive/DECIPHER/DECIPHER_2.16.0.tar.gz", repos = NULL, type = "source")'#
59+
ENV CXXFLAGS="-std=c++11"
6460

6561

6662
# ----- Libraries deployments -----
6763

6864
# install app dependencies
6965
RUN apt-get install curl -y
70-
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash -
66+
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
7167
RUN apt install nodejs -y
7268
COPY package.json /app
7369
RUN npm install
@@ -77,7 +73,9 @@ COPY lib/DTD /app/lib/DTD
7773
COPY lib/pandaseq /app/lib/pandaseq
7874
COPY lib/vsearch /app/lib/vsearch
7975
COPY lib/casper /app/lib/casper
80-
COPY lib/swarm /app/lib/swarm
76+
COPY lib/swarm2 /app/lib/swarm2
77+
COPY lib/swarm3 /app/lib/swarm3
78+
# COPY lib/sratoolkit /app/lib/sratoolkit
8179

8280
# Compile DTD
8381
RUN cd /app/lib/DTD && make && cd /app
@@ -87,13 +85,142 @@ RUN cd /app/lib/pandaseq && ./autogen.sh && ./configure && make && cd /app
8785
RUN cd /app/lib/vsearch && ./autogen.sh && ./configure && make && cd /app
8886
# Compile casper
8987
RUN cd /app/lib/casper/casper_v0.8.2 && make && cd /app
90-
# Compile swarm
91-
RUN cd /app/lib/swarm/src && make && cd /app
88+
# Compile swarm2
89+
RUN cd /app/lib/swarm2/src && make && cd /app
90+
# Compile swarm3
91+
RUN cd /app/lib/swarm3/src && make && cd /app
9292

93-
# Copy Python and R scripts
93+
# ----- R dependancies -----
94+
95+
COPY lib/lulu /app/lib/lulu
96+
COPY lib/dada2 /app/lib/dada2
97+
98+
RUN R -e 'install.packages("dplyr", repos="https://stat.ethz.ch/CRAN/")'
99+
RUN R -e 'install.packages("seqinr", repos="https://stat.ethz.ch/CRAN/")'
100+
RUN R -e 'install.packages("/app/lib/lulu",repos=NULL)'
101+
RUN R -e 'install.packages("BiocManager",dependencies=TRUE,repos="https://stat.ethz.ch/CRAN/")'
102+
RUN R -e 'install.packages("ggplot2",dependencies=TRUE,repos="https://stat.ethz.ch/CRAN/")'
103+
RUN R -e 'install.packages("reshape2",dependencies=TRUE,repos="https://stat.ethz.ch/CRAN/")'
104+
RUN R -e 'install.packages("RcppParallel",dependencies=TRUE)'
105+
RUN R -e 'install.packages("IRanges",dependencies=TRUE,repos="https://stat.ethz.ch/CRAN/")'
106+
RUN R -e 'install.packages("XVector",dependencies=TRUE,repos="https://stat.ethz.ch/CRAN/")'
107+
RUN R -e 'install.packages("BiocGenerics",dependencies=TRUE,repos="https://stat.ethz.ch/CRAN/")'
108+
RUN R -e 'BiocManager::install("Biostrings")'
109+
RUN R -e 'BiocManager::install("ShortRead")'
110+
RUN R -e 'install.packages("/app/lib/dada2",repos=NULL, dependencies = TRUE)'
111+
COPY lib/DECIPHER /app/lib/DECIPHER
112+
RUN R -e 'install.packages("RSQLite",dependencies=TRUE,repos="https://stat.ethz.ch/CRAN/")'
113+
RUN R -e 'install.packages("/app/lib/DECIPHER",repos=NULL, dependencies = TRUE)'
114+
115+
# ----- install conda dependencies ----- #
116+
RUN apt-get install -y \
117+
clang
118+
119+
# for those packages that require conda install create a new environment
120+
# for each to avoid incompatibilities
121+
122+
# ----- install chopper ----- #
123+
RUN conda create -n chopper python=3.9 -y
124+
# RUN echo "source activate env" >> ~/.bashrc
125+
RUN /bin/bash -c "source activate chopper && \
126+
conda install -c conda-forge libgcc-ng -y && \
127+
conda update -c conda-forge libgcc-ng -y && \
128+
conda install -c conda-forge libstdcxx-ng -y && \
129+
conda update -c conda-forge libstdcxx-ng -y && \
130+
conda install -c conda-forge zlib -y && \
131+
conda update -c conda-forge zlib -y && \
132+
conda install -c bioconda chopper=0.8.0 -y "
133+
134+
# ----- install msi ----- #
135+
COPY lib/msi /app/lib/msi
136+
RUN conda create -n msi python=3.9 -y
137+
RUN /bin/bash -c "source activate msi && \
138+
apt-get update && \
139+
apt-get install emboss -y && \
140+
apt-get install time -y && \
141+
conda install cmake -y && \
142+
conda install -c conda-forge git -y && \
143+
conda install -c conda-forge wget -y && \
144+
conda install -c bioconda java-jdk -y"
145+
# Update and install GCC and G++
146+
RUN apt-get update && apt-get install -y software-properties-common
147+
RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y
148+
RUN apt-get update && apt-get install -y \
149+
gcc-10 \
150+
g++-10
151+
# Set GCC and G++ to the new versions
152+
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 \
153+
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
154+
# # Install the latest libstdc++6
155+
RUN apt-get install -y libstdc++6
156+
# # Verify the installation
157+
RUN gcc --version && g++ --version
158+
# # Check the installed versions of libstdc++
159+
RUN strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
160+
RUN /bin/bash -c "source activate msi && \
161+
conda install -c conda-forge r-base=4.1.0 -y"
162+
# the path used to install BiocManager in metabinkit is not available.
163+
# this is solved if we install BiocManager in the msi environment and
164+
# in the specified path
165+
RUN /bin/bash -c "source activate msi && \
166+
mkdir -p /app/lib/msi/Rlibs && \
167+
R -e \"install.packages('BiocManager',dependencies=TRUE,repos='https://stat.ethz.ch/CRAN/',lib='/app/lib/msi/Rlibs')\""
168+
# RUN /bin/bash -c "source activate msi && \
169+
# R -e \"!requireNamespace('BiocManager', quietly = TRUE)\""
170+
RUN /bin/bash -c "source activate msi && \
171+
/app/lib/msi/scripts/msi_install.sh -i /app/lib/msi"
172+
173+
# ----- install ASHURE ----- #
174+
COPY lib/ASHURE /app/lib/ASHURE
175+
RUN conda create -n ashure python=3.9 -y
176+
# minimap2 has been installed with msi and its located at /app/lib/msi/bin/minimap2
177+
# RUN /bin/bash -c "source activate ashure && \
178+
# /app/lib/msi/bin/minimap2"
179+
# install cmake and git in ashure environment
180+
RUN /bin/bash -c "source activate ashure && \
181+
conda install -c conda-forge cmake git -y"
182+
# install spoa
183+
RUN /bin/bash -c "source activate ashure && \
184+
cd /app/lib/ASHURE/spoa && \
185+
cmake -B build -DCMAKE_BUILD_TYPE=Release && \
186+
make -C build && cd /app"
187+
# install python modules for ASHURE
188+
# due to a deprecation error, pandas need to be previous to 1.4.0
189+
RUN /bin/bash -c "source activate ashure && \
190+
pip install pandas==1.3.3 && \
191+
pip install scikit-learn && \
192+
pip install hdbscan &&\
193+
pip install numpy==1.26.4"
194+
# install ashure
195+
RUN /bin/bash -c "source activate ashure && \
196+
cd /app/lib/ASHURE && \
197+
chmod +x src/ashure.py && \
198+
src/ashure.py run -h && cd /app"
199+
# check if ashure commands are working
200+
RUN /bin/bash -c "source activate ashure && \
201+
/app/lib/ASHURE/src/ashure.py prfg -h && \
202+
/app/lib/ASHURE/src/ashure.py fgs -h && \
203+
/app/lib/ASHURE/src/ashure.py msa -h && \
204+
/app/lib/ASHURE/src/ashure.py fpmr -h"
205+
206+
# ----- copy python_scripts -----
94207
COPY lib/python_scripts /app/lib/python_scripts
208+
209+
# ----- copy R_scripts -----
95210
COPY lib/R_scripts /app/lib/R_scripts
96211

212+
# ----- copy bash_scripts -----
213+
COPY lib/bash_scripts /app/lib/bash_scripts
214+
RUN chmod +x /app/lib/bash_scripts/*
215+
216+
# ----- correction on msi source code -----
217+
RUN sed -i 's/\/dev\/stderr/stderr_msi/g' /app/lib/msi/bin/bam_annotate.sh /app/lib/msi/bin/fastq2bam /app/lib/msi/bin/fastq_validator.sh /app/lib/msi/*/msi /app/lib/msi/exe/metabinkit_blastgendb
218+
# RUN sed -i 's/ nmembers / \$nmembers /g' /app/lib/msi/bin/msi_clustr_add_size.pl /app/lib/msi/scripts/msi_clustr_add_size.pl
219+
RUN cd /app/lib/msi/seqtk && make && cd /app
220+
221+
# updates on biopython
222+
RUN python3 -m pip install biopython --upgrade
223+
97224
# ----- Webserver -----
98225

99226
# prepare the web server
@@ -108,9 +235,15 @@ RUN cp node_modules/jquery/dist/jquery.js /app/www/js/jquery.js
108235
COPY lib/jquery-autocomplete/dist/jquery.autocomplete.js /app/www/js/jquery.autocomplete.js
109236
COPY lib/papa/papaparse.js /app/www/js/papaparse.js
110237

238+
# use browserify to create the bundle.js file
239+
# RUN browserify /app/www/js/upload_SRA.js -o /app/www/js/bundle.js
240+
111241
# prepare data folder
112242
RUN mkdir /app/data
113243

244+
RUN apt update --fix-missing
245+
RUN apt install vim -y
246+
114247

115248
# commamd executed to run the server
116-
CMD ["npm", "start"]
249+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)