学校小组Day3笔记-MN

“生信星球(wx:babyfox2017)”的课程学习笔记。

conda相当于App Store,通过conda进行其他软件的安装。做生信安装miniconda即可。

1.下载/安装/激活miniconda

1. 在终端unman -a,确定系统类型及位数。

系统版本确定

2. 下载miniconda

用搜索引擎搜索“miniconda 清华”,打开清华镜像网站。

搜索conda 清华

进入页面,找到miniconda下载界面。
miniconda下载链接

进入下载界面,找到符合系统要求的miniconda版本的最新版,右击-复制链接。
注意,conda是装在服务器中的,所以要看服务器的系统版本,和本地电脑系统无关。
屏幕快照 2020-05-10 上午11.56.02.png

进入欲存储路径,这里是/home/bio01/biosoft,在终端用wget命令,复制链接内容,回车,即开始下载miniconda。

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_4.8.2-Linux-x86_64.sh
完成下载miniconda
  • .sh是脚本,可运行软件,我理解为安装包。即便后面安装出现问题,只要安装包在,就可以重新开始安装。

3. 安装miniconda

命令bash Miniconda3-py38_4.8.2-Linux-x86_64.sh,即bash+脚本名称,回车后,安装开始,让写yes就yes,让Enter就Enter。License Agreement里有好多东西,不用看,一直按Enter向下就可以了。


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

Welcome to Miniconda3 4.8.2

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> 
===================================
End User License Agreement - Anaconda Individual Edition
===================================

Copyright 2015-2020, Anaconda, Inc.

All rights reserved under the 3-clause BSD License:

This End User License Agreement (the "Agreement") is a legal agreement between you and Anaconda
, Inc. ("Anaconda") and governs your use of Anaconda Individual Edition (which was formerly kno
wn as Anaconda Distribution).

Subject to the terms of this Agreement, Anaconda hereby grants you a non-exclusive, non-transfe
rable license to:

  * Install and use the Anaconda Individual Edition (which was formerly known as Anaconda Distr
ibution),
  * Modify and create derivative works of sample source code delivered in Anaconda Individual E
dition; and
  * Redistribute code files in source (if provided to you by Anaconda as source) and binary for
ms, with or without modification subject to the requirements set forth below.

直到出现问yes/no时,输入yes。后面依然是Enter。


安装过程

最后出现Thank you ……即安装成功。

==> For changes to take effect, close and re-open your current shell. <==

If you'd prefer that conda's base environment not be activated on startup, 
   set the auto_activate_base parameter to false: 

conda config --set auto_activate_base false

Thank you for installing Miniconda3!

4. 激活

输入命令source ~/.bashrc,回车。
再输入conda,回车,出现一大堆信息,即为激活成功。

bio01@VM-0-10-ubuntu:~/biosoft$ source ~/.bashrc
(base) bio01@VM-0-10-ubuntu:~/biosoft$ conda
usage: conda [-h] [-V] command ...

conda is a tool for managing and deploying applications, environments and packages.

Options:

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.

conda commands available from other packages:
  env

5. 添加镜像

# 使用清华镜像
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

到此为止,conda安装并激活成功,可以开始使用。

2. Conda的使用

1. 查看当前软件列表

conda list

2. 搜索软件

conda search 软件名

(base) bio01@VM-0-10-ubuntu:~/biosoft$ conda search fastqc
Loading channels: done
# Name                       Version           Build  Channel             
fastqc                        0.10.1               0  anaconda/cloud/bioconda
fastqc                        0.10.1               1  anaconda/cloud/bioconda
fastqc                        0.11.2               1  anaconda/cloud/bioconda
fastqc                        0.11.2      pl5.22.0_0  anaconda/cloud/bioconda
fastqc                        0.11.3               0  anaconda/cloud/bioconda
fastqc                        0.11.3               1  anaconda/cloud/bioconda
fastqc                        0.11.4               0  anaconda/cloud/bioconda
fastqc                        0.11.4               1  anaconda/cloud/bioconda
fastqc                        0.11.4               2  anaconda/cloud/bioconda
fastqc                        0.11.5               1  anaconda/cloud/bioconda
fastqc                        0.11.5               4  anaconda/cloud/bioconda
fastqc                        0.11.5      pl5.22.0_2  anaconda/cloud/bioconda
fastqc                        0.11.5      pl5.22.0_3  anaconda/cloud/bioconda
fastqc                        0.11.6               2  anaconda/cloud/bioconda
fastqc                        0.11.6      pl5.22.0_0  anaconda/cloud/bioconda
fastqc                        0.11.6      pl5.22.0_1  anaconda/cloud/bioconda
fastqc                        0.11.7               4  anaconda/cloud/bioconda
fastqc                        0.11.7               5  anaconda/cloud/bioconda
fastqc                        0.11.7               6  anaconda/cloud/bioconda
fastqc                        0.11.7      pl5.22.0_0  anaconda/cloud/bioconda
fastqc                        0.11.7      pl5.22.0_2  anaconda/cloud/bioconda
fastqc                        0.11.8               0  anaconda/cloud/bioconda
fastqc                        0.11.8               1  anaconda/cloud/bioconda
fastqc                        0.11.8               2  anaconda/cloud/bioconda
fastqc                        0.11.9               0  anaconda/cloud/bioconda

3. 安装软件

conda install 软件名 -y -y表示自动安装,不加-y就需要来回答一些yes/no的问题。
conda install 软件名=版本号 -y可指定安装版本。
conda install fastqc=0.11.17

4. 卸载软件

conda remove 软件名 -y

3. conda环境

我们处理不同数据时,可以创建不同的环境,使安装的软件、数据互相不影响。

1. 查看当前环境

conda info --envs,可以看到现在只有一个默认环境。

(base) bio01@VM-0-10-ubuntu:~/miniconda3$ conda info --envs
# conda environments:
#
base                  *  /home/bio01/miniconda3

2. 新建一个环境

create -n 环境名 python= 版本 软件名 软件名 …… -y,创建环境,确定python版本,并安装几种软件。

新建环境

此时,用conda info --envs查看信息,可以看到新增了一个rna-seq环境。

(base) bio01@VM-0-10-ubuntu:~/miniconda3$ conda info --envs
# conda environments:
#
base                  *  /home/bio01/miniconda3
rna-seq                  /home/bio01/miniconda3/envs/rna-seq

3. 激活新环境

activate conda 环境名,root前出现新环境名。
再输入fastqc,可以看到出现一些信息,说明新环境被激活,并且软件可以使用。

(base) bio01@VM-0-10-ubuntu:~/miniconda3$ conda activate rna-seq
(rna-seq) bio01@VM-0-10-ubuntu:~/miniconda3$ 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)
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容