学校小组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)
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 217,542评论 6 504
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,822评论 3 394
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 163,912评论 0 354
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,449评论 1 293
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,500评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,370评论 1 302
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,193评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,074评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,505评论 1 314
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,722评论 3 335
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,841评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,569评论 5 345
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,168评论 3 328
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,783评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,918评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,962评论 2 370
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,781评论 2 354