Skip to content
Snippets Groups Projects
Commit 40991f94 authored by thesanc's avatar thesanc
Browse files

update tutorial, remove obitools3 and add other packages

parent c75e8c80
No related branches found
No related tags found
No related merge requests found
...@@ -8,47 +8,49 @@ ENV DEFAULT_USER=rstudio ...@@ -8,47 +8,49 @@ ENV DEFAULT_USER=rstudio
ENV PANDOC_VERSION=default ENV PANDOC_VERSION=default
ENV PATH=/usr/lib/rstudio-server/bin:$PATH ENV PATH=/usr/lib/rstudio-server/bin:$PATH
# install dependencies # install base packages
RUN apt-get update -y RUN apt-get update -y
RUN apt-get install -y wget RUN apt-get install -y build-essential
RUN apt-get install -y wget htop vim nano man cmake git
# install python
RUN apt-get install -y python2 RUN apt-get install -y python2
RUN apt-get install -y python3 RUN apt-get install -y python3
RUN apt-get install -y python3-pip RUN apt-get install -y python3-pip
RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
RUN python2 get-pip.py RUN python2 get-pip.py
RUN apt-get install -y autoconf
RUN apt-get install -y python3-pyqt5
RUN apt-get install -y git
RUN apt-get install -y cmake
RUN apt-get install -y python3-dev
RUN pip3 install cython
# install ecoPCR # dependencies
RUN apt-get install -y ecopcr RUN apt-get update -y
#WORKDIR /app/ecopcr/src/ RUN apt-get install -y mc zlib1g zlib1g-dev libghc-bzlib-dev liblzma-dev libxml2 libxml2-dev libigraph-dev autoconf
#RUN make
#RUN echo "export PATH=$PATH:/app/ecopcr/src/" >> /home/rstudio/.bashrc
RUN /rocker_scripts/install_rstudio.sh
RUN /rocker_scripts/install_pandoc.sh
# install R packages # install R packages
RUN /rocker_scripts/install_rstudio.sh
RUN /rocker_scripts/install_pandoc.sh
RUN R -e "install.packages('tidyverse')" RUN R -e "install.packages('tidyverse')"
# install dada2
RUN R -e "install.packages('BiocManager')" RUN R -e "install.packages('BiocManager')"
RUN R -e "BiocManager::install('dada2', version = '3.16')" RUN R -e "BiocManager::install('ShortRead')"
RUN R -e "BiocManager::install('Biostrings')"
RUN R -e "BiocManager::install('phyloseq')"
RUN R -e "BiocManager::install('dada2')"
RUN R -e "install.packages('devtools')"
RUN R -e "devtools::install_url(https://cran.r-project.org/src/contrib/Archive/PhyloMeasures/PhyloMeasures_2.1.tar.gz)"
RUN R -e "install.packages('ape')"
RUN R -e "install.packages('mFD')"
RUN R -e "install.packages('worrms')"
RUN R -e "install.packages('patchwork')"
RUN R -e "install.packages('hillR')"
RUN R -e "install.packages('betapart')"
# download sources # download sources
WORKDIR /app WORKDIR /app
RUN wget https://gitlab.mbb.cnrs.fr/edna/custom_reference_database/-/archive/v1.1/custom_reference_database-v1.1.tar.gz RUN wget https://gitlab.mbb.cnrs.fr/edna/custom_reference_database/-/archive/v1.1/custom_reference_database-v1.1.tar.gz
RUN tar -zxvf custom_reference_database-v1.1.tar.gz RUN tar -zxvf custom_reference_database-v1.1.tar.gz
RUN wget https://github.com/torognes/vsearch/archive/v2.22.1.tar.gz RUN wget https://github.com/torognes/vsearch/archive/v2.22.1.tar.gz
RUN tar -zxvf v2.22.1.tar.gz RUN tar -zxvf v2.22.1.tar.gz
#RUN wget https://git.metabarcoding.org/obitools/ecoprimers/uploads/40f0fe1896a15ca9ad29835f93893464/ecoPrimers.tar.gz
#RUN tar -zxvf ecoPrimers.tar.gz
#RUN wget https://git.metabarcoding.org/obitools/ecopcr/uploads/aa3828c196570ea156ce6d4baac22b10/ecopcr-1.0.1.tar.gz
#RUN tar -zxvf ecopcr-*.tar.gz
# install cutadapt # install cutadapt
RUN python3 -m pip install --upgrade cutadapt RUN python3 -m pip install --upgrade cutadapt
...@@ -64,35 +66,15 @@ RUN ./configure CFLAGS="-O3" CXXFLAGS="-O3" ...@@ -64,35 +66,15 @@ RUN ./configure CFLAGS="-O3" CXXFLAGS="-O3"
RUN make RUN make
RUN make install RUN make install
# install ecoPrimers
#WORKDIR /app/ecoprimers/src/
#RUN make
#RUN echo "export PATH=$PATH:/app/ecopcr/src/" >> /home/rstudio/.bashrc
# install ecoPCR # install ecoPCR
RUN apt-get install -y ecopcr
#WORKDIR /app/ecopcr/src/
#RUN make
#RUN echo "export PATH=$PATH:/app/ecopcr/src/" >> /home/rstudio/.bashrc
# install obitools
WORKDIR /app
RUN git clone https://git.metabarcoding.org/obitools/obitools3.git
WORKDIR /app/obitools3
ARG TARGETPLATFORM
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then sed -e "s/'-msse2',//" -i setup.py; fi
RUN python3 setup.py install
RUN /bin/bash obi_completion_script.bash
# install dependencies for mkbdr
RUN apt-get update -y RUN apt-get update -y
RUN apt-get install -y python3-pyqt5.qtsvg RUN apt-get install -y ecopcr
RUN apt-get install -y python3-pyqt5.qtopengl
# cleanup # cleanup
WORKDIR /app WORKDIR /app
RUN rm *.tar.gz* RUN rm *.tar.gz*
RUN rm -rf /var/lib/apt/lists/* RUN rm -rf /var/lib/apt/lists/*
RUN apt-get clean
WORKDIR /home/rstudio WORKDIR /home/rstudio
EXPOSE 8787 EXPOSE 8787
......
# eDNA docker # eDNA docker
This repository contains a `Dockerfile` used to build the `edna_tools` docker image including **Rstudio** web interface and the following packages: This repository contains a `Dockerfile` used to build the `edna_tools` docker image including **Rstudio** web interface
and the following packages:
- [`tidyverse`](https://www.tidyverse.org/) (`ggplot2`, `dplyr` ...)
- [`dada2`](https://benjjneb.github.io/dada2/index.html) - [`tidyverse`](https://www.tidyverse.org/) (`ggplot2`, `dplyr` ...)
- [`OBITools`](https://pythonhosted.org/OBITools/welcome.html) - [`dada2`](https://benjjneb.github.io/dada2/index.html)
- [`cutadapt`](https://cutadapt.readthedocs.io/en/stable/) - [`OBITools`](https://pythonhosted.org/OBITools/welcome.html)
- [`MKBRD`](https://gitlab.mbb.univ-montp2.fr/edna/custom_reference_database) - [`cutadapt`](https://cutadapt.readthedocs.io/en/stable/)
- [`vsearch`](https://github.com/torognes/vsearch) - [`MKBRD`](https://gitlab.mbb.univ-montp2.fr/edna/custom_reference_database)
- [`ecoprimers`](https://git.metabarcoding.org/obitools/ecoprimers/-/wikis/home) - [`vsearch`](https://github.com/torognes/vsearch)
- [`ecoPCR`](https://pythonhosted.org/OBITools/scripts/ecoPCR.html) - [`ecoprimers`](https://git.metabarcoding.org/obitools/ecoprimers/-/wikis/home)
- [`ecoPCR`](https://pythonhosted.org/OBITools/scripts/ecoPCR.html)
The docker image itself is hosted on [dockerhub](https://hub.docker.com/repository/docker/thesanc/edna_tools). It allows to run a container with usefull softwares for eDNA analysis. Independently from your operating system, the container is launched with all the softwares pre-installed in a self-contained linux environment.
The docker image itself is hosted on [dockerhub](https://hub.docker.com/repository/docker/thesanc/edna_tools). It allows
Keep in mind that any modifications made inside the container (e.g. packages newly installed or files modified) will be lost after stopping it. Therefore, you need to use the `-v` argument (or use the dedicated field in docker desktop) to mount the local files inside the container as explained in the tutorial bellow. Modification made to the mounted files will not be lost and you can even create new files from inside the container in the mounted path. to run a container with usefull softwares for eDNA analysis. Independently from your operating system, the container is
launched with all the softwares pre-installed in a self-contained linux environment.
The **Rstudio** web interface provides an **R** IDE (Integrated Development Environment) in addition to a terminal to execute any bash command you may need.
Keep in mind that any modifications made inside the container (e.g. packages newly installed or files modified) will be
lost after stopping it. Therefore, you need to use the `-v` argument (or use the dedicated field in docker desktop) to
mount the local files inside the container as explained in the tutorial bellow. Modification made to the mounted files
will not be lost and you can even create new files from inside the container in the mounted path.
The **Rstudio** web interface provides an **R** IDE (Integrated Development Environment) in addition to a terminal to
execute any bash command you may need.
## Docker tutorial ## Docker tutorial
Docker images can be either used with the **command line interface** (CLI) after installing docker from your favorite linux package manager or by using the **docker desktop** UI available on [Mac](https://docs.docker.com/desktop/install/mac-install/), [Windows](https://docs.docker.com/desktop/install/windows-install/) and [Linux](https://docs.docker.com/desktop/install/linux-install/). Docker images can be either used with the **command line interface** (CLI) after installing docker from your favorite
linux package manager or by using the **docker desktop** UI available on
[Mac](https://docs.docker.com/desktop/install/mac-install/),
[Windows](https://docs.docker.com/desktop/install/windows-install/) and
[Linux](https://docs.docker.com/desktop/install/linux-install/).
### Command line interface ### Command line interface
Start the docker daemon by running: Start the docker daemon by running:
```bash ```bash
sudo dockerd sudo dockerd
``` ```
In another terminal, download the image from [dockerhub](https://hub.docker.com/r/thesanc/edna_tools) and run it with this single command: In another terminal, download the image from [dockerhub](https://hub.docker.com/r/thesanc/edna_tools) and run it with
this single command:
```bash ```bash
docker run -v /path/to/your/local/file:/path/inside/the/container -p 8787:8787 thesanc/edna_tools docker run -v /path/to/your/local/file:/path/inside/the/container -p 8787:8787 thesanc/edna_tools
``` ```
You should now be able to have access to the **Rstudio** instance by typing `localhost:8787` in your browser. You can log in with `rstudio` both as username and password. You should now be able to have access to the **Rstudio** instance by typing `localhost:8787` in your browser. You can
log in with `rstudio` both as username and password.
### Docker desktop ### Docker desktop
Once you have installed the **docker desktop** UI, you can search for the `thesanc/edna_tools` image in the research toolbar: After unstalling the **docker desktop** UI, you can search for the `thesanc/edna_tools` image in the research toolbar:
![](tutorial_images/docker_desktop_containers.png) ![](tutorial_images/docker_desktop_home.png)
Once you have found the image, you can download it and click on the "▷" button. A pop-up windows should open to set up the container: Once you have found the image, download it and run it by clicking on "run".
<img src="tutorial_images/docker_desktop_run.png" width="400"/> ![](tutorial_images/docker_desktop_search.png)
Fill the **Host port** field with `8787` (you can set up another port if this one is already used). A pop-up windows should open to set up the container:
<img src="tutorial_images/docker_desktop_run.png" width="400"/>
Fill the **Host path** with the file path to your files and fill the **Container path** with the path where these fill should appear in the container. If you are using linux or macos, I recommend to use the host path as container path to avoid path related issues when you are running your code inside and outside the container. On windows, you can type in the desired **Host path** in windows style and type in `/home/rstudio` for the **Container path**, since the path should be in unix style. Fill the **Host port** field with `8787` (you can set up another port if this one is already used).
Now you should now be able to have access to the **Rstudio** instance by typing `localhost:8787` (if you have set up the **Host port** to `8787`) in your browser. You can log in with `rstudio` both as username and password. Fill the **Host path** with the file path to your files and fill the **Container path** with the path where these fill
should appear in the container. If you are using linux or macos, I recommend to use the host path as container path to
avoid path related issues when you are running your code inside and outside the container. On windows, you can type in
the desired **Host path** in windows style and type in `/home/rstudio` for the **Container path**, since the path should
be in unix style.
Now you should now be able to have access to the **Rstudio** instance by typing `localhost:8787` (if you have set up the
**Host port** to `8787`) in your browser. You can log in with `rstudio` both as username and password.
tutorial_images/docker_desktop_home.png

195 KiB

tutorial_images/docker_desktop_search.png

244 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment