Skip to content

Commit ab84b13

Browse files
release 2025-03-26 (#594)
1 parent 3c852c7 commit ab84b13

File tree

1 file changed

+294
-0
lines changed

1 file changed

+294
-0
lines changed

rsat/2025-03-26/Dockerfile

Lines changed: 294 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,294 @@
1+
## <---- Create a clone of Ubuntu image
2+
FROM ubuntu:focal
3+
4+
## <----- METADATA
5+
LABEL base_image="ubuntu:focal"
6+
LABEL version="1"
7+
LABEL about.summary="Tools to analyse cis elements in genomes: motif discovery, TF factor binding analysis, comparative genomics, regulatory variations"
8+
LABEL software="rsat"
9+
LABEL software.version="2025-03-26"
10+
LABEL about.tags="implemented-in::perl,R,python,C"
11+
LABEL about.home="http://rsat.eu"
12+
LABEL extra.identifiers.biotools="rsat"
13+
LABEL about.software="https://github.com/rsa-tools/rsat-code"
14+
LABEL about.documentation="https://github.com/rsa-tools"
15+
LABEL about.license="AGPL-3.0-only"
16+
LABEL about.license_file="see also licenses at $RSAT/public_html/motif_databasess"
17+
LABEL maintainer="rsat-developers@list01.bio.ens.psl.eu"
18+
19+
## <----- maintainers
20+
MAINTAINER "rsat-developers@list01.bio.ens.psl.eu"
21+
22+
## <---- Prevent to open interactive dialogs during the installation process
23+
ENV DEBIAN_FRONTEND=noninteractive
24+
25+
## <---- Set the language environment in the docker container: should be included before installing any other package
26+
RUN apt-get update \
27+
&& apt-get install -y locales \
28+
&& locale-gen en_US.UTF-8 \
29+
&& update-locale LANG=en_US.UTF-8 \
30+
&& apt-get autoremove
31+
32+
ENV LANG en_US.UTF-8
33+
ENV LANGUAGE en_US.UTF-8
34+
ENV LC_ALL en_US.UTF-8
35+
36+
## <---- Install required packages, including git
37+
RUN apt-get install -y --no-install-recommends \
38+
apt-transport-https \
39+
git \
40+
wget \
41+
less \
42+
vim-tiny \
43+
vim \
44+
time \
45+
lsb-release \
46+
# gnupg2 needed for gpg command and FOR R key installation
47+
gnupg2 \
48+
dirmngr \
49+
ca-certificates\
50+
software-properties-common \
51+
# optimize the space in your docker
52+
&& rm -rf /var/lib/apt/lists/*
53+
54+
55+
## <---- Add the CRAN repository to your system sources list
56+
# commented out, use Ubuntu's instead, r-color-brewer complained
57+
##RUN echo "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" > /etc/apt/sources.list.d/cran.list
58+
##RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 \
59+
## && gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9| apt-key add -
60+
61+
62+
## <---- Now install R and littler, and create a link for littler in /usr/local/bin
63+
## <---- Also set a default CRAN repo, and make sure littler knows about it too
64+
RUN apt-get update \
65+
&& apt-get install -y --no-install-recommends \
66+
littler \
67+
r-cran-littler \
68+
r-base \
69+
r-base-dev \
70+
r-recommended \
71+
r-cran-rcolorbrewer \
72+
&& echo 'options(repos = c(CRAN = "https://cloud.r-project.org/"), download.file.method = "libcurl")' >> /etc/R/Rprofile.site \
73+
&& echo 'source("/etc/R/Rprofile.site")' >> /etc/littler.r \
74+
&& ln -s /usr/share/doc/littler/examples/install.r /usr/local/bin/install.r \
75+
&& ln -s /usr/share/doc/littler/examples/install2.r /usr/local/bin/install2.r \
76+
&& ln -s /usr/share/doc/littler/examples/installGithub.r /usr/local/bin/installGithub.r \
77+
&& ln -s /usr/share/doc/littler/examples/testInstalled.r /usr/local/bin/testInstalled.r \
78+
&& install.r docopt \
79+
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds \
80+
&& rm -rf /var/lib/apt/lists/*
81+
82+
83+
## <---- Now we will install RSAT from the GitHub repository; requires git see,
84+
# https://rsa-tools.github.io/installing-RSAT/unix-install-rsat/installing_RSAT_procedure.html#5_Configuring_RSAT
85+
#RUN apt-get update \
86+
# && apt-get install -y --no-install-recommends \
87+
# git \
88+
# git-lfs \
89+
# && rm -rf /var/lib/apt/lists/*
90+
91+
92+
## <---- Create INSTALL_ROOT directory and set as working directory:
93+
ENV INSTALL_ROOT=/packages
94+
RUN echo $INSTALL_ROOT \
95+
&& mkdir -p ${INSTALL_ROOT}/
96+
WORKDIR /packages
97+
98+
99+
## <---- Actually clone RSAT repository into your working dir and rename to rsat
100+
RUN git clone https://github.com/rsa-tools/rsat-code.git --branch 2025-03-26 --single-branch
101+
RUN mv rsat-code rsat
102+
103+
# Repositories 'demo_files' and 'sample_ouput' are skipped to save space
104+
# git clone https://github.com/rsa-tools/demo_files.git
105+
# git clone https://github.com/rsa-tools/sample_outputs.git
106+
107+
## <---- Download licensed motif_databases, move to /packages/motif_databases and symb link
108+
RUN wget --no-parent -r --reject "index.html*" https://rsat.eead.csic.es/plants/motif_databases/ \
109+
&& mv /packages/rsat.eead.csic.es/plants/motif_databases/ /packages \
110+
&& rm -rf /packages/rsat.eead.csic.es
111+
RUN cd rsat/public_html/ \
112+
&& ln -s ../../motif_databases/
113+
114+
115+
## <---- Remove bulky motif_databases
116+
RUN rm -rf /packages/motif_databases/cisBP2
117+
RUN grep -v cisBP2 /packages/motif_databases/db_matrix_files.tab > /packages/motif_databases/db_matrix_files.filt.tab
118+
RUN mv /packages/motif_databases/db_matrix_files.filt.tab /packages/motif_databases/db_matrix_files.tab
119+
120+
121+
## <---- Declare the environment path and set the new working directory
122+
ENV RSAT /packages/rsat
123+
RUN echo $RSAT
124+
WORKDIR $RSAT
125+
126+
## <---- define your IP, this step is needed to have access to web interface
127+
ENV MY_IP "localhost"
128+
RUN echo "MY_IP ${MY_IP}"
129+
130+
## <----Choose your RSAT site name
131+
ENV RSAT_SITE=my_rsat
132+
133+
## <---- Configure RSAT to be used internally and in web server, this step is needed to generate the RSAT_config.bashrc
134+
RUN perl perl-scripts/configure_rsat.pl -auto rsat=${RSAT} rsat_site=${RSAT_SITE} rsat_www=http://${MY_IP}/rsat/ \
135+
rsat_ws=http://${MY_IP}/rsat/ package_manager="apt-get" ucsc_tools=1 ensembl_tools=1
136+
137+
138+
139+
## <---- Read config and run bash installation scripts: requires sudo and apt-utils
140+
RUN apt-get update \
141+
&& apt-get install -y --no-install-recommends \
142+
sudo \
143+
apt-utils
144+
145+
######################################################## Notes ########################################################
146+
# To run the bash installation scripts, we need sudo access
147+
# To run source RSAT_config.bashrc we need a bash shell; however, the default shell for RUN instructions is ["/bin/sh", "-c"].
148+
# Using SHELL instruction SHELL ["/bin/bash", "-c"], we can change default shell for subsequent RUN instructions in Dockerfile
149+
# then RUN "source file" # now translates to: RUN /bin/bash -c "source file"
150+
151+
152+
## <---- switch to bash
153+
SHELL ["/bin/bash", "-c"]
154+
155+
156+
## <---- make sure you are in your working dir
157+
RUN cd ${RSAT}
158+
WORKDIR ${RSAT}
159+
160+
161+
## <---- Read config and run bash installation scripts
162+
RUN source /packages/rsat/RSAT_config.bashrc \
163+
&& bash installer/01_ubuntu_packages.bash \
164+
&& bash installer/02_python_packages.bash
165+
166+
######################################################## Notes ########################################################
167+
# When installinng python dependencies you might error with rpy2-3.5.12.tar.gz or PySimpleSOAP-1.16.2.tar.gz
168+
# "note: This error originates from a subprocess, and is likely not a problem with pip"
169+
# To fix this, we need to pgrade versions of pip, setuptools and wheel -> see installer/02_python_packages.bash
170+
# end https://bobbyhadz.com/blog/python-note-this-error-originates-from-subprocess
171+
172+
RUN bash installer/03_install_rsat.bash \
173+
&& bash installer/04_perl_packages.bash \
174+
# && bash installer/06_install_organisms.bash \ skipped to save 243MB
175+
&& bash installer/07_R-and-packages.bash \
176+
&& bash installer/08_apache_config.bash \
177+
&& bash installer/10_clean_unnecessary_files.bash
178+
179+
180+
RUN echo "source ${RSAT}/RSAT_config.bashrc" >> /etc/bash.bashrc \
181+
&& echo "service apache2 start" >> /etc/bash.bashrc
182+
183+
184+
185+
## <---- remove some uneeded folders to save space
186+
RUN rm -rf ${RSAT}/ext_lib/ensemblgenomes*/ensembl-*/modules/t \
187+
${RSAT}/ext_lib/ensemblgenomes*/ensembl-*/.git \
188+
${RSAT}/ext_lib/bioperl*/bioperl-live/t \
189+
${RSAT}/ext_lib/bioperl*/bioperl-live/.git \
190+
${RSAT}/.git
191+
192+
193+
## <---- add new user called rsat_user and give it permission to $RSAT
194+
ENV RSATUSER="rsat_user"
195+
ENV RSATPASS="rsat_2020"
196+
ENV RSATUSERHOME="/home/${RSATUSER}"
197+
ENV TESTPATH="${RSATUSERHOME}/test_data"
198+
ENV MOTIFPATH="/packages/motif_databases"
199+
ENV EXTMOTIFPATH="/packages/motif_databases/ext_motifs"
200+
201+
RUN useradd ${RSATUSER} \
202+
&& echo "${RSATUSER}:${RSATPASS}" | chpasswd \
203+
&& adduser ${RSATUSER} sudo \
204+
&& chown -R "${RSATUSER}:${RSATUSER}" ${RSAT} \
205+
&& chmod 755 ${RSAT} \
206+
&& mkdir -p ${TESTPATH} \
207+
&& mkdir -p ${EXTMOTIFPATH} \
208+
&& chmod -R a+w ${RSATUSERHOME}
209+
210+
## <---- Set env variables
211+
ENV R_LIBS_SITE="${RSAT}/R-scripts/Rpackages/"
212+
ENV PATH="${PATH}:${RSAT}/ext_lib/ensemblgenomes-44-97/ensembl-git-tools/bin:${RSAT}/python-scripts:${RSAT}/perl-scripts/parsers:${RSAT}/perl-scripts:${RSAT}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
213+
214+
## <---- Create new folder with test _data
215+
ENV TESTMAKEURL="https://raw.github.com/eead-csic-compbio/coexpression_motif_discovery/master/makefile/peak-motifs.mk"
216+
ENV TESTRSATURL="https://raw.github.com/eead-csic-compbio/coexpression_motif_discovery/master/peach/Modules/M11"
217+
ENV TESTRSATFILEREMOTE="${TESTRSATURL}/genesM11.txt"
218+
ENV TESTRSATFILELOCAL="${TESTPATH}/M11.txt"
219+
ENV TESTMAKEFILELOCAL="${TESTPATH}/peak-motifs.mk"
220+
221+
RUN wget ${TESTRSATFILEREMOTE} -O ${TESTRSATFILELOCAL}
222+
RUN wget ${TESTMAKEURL} -O ${TESTMAKEFILELOCAL}
223+
224+
# not needed unless installer/06_install_organisms.bash is run above
225+
## <---- Rename the container's folder for installing genomes, local volume to be used instead,
226+
# this also allows to use preinstalled genomes elsewhere in the file system.
227+
#
228+
# Note that ${RSAT}/public_html/data_container takes 243MB including
229+
# Escherichia_coli_GCF_000005845.2_ASM584v2
230+
# Escherichia_coli_K_12_substr__MG1655_uid57779
231+
# Saccharomyces_cerevisiae
232+
#
233+
# This is a a result of installer/06_install_organisms.bash
234+
#RUN mv ${RSAT}/public_html/data ${RSAT}/public_html/data_container
235+
236+
## <---- set default user and path
237+
USER ${RSATUSER}
238+
239+
WORKDIR "/home/${RSATUSER}"
240+
241+
242+
243+
################################# Useful command lines #################################
244+
#
245+
#
246+
## 1) Build RSAT Docker container
247+
#
248+
# export RSATDOCKERVERSION=`date '+%Y%m%d'`
249+
# docker build --tag rsat:$RSATDOCKERVERSION --tag rsat:latest --force-rm --compress .
250+
#
251+
#
252+
## 2) Create local folders for input data and results, outside the container, as these might be large
253+
#
254+
# mkdir -p ~/rsat_data/genomes ~/rsat_results
255+
# chmod -R a+w ~/rsat_data/genomes ~/rsat_results
256+
#
257+
#
258+
## 3) Launch Docker RSAT container:
259+
#
260+
# docker run --rm -v ~/rsat_data:/packages/rsat/public_html/data/ -v ~/rsat_results:/home/rsat_user/rsat_results -it rsat:latest
261+
#
262+
#
263+
## 4) Download organism from public RSAT server, such as the Plants server.
264+
## Other available servers: http://fungi.rsat.eu, http://metazoa.rsat.eu, http://protists.rsat.eu
265+
#
266+
# download-organism -v 2 -org Prunus_persica.Prunus_persica_NCBIv2.38 -server https://rsat.eead.csic.es/plants
267+
#
268+
#
269+
## 5) Test container
270+
#
271+
# cd rsat_results
272+
# make -f ../test_data/peak-motifs.mk RNDSAMPLES=2 all
273+
#
274+
#
275+
## 6) Install any organism, please follow
276+
## https://rsa-tools.github.io/managing-RSAT/genome_installation/install_organisms_FASTA_GTF.html
277+
#
278+
#
279+
## 7) To connect to RSAT Web server running from Docker
280+
#
281+
# If you run Docker as a normal user Apache will not start properly and you will see these messages:
282+
#
283+
# * Starting Apache httpd web server apache2
284+
# (13)Permission denied: AH00091: apache2: could not open error log file /var/log/apache2/error.log.
285+
# AH00015: Unable to open logs
286+
# Action 'start' failed.
287+
# The Apache error log may have more information
288+
#
289+
# If you really want lo launch the Docker Web server launch tge container and do (see RSATPASS above):
290+
#
291+
# sudo service apache2 restart
292+
# hostname -I
293+
#
294+
# open the following URL in your browser, using the obtained the IP address: http://172.17.0.2/rsat

0 commit comments

Comments
 (0)