生信星球培训第九十九期

Day3-Luke

2021-02-24  本文已影响0人  Machinefeelings

Miniconda

1.什么是conda?——linux的应用商店

2.如何下载miniconda

(1)百度/谷歌搜索“miniconda 清华”,打开下shell,输入命令 uname -a,查看服务器是多少位的,然后在miniconda 清华中找到最新版本,右键复制下载链接。

(2)wget 命令:wget 刚才你复制的下载链接

3.如何安装miniconda

1.bash Miniconda3-latest-Linux-x86_64.sh

然后就开始了安装过程,中间会出现很多的版权信息,按回车跳过它们

当你看到一行“Do you accept the license terms? [yes|no]”说明安装要开始了【注意看下图的操作,程序让你enter就enter,让你yes就yes】

[图片上传失败...(image-db048c-1614159357808)]

看到这里说明安装成功!

[图片上传失败...(image-674cb-1614159357808)]

2.激活

source ~/.bashrc来激活conda,命令行输入conda,出现满屏的信息说明成功了 如果报错,说明你可能没有进行上一步的source ~/.bashrc命令。

[图片上传失败...(image-87cc96-1614159357808)]

3.添加镜像:所谓镜像网站,相当于主网站的副本,conda在国外,我们在国内下载软件速度会很慢,因此配置镜像,从镜像网站下载,可以加快下载速度。

把下面的代码全部复制到命令行,粘贴、回车:

<pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="java" cid="n77" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
conda config --set show_channel_urls yes</pre>

4.如何使用conda?

1)查看当前服务器上安装的所有软件列表 conda list

2)搜索conda软件 conda search fastqc 【这里以数据质控软件fastqc为例】

3) 安装软件 conda install fastqc -y-y是yes,安装过程中conda问你的问题全部回答yes,你可以试试不加-y有什么区别

4)默认安装最新版本,但是有的软件新版本bug比较多,可能需要用到老版本

如果要指定版本号,可以conda install fastqc=0.11.7 -y

5)卸载软件 conda remove fastqc -y

5.如何在同一时间里使用两个版本的软件?——进行分身

1)background:

生信实战中,需要分析转录组、基因组组装、重测序等多个项目。每一个项目都需要不同的软件,另外软件之间的结合也是需要版本要求的,比如A项目你需要用a软件V 1.0版本,但是处理B项目又需要用到a软件的V 1.5版本,怎么办? --别想了,办法就是分身!!按照你的项目,定制不同的分身,安装不同的软件,互不干扰。这个分身就是不同的“conda environment”

2)先查看当前conda****有哪些环境:conda info --envs (前面带*的就是默认的)

3)创立一个新的conda环境,例如:我们要处理转录组数据了,好,先建立一个名叫rnaseq的conda环境,然后指定python版本是3,安装软件fastqc、trimmomatic:conda create -n rna-seq python=3 fastqc trimmomatic -y

4)再次查看conda环境:conda info --envs,发现默认还是base

5)激活新的conda环境:conda activate rna-seq ,这时默认的*就会转移到rna-seq前面

6)如果要退出当前环境,就运行conda deactivate

注意:

1.linus的自动补全命令Tab,如我有一个文件夹是biosoft,当我打出cd b,按Tab,就会自动补全为cd biosoft。

2.linus的复制粘贴:「for Windows」请记住这里的粘贴不是ctrl+c和ctrl+V了,选中,鼠标左键点一下是复制,右键点一下是粘贴;「for Mac」直接cmd + c 复制,cmd + v粘贴

上一篇 下一篇

猜你喜欢

热点阅读