学习小组Day3笔记-yikedou
2020-10-11 本文已影响0人
yikedou
利用miniconda安装生信软件
![](https://img.haomeiwen.com/i15679168/a6641d10c409d848.png)
一、下载miniconda
miniconda官网:https://docs.conda.io/en/latest/miniconda.html
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
也可以选择清华miniconda镜像
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
![](https://img.haomeiwen.com/i15679168/0585c2ce2bffc3f6.png)
sh是脚本(就是一个程序,后台的代码)文件的后缀,也就是说其实这是一个下载的脚本,如果你安装失败了,这个脚本是不需要重新下载的,还是可以用的。
二、安装miniconda
bash Miniconda3-latest-Linux-x86_64.sh
![](https://img.haomeiwen.com/i15679168/a72c2e35e2b669d8.png)
按Enter键,想一行行继续,按Enter,想直接翻页,按空格键。
![](https://img.haomeiwen.com/i15679168/b1a154be8a8bfd7b.png)
![](https://img.haomeiwen.com/i15679168/d923ad4ac4839a6c.png)
出现了路径的配置,如果你有想安装的路径就输入你自己的
【友情提示:可以放到家目录的bashrc下,方便以后修改。输入:/home/你的用户名/.bashrc。只不过这种安完以后需要再source ~/.bashrc激活环境变量】
如果不想自定义那就默认吧,敲Enter继续。
![](https://img.haomeiwen.com/i15679168/d73e628f20c31e97.png)
![](https://img.haomeiwen.com/i15679168/3e8fe6298ee892a9.png)
![](https://img.haomeiwen.com/i15679168/2189c8505ab983ac.png)
输入source ~/.bashrc来激活conda。
![](https://img.haomeiwen.com/i15679168/37d7fa326eaf6d14.png)
用户名前出现(base),说明安装成功!
三、安装结束后的工作
-
测试:输入conda
image.png
-
配置镜像文件
conda config --add channels conda-forge
conda config --add channels defaults
conda config --add channels r
conda config --add channels bioconda
- 添加清华镜像
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
#查看channels
conda config --get channels
#移除某个channels
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
四、miniconda使用
-
检查已安装软件:输入conda list
image.png
-
搜索conda软件,输入 conda search fastqc [以数据质控软件fastqc为例]
image.png
- 安装软件,输入 conda install -c bioconda fastqc -y [-y是yes,安装过程中conda问你的问题全部回答yes, -c 指定下载通道]
默认安装最新版本,但是有的软件新版本bug比较多,可能需要用到老版本
如果要指定版本号,可以输入conda install -c bioconda fastqc=0.11.7 -y
image.png
- 卸载软件 conda remove fastqc -y
conda环境管理
- 查看环境
conda info -e
conda info --envs
![](https://img.haomeiwen.com/i15679168/6fe399237214e8eb.png)
#创建环境
conda create -n QC python=3
#创建环境及安装软件一步完成
conda create -n QC python=3 fastqc -y
#进入环境
conda activate QC
#删除环境
conda remove -n QC --all
#复制环境
conda create -n QC --clone QC_new
![](https://img.haomeiwen.com/i15679168/5522b22ca16ff76b.png)
附:conda 卸载
Q: 请问不想用了怎么卸得畅快轻松?
A :首先 rm -rf ~/miniconda3
B: 环境变量中去掉conda, vi ~/bash_profile 删除conda路径,退出保存
[有个小技巧:vim 中移动光标比如到第9行,使用dd就可以快速删除整行]
C: 删除隐藏的.condarc 、.conda以及.continuum文件
![](https://img.haomeiwen.com/i15679168/767484b2d3124c5e.png)