conda是一個(gè)開源包管理系統(tǒng)和環(huán)境管理系統(tǒng),用于安裝多個(gè)版本的軟件包及其依賴關(guān)系,并在它們之間輕松切換。 它適用于Linux,OS X和Windows,是為Python程序創(chuàng)建的,但可以打包和分發(fā)任何軟件。Anaconda是一個(gè)開源的Python發(fā)行版本,包含了conda、python等180多個(gè)科學(xué)包及其依賴項(xiàng)。如果為了省時(shí)間,也可以使用Miniconda這個(gè)較小的發(fā)行版。anaconda、miniconda、conda三者皆屬于linux的軟件管理器,日常生信使用miniconda已足夠。
conda官網(wǎng):https://docs.conda.io/projects/conda/en/latest/
一、安裝
1、下載可執(zhí)行文件
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
2、安裝
sh Miniconda2-latest-Linux-x86_64.sh
>>> yes
>>> /export/home/hushy/miniconda2 ##指定安裝路徑
3、測(cè)試
conda info -e
# conda environments:
#
base * /export/home/hushy/miniconda2 #安裝后系統(tǒng)進(jìn)入miniconda虛擬環(huán)境base
二、管理conda 環(huán)境
由于不同的項(xiàng)目所需的軟件版本可能不同(如python2/python3),要同時(shí)進(jìn)行不同項(xiàng)目就需要設(shè)置不同的conda 環(huán)境。
1、查看conda存在哪些環(huán)境(*代表此環(huán)境為默認(rèn)環(huán)境)
conda info --envs
2、添加新環(huán)境
conda create -n ANA #創(chuàng)建新環(huán)境ANA
conda create -n env python=3 fastqc trimmomatic -y #創(chuàng)建新環(huán)境env,并指定python版本為3,同時(shí)安裝fastqc和trimmomatic兩個(gè)軟件
3、激活新conda環(huán)境
conda activate ANA
4、退出虛擬環(huán)境
conda deactivate
三、安裝軟件
1、查看當(dāng)前所有軟件列表
conda list
2、搜索軟件 (以fastqc為例)
conda search fastqc
conda search skewer
3、安裝
conda install fastqc -y #自動(dòng)安裝fastqc
conda install -c bioconda skewer #安裝skewer
conda install -c bioconda skewer=v0.2.2 #安裝特定版本
conda install -c bioconda bwa
conda install -c bioconda/label/cf201901 skewer
4、卸載某虛擬環(huán)境中某軟件
conda remove -n ANA skewer -y