生物信息学与算法生信猿生信修炼

Ubuntu生信起手式

2019-05-04  本文已影响1人  Angeladaddy

学习生信,最好的环境应该是linux跑数据+网页端RStudio写代码。最好有随时可以访问的一台linux服务器。 没有的话,开启win10的linux子系统也是一个不错的选择。

下面开始配置环境。

1. 安装R

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
# will output:
Output
Executing: /tmp/apt-key-gpghome.4BZzh1TALq/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
gpg: key 51716619E084DAB9: public key "Michael Rutter <marutter@gmail.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
Output
...
Get:5 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease [3609 B]                 
...                    
Get:6 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages [21.0 kB]
...
sudo apt update
Output
...
Hit:2 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease
...

You should install R with OpenBLAS. In plain terms, OpenBLAS will boost some operations and I want you to be a happy user. You can ignore this advice if you are going to work with relatively small datasets.

sudo apt-get install libopenblas-base r-base

check:

sudo -i R
Output

R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
...
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

>

2. 安装RStudio Server版,

https://www.rstudio.com/products/rstudio/download-server/

sudo apt-get install gdebi-core
wget https://download2.rstudio.org/server/trusty/amd64/rstudio-server-1.2.1335-amd64.deb
 sudo gdebi rstudio-server-1.2.1335-amd64.deb

安装完毕后服务自动开启在8787端口,如果暴露给外网还要打开防火墙端口,建议使用ufw管理防火墙。
我们还需要在系统中添加一个用户,用来访问RStudio:

sudo adduser youname

添加完成后,浏览器打开ip:8787就能访问了:


image.png

3. 安装gdc-client

到这里下载最新版gdc-client

wget  https://gdc.cancer.gov/system/files/authenticated%20user/0/gdc-client_v1.4.0_Ubuntu_x64.zip
unzip gdc-client_v1.4.0_Ubuntu_x64.zip

我们将得到gdc-client可执行文件,位于当前目录下,为了方便使用,我们还需要将其加入环境变量:
打开~/.bashrc

#通过修改.bashrc文件:
vim ~/.bashrc 
#在最后一行添上:
export PATH=you gdc-client path:$PATH
#生效方法:(有以下两种)
#1、关闭当前终端窗口,重新打开一个新终端窗口就能生效
#2、输入“source ~/.bashrc”命令,立即生效
#有效期限:永久有效
#用户局限:仅对当前用户

4. 其它

推荐使用xshell免费版与服务器进行ssh连接,虽然RStudio也自带终端,但xshell的上传下载命令lrzsz实在是太好用了(我们有时需要在win上下载manifeste文件,上传到linux进行数据下载),https://blog.csdn.net/liuruiqun/article/details/45921921

下载数据中

image.png

这样我们无论何时下载好的数据都在服务端,我们可以随时随地开始分析

上一篇 下一篇

猜你喜欢

热点阅读