學(xué)習(xí)小組54期 3rd day-conda--忍冬

2020-04-19

今天的內(nèi)容:

linux軟件的安裝
除說明外,本文引用內(nèi)容均來自:微信公眾號生信星球

記錄下有意思的東西:

關(guān)于conda等更詳細可以看這里

  1. 安裝miniconda

Miniconda 是一個 Anaconda 的輕量級替代,默認只包含了 python 和 conda,但是可以通過 pip 和 conda 來安裝所需要的包。
清華的miniconda鏡像地址

錯誤示范:

bio01@VM-0-10-ubuntu:~$ cd biosoft
bio01@VM-0-10-ubuntu:~/biosoft$ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_4.8.2-MacOSX-x86_64.sh  #下載

bio01@VM-0-10-ubuntu:~/biosoft$ ls
Miniconda3-py38_4.8.2-MacOSX-x86_64.sh

bio01@VM-0-10-ubuntu:~/biosoft$ bash Miniconda3-py38_4.8.2-MacOSX-x86_64.sh  #安裝
Miniconda3-py38_4.8.2-MacOSX-x86_64.sh: line 405: /home/bio01/biosoft/:home/bio01/bashrc/conda.exe: cannot execute binary file: Exec format error    #此時我意識到下載錯了版本

正解:

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_4.8.2-Linux-x86_64.sh
bash Miniconda3-py38_4.8.2-Linux-x86_64.sh
Thank you for installing Miniconda3!
bio01@VM-0-10-ubuntu:~$ source ~/.bashrc # 激活環(huán)境變量
(base) bio01@VM-0-10-ubuntu:~$ conda
(base) bio01@VM-0-10-ubuntu:~$ conda deactivate
bio01@VM-0-10-ubuntu:~$ 
conda后截圖
  1. 添加鏡像
# 使用清華鏡像
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
  1. 使用conda
    3.0 conda基本命令
positional arguments:
  command
    clean        Remove unused packages and caches.
    config       Modify configuration values in .condarc. This is modeled after the git config
                 command. Writes to the user .condarc file (/home/bio01/.condarc) by default.
    create       Create a new conda environment from a list of specified packages.
    help         Displays a list of available conda commands and their help strings.
    info         Display information about current conda install.
    init         Initialize conda for shell interaction. [Experimental]
    install      Installs a list of packages into a specified conda environment.
    list         List linked packages in a conda environment.
    package      Low-level conda package utility. (EXPERIMENTAL)
    remove       Remove a list of packages from a specified conda environment.
    uninstall    Alias for conda remove.
    run          Run an executable in a conda environment. [Experimental]
    search       Search for packages and display associated information. The input is a
                 MatchSpec, a query language for conda packages. See examples below.
    update       Updates conda packages to the latest compatible version.
    upgrade      Alias for conda update.

optional arguments:
  -h, --help     Show this help message and exit.
  -V, --version  Show the conda version number and exit.

?3.1 conda list 查看當前所有軟件列表

bio01@VM-0-10-ubuntu:~$ conda list
# packages in environment at /home/bio01/miniconda3:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main    defaults
asn1crypto                1.3.0                    py38_0    defaults
ca-certificates           2020.1.1                      0    defaults
certifi                   2019.11.28               py38_0    defaults
cffi                      1.14.0           py38h2e261b9_0    defaults
chardet                   3.0.4                 py38_1003    defaults
conda                     4.8.2                    py38_0    defaults

?3.2 conda search搜索軟件

bio01@VM-0-10-ubuntu:~$ conda search fastqc

圖示fastqc部分版本

?3.3 conda install安裝軟件

conda install fastqc -y #自動安裝最新版 可以去掉-y 手動
conda install fastqc=0.11.7 -y #選擇版本號的安裝

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

?3.4 conda remove fastqc -y卸載軟件

Q: 請問不想用了怎么卸得暢快輕松?
A :首先 rm -rf ~/miniconda3
B: 環(huán)境變量中去掉conda, vi ~/bash_profile 刪除conda路徑,退出保存
【有個小技巧:vim 中移動光標比如到第9行,使用dd就可以快速刪除整行】
生信小白第三天

?3.5 conda enviroment

bio01@VM-0-10-ubuntu:~$ conda info --envs
# conda environments:
#
                         /home/bio01/biosoft/:/home/bio01/bashrc
base                  *  /home/bio01/miniconda3   #標*為默認環(huán)境
conda create -n rna-seq python=3 fastqc trimmomatic -y   #建立一個名叫rnaseq的conda環(huán)境,然后指定python版本是3,安裝軟件fastqc、trimmomatic(這兩個可以一步完成)

bio01@VM-0-10-ubuntu:~$ conda info --envs   #查看環(huán)境
# conda environments:
#
                         /home/bio01/biosoft/:/home/bio01/bashrc
base                  *  /home/bio01/miniconda3
RNA-seq                  /home/bio01/miniconda3/envs/RNA-seq

bio01@VM-0-10-ubuntu:~$ conda activate RNA-seq   #因默認環(huán)境依然是miniconda3,故需要激活rna-seq的環(huán)境變量
(RNA-seq) bio01@VM-0-10-ubuntu:~$ conda info --envs
# conda environments:
#
                         /home/bio01/biosoft/:/home/bio01/bashrc
base                     /home/bio01/miniconda3
RNA-seq               *  /home/bio01/miniconda3/envs/RNA-seq
(RNA-seq) bio01@VM-0-10-ubuntu:~$ fastqc    #檢測fastqc是否在這里,是否可用
Exception in thread "main" java.awt.HeadlessException: 
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
    at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:208)
    at java.desktop/java.awt.Window.<init>(Window.java:548)
    at java.desktop/java.awt.Frame.<init>(Frame.java:423)
    at java.desktop/java.awt.Frame.<init>(Frame.java:388)
    at java.desktop/javax.swing.JFrame.<init>(JFrame.java:180)
    at uk.ac.babraham.FastQC.FastQCApplication.<init>(FastQCApplication.java:63)
    at uk.ac.babraham.FastQC.FastQCApplication.main(FastQCApplication.java:338)
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容