由于自己的笔记本配置有点感人,在X宝淘了个二手的服务器作为入门生信使用,配置为8核16线程64g内存6T存储。
系统安装
系统选择了对于我这种刚接触Linux的小白比较友好的Ubuntu系统,选择稳定版本Ubuntu16.04LTS,选择中科大镜像站下载(http://mirrors.ustc.edu.cn/ubuntu-releases/16.04/ubuntu-16.04.3-desktop-amd64.iso)。使用UltraISO刻录U盘安装(最好使用最新版本的软碟通,之前用旧版本的读取镜像的时候出错了,没有刻录完整,安装了一半就挂了。)安装的过程中需要把网线拔了,否则,到了选择时区的步骤时会自动弹出,跳至U盘的Ubuntu系统。
软件的更新以及开启ssh端口
在图形界面选择系统设置-软件和更新-选择下载服务器更新源和软件
开启ssh端口需要安装openssh-server(我也不知道ubuntu16.4有没有自带,安了总没错)
sudo apt-get install openssh-server
使用ifconfig -a
查看ip地址
之后就可以使用账号密码和ip地址,通过Xshell或者PuTTY在Windows系统上登陆服务器,服务器的显示屏就被我开心的拿来做扩展屏幕啦😁。
安装必须的库
在命令行中输入下列命令安装必须的库和软件
sudo apt-get install -y curl unzip build-essential ncurses-dev
sudo apt-get install -y byacc zlib1g-dev python-dev git cmake
sudo apt-get install -y default-jdk ant
对命令行进行设置
使用下列命令完成对命令行的设定
curl http://data.biostarhandbook.com/install/bash_profile.txt >> ~/.bash_profile
curl http://data.biostarhandbook.com/install/bashrc.txt >> ~/.bashrc
emmmm,下载 不了。。。连接老出错,大概是姿势不对,再来
wget http://data.biostarhandbook.com/install/bash_profile.txt
wget http://data.biostarhandbook.com/install/bashrc.txt
emmmm,还是不行。。。
手机试着连接了一下,emmmm,下好了???大概我们学校的网络有毒吧。。。
将手机上下载的两个文件传到服务器中,使用下列命令完成设置
less bash_profile.txt >> ~/.bash_profile
less bashrc.txt >> ~/.bashrc
查看~/.bashrc
文件
vi ~/.bashrc

在文件的末尾加上了好多东西,小白表示完全没看懂=-=
配置一下完成设置
source ~/.bashr_profile
conda的配置安装
按照Biostar_Handbook推荐,安装体积较小的miniconda作为使用的 conda。
curl -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
最后输入source ~/.bashrc
就可以完成安装啦
有的同学安装完成后输入conda
输出的不是conda的说明,而是conda:command not found
。这是没有将conda的路径添加到环境变量中去,需要手动输入如下命令完成conda的安装
echo 'export PATH="/path/to/conda/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
添加叫做bioinfo
的conda环境
conda create -y --name bioinfo python=3
激活bioinfo
环境
source activate bioinfo
可以通过conda info --envs
查看存在的环境
添加几个bioconda的channel
conda config --add channels r
conda config --add channels conda-forge
conda config --add channels bioconda
由于源都在国外下载速度比较慢,可以添加国内的源来加快速度
conda config --add channels http://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
Biostar_Handbook所用到的软件的安装
使用conda进行安装,输入下面的命令完成软件的安装
curl http://data.biostarhandbook.com/install/conda.txt | xargs conda install -y
emmmm,依然连接不上。。。继续手机下载吧。
less conda.txt | xargs conda install -y
一下要安装好多软件

由于bioconda的源在国外,国内的清华源最近又有问题,下载速度极慢,经常会报错,就一直在重复这个步骤,一直到了不再报错。大部分的生物信息学软件都可以通过conda安装,部分无法使用conda安装的软件都可以通过软件的官网找到他们的安装方法。
今天早上发现清华的bioconda镜像源可以用了,赶紧加上安了软件
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --set show_channel_urls yes
速度无与伦比,体验飞一般的感觉!~

用doctor.py
检测安装情况
用doctor.py
来看看配置的情况
mkdir -p ~/bin
curl http://data.biostarhandbook.com/install/doctor.py > ~/bin/doctor.py
chmod +x ~/bin/doctor.py
运行doctor.py
查看配置情况
~/bin/doctor.py
然而

折腾了很久还是这种情况,也不知道是哪里出错了=-=
改为使用
python
来运行doctor.py
发现就可以运行了
python ~/bin/doctor.py

但是好像和Biostar_Handbook上面的有点不太一样,多了三行。。。但是也说我完成了=-=
还没没弄懂我是完成了还是没完成。。。
额外有一块已经分好区了的旧硬盘里面有好多数据,每次开机都需要重新挂载很麻烦,设定为开机挂载,修改
/etc/fstab
#手动挂载,重启后会丢失挂载
sudo mount /dev/sdb1 /home/kevin/DATA/DATA1/
sudo mount /dev/sdb2 /home/kevin/DATA/DATA1/
sudo mount /dev/sdb3 /home/kevin/DATA/DATA1/
#设置开机自动挂载
/dev/sdb1 /home/kevin/DATA/DATA1/ ext4 defaults 0 0
/dev/sdb2 /home/kevin/DATA/DATA2/ ext4 defaults 0 0
/dev/sdb3 /home/kevin/DATA/DATA3/ ext4 defaults 0 0
重启电脑以后就发现直接就挂载了
安装R语言和Rstudio
根据度娘的结果参考16.04 LTS 安装R及RStudio Server
1.R的安装
1.1首先添加镜像源
Ctrl+Alt+T打开终端
$ sudo gedit /etc/apt/sources.list
加入新镜像源 回车之后会自动跳出一个文本框,然后在相似的地方输入
deb http://cran.rstudio.com/bin/linux/ubuntu trusty/
加载镜像源还可以使用以下方法:
deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/
deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu wily/
deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu trusty/
deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu precise/
or in your /etc/apt/sources.list file, replacing by the actual URL of your favorite CRAN mirror. See
https://cran.r-project.org/mirrors.html for the list of CRAN mirrors.
修改后保存并退出(File→quit)
1.2 运行命令下载公钥
下载公钥
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9
然后更新一下
$ sudo apt-get update
1.3 安装R
$ sudo apt-get install r-base
然后验证是否安装成功:在终端输入R,出现R的信息则安装成功。
一些可用的包存储在CRAN的Ubuntu仓库中,包括:
<pre> r-cran-
boot
r
-cran-
class
r
-cran-
cluster
r
-cran-
codetools
r
-cran-
foreign
r
-cran-
kernsmooth
r
-cran-
lattice
r
-cran-
mass
r
-cran-
matrix
r
-cran-
mgcv
r
-cran-
nlme
r
-cran-
nnet
r
-cran-
rpart
r
-cran-
spatial
r
-cran-
survival
r
-cran-rodbc </pre>
要更新以上的包,可以使用下面的命令(替换掉foo):
<pre>$ sudo apt-
get
build-dep r-cran-foo</pre>
R包的安装:
<pre>
安装包
install.packages()
更新包
update.packages(lib.loc =
"
/usr/local/lib/R/site-library
"
)</pre>
2. 安装Rstudio
2.1 安装
首先,去下载对应自己系统的安装文件: http://www.rstudio.com/products/rstudio/download/,然后执行一下步骤。
<pre>$ sudo apt-
get
install gdebi-
core
$ wget https:
//
download2.rstudio.org/rstudio-server-0.99.902-amd64.deb
$ sudo gdebi rstudio-server-
0.99
.
902
-amd64.deb</pre>
2.2 启动Rstudio server
在浏览器中输入地址和端口,如:
<pre>[http:
//
192.168.43.129:8787
http:
//
localhost:8787](http://192.168.43.129:8787http//localhost:8787) </pre>
然后会出现要求输入用户名和密码,这跟登录Ubuntu时候使用的用户和密码相同
2.3在Rstudio server里安装ggplot2
安装ggplot2包之前需要先安装其它的依赖包:' plyr ' , ' digest ' , ' gtable ' , ' reshape2 ' , ' scales ' , ' proto ' , 在Rstudio的命令窗口分别执行以下命令:
install.packages('plyr')
install.packages('digest')
install.packages('gtable')
install.packages('reshape2')
install.packages('scales')
install.packages('proto')
然后,安装ggplot2包:
install.packages('ggplot2')
Oracle JDK 安装:
由于mysql在使用OpenJDK时会出现错误,需要安装Oracle JDK
设置 PPA
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
JDK6 :
sudo apt-get install oracle-java6-installer
JDK 7:
sudo apt-get install oracle-java7-installer
JDK 8
sudo apt-get install oracle-java8-installer
网友评论