In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you the transcriptional group RNA-Seq how to use docker+bioconda to build an analysis environment, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's learn about it!
Build environment based on docker
The way the author uses docker is not recommended on the Internet, which is similar to virtual machine image. The reason is that I don't bother to write dockerfile, which makes it too troublesome.
Install docker very quickly install docker-compose# download docker-compose from the following URL, put the docker-compose file in the path variable directory such as: / usr/local/bin https://github.com/docker/compose/releases Select docker image and build a basic image
Because the previous Ubuntu16.04 is too old, select the image of Ubuntu20.04 directly here.
# pull ubuntu20.04 image docker pull ubuntu:20.04# to obtain docker image list docker images or docker image ls# confirm that docker image pull is complete, create a docker container docker run-- name first-it ubuntu:20.04 / bin/bash# after the completion of operation, enter the container to install ssh and other software such as root@80cb4d36be59# apt update & & apt install openssh-server vim net-tools curl#, and modify the ssh configuration file after installation. To facilitate remote login to root@80cb4d36be59# vim / etc/ssh/sshd_config#, modify the following lines and save Port 9020 # modify the default port number (optional) ListenAddress 0.0.0.0 # default listening address, all addresses LoginGraceTime 2m # allow users to log in time (optional) PermitRootLogin yes # allow root users to log in, docker default user is root user # modify default root account password It is convenient for ssh to log in remotely to root@80cb4d36be59# passwd root# to start the ssh service root@80cb4d36be59# service ssh start# to obtain the container ip address Root@b8080a125313:/# ifconfigeth0: flags=4163 mtu 1500 inet 172.17.0.2 netmask 255.255.0.0 broadcast 172.17.255.255 ether 02:42:ac:11:00:02 txqueuelen 0 (Ethernet) RX packets 27095 bytes 55050990 (55.0 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 26785 bytes 2478368 (2.4 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73 mtu 65536 Inet 127.0.0.1 netmask 255.0.0.0 loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions opening a new terminal test connection ssh root@172.17.0.2-p902 connection if it can be connected, the first step is complete. Let's commit create our own image and open the terminal docker commit first ubuntu20.04-ssh:1.00 Phase 2: install bioconda to build a basic Shengxin image.
Exit and delete the previously run container
# Container root@80cb4d36be59# exit# before exiting delete the container docker rm first
Write the docker-compose.yml file and start the container using docker-compose
Version: "3" services: RNASeq: image: ubuntu20.04-ssh:1.00 # here is the image name we submitted earlier: container_name: rnaseq # run container name volumes: / media/sliver/Element1/data:/opt/data:rw # plug-in data directory, place the original data-/ media/sliver/Manufacture/RNA-Seq/root:/root:rw # plug-in root directory, bioconda installation location Reduce the image volume-/ media/sliver/Manufacture/RNA-Seq/ref:/opt/ref:rw # plug-in reference directory-/ media/sliver/Manufacture/RNA-Seq/result:/opt/result:rw # analysis result output and intermediate file directory ports:-"9020 network_mode 9020" network_mode: "host" # use host mode directly here. The default is bridge mode. Host mode Note: do not conflict with the server port environment:-TZ= "Asia/Shanghai" # set the time zone by variable, otherwise the system time error command: service ssh start-D # start the ssh service when starting the container to facilitate remote connection
Start the container using the docker-compose.yml file
Run the docker-compose up startup container under the docker-compose.yml file directory and check the output log to see if there are any errors
Log in to the image using ssh and install bioconda
# Log in using 127.0.0.1 address here. Every time the container reruns the network segment of ip address, ssh root@127.0.0.1-p902login is successful. Install biocondacurl-O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.shsh Miniconda3-latest-Linux-x86_64.sh#setup channelsconda config-- add channels defaultsconda config-- add channels biocondaconda config-- add channelsconda-forge.
# modify the configuration file directly Add Tsinghua Source vim ~ / .condarcchannels:-conda-forge-bioconda-defaultsshow_channel_urls: truedefault_channels:-https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main-https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/rcustom_channels: conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud bioconda: https : / / mirrors.tuna.tsinghua.edu.cn/anaconda/cloud menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
# make the configuration file effective source ~ / .bashrc # install several software to test conda install fastqcconda install multiqcconda install STARconda install hisat2
Build the second phase image of bioconda
# No problem with the test. Open a new terminal to submit the image. The second phase image can be used in various docker commit rnaseq ubuntu20.04-bioconda environments later.
In the third stage, install R, Bioconductor and RStudio-Server to build an image for RNA-Seq (transcriptgroup)
Install R and Bioconductor
# switch back to the shell terminal in the container just now After the installation of Rapt install r-base# is completed, check the version R-- version# and the output is as follows: r version 3.6.3 (2020-02-29)-- "Holding the Windsock" Copyright (C) 2020 The R Foundation for Statistical ComputingPlatform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY.You are welcome to redistribute it under the terms of theGNU General Public License versions 2 or 3.For more information about these matters see https://www .gnu.org / licenses/.# install Bioconductor Run if (! requireNamespace ("BiocManager", quietly = TRUE)) install.packages ("BiocManager") BiocManager::install () # in the terminal and install two R packages BiocManager::install ('edgeR') BiocManager::install ("DESeq2") after the installation is complete.
Install RStudio Server to remotely deploy and run R
# install RStudio Serverapt-get install gdebi-corewget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.3.1093-amd64.debgdebi rstudio-server-1.3.1093-amd64.deb# create configuration file vi / etc/rstudio/rserver.conf# add the following statement # # add the following statement to the two configuration files # # the location of the R program of the system, if there is a personal directory using anaconda to install R There may be an error rsession-which-r=/usr/bin/R www-port=8787 # # add the following statement through ip's port 8787 connection vi / etc/rstudio/rsession.conf# add the following statement www-port=8787 # # add a user sliver through port 8787 connection of ip, which is used to log in to RStudio Serveruseradd sliverpasswd sliver# to create the user home directory, otherwise the login is successful But there will be an error Unable to connect to servicemkdir / home/sliverchown-R sliver / home/sliver# to check whether Rstudio-server can run and start the service to start rstudio-server verify-installationrstudio-server start
Open a browser and enter: http://127.0.0.1:8787
Log in with the previously created user sliver and password:
Indicates that the configuration is successful.
Submit the image and modify the docker-compose.yml file
Submit an image for RNA-Seq transcriptgroup analysis
# Open a new terminal and run docker commit rnaseq ubuntu20.04-rnaseq:1.00# to export the current container as a file docker export-o ubuntu_20.04_rnaseq.tar rnaseq# migration image can be imported from the file to the image docker import ubuntu_20.04_rnaseq.tar ubuntu20.04-rnaseq:1.00
Modify the docker-compose.yml file
Version: "3" services: RNASeq: image: ubuntu20.04-rnaseq:1.00 container_name: rnaseq volumes:-/ media/sliver/Element1/data:/opt/data:rw # Mount data directory-/ media/sliver/Manufacture/RNA-Seq/root:/root:rw # mount root directory-/ media/sliver/Manufacture/RNA-Seq/ref:/opt/ref:rw # mount reference directory -/ media/sliver/Manufacture/RNA-Seq/result:/opt/result:rw # Mount intermediate files and result directory ports:-"9020 RStudio Server Web 9020" # ssh connection port-"8787RV 8787" # RStudio Server Web access port network_mode: "host" # Network mode is host Note that the port and the server port cannot conflict with environment:-TZ= "Asia/Shanghai" # set the time zone, and do not start two services at the same time in the wrong way: command: / bin/bash-c "rstudio-server start & & service ssh start-D" #
These are all the contents of the article "how the transcriptional group RNA-Seq uses docker+bioconda to build an analytical environment". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.