学习小组Day3笔记--smartyy

1.Linux如何安装软件?

联想一下我们在手机上如何安装软件?是不是在app store(应用商店)里搜索并安装。
而Linux的应用商店是conda,所以如果想在Linux安装软件,就得给我的服务器下载conda,我们使用conda的精华版--miniconda

下面开始安装和配置miniconda吧!

如何下载miniconda?

百度搜索“miniconda清华“点进去之后会出现一个界面
可见linux下面有64-bit(x86_64)、32-bit(x86)两种版本,那我应该选择哪个呢?
这取决于我的服务器是多少位的,可以输入命令uname -a来查看。

(base) bio17@VM-0-10-ubuntu:~$ uname -a
Linux VM-0-10-ubuntu 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

把miniconda下载到昨天新建的soft目录中吧!怎么做呢?
先输入cd soft指令进入soft目录中。
右键复制选中的下载链接
然后使用wget指令,点一下右键,即可将刚刚所复制的下载链接粘贴到wget指令后面,回车键开始下载
.sh是脚本的后缀,所以其实这下载的是一个脚本,如果安装失败也不需要重新下载这个脚本,还可以用。

如何安装miniconda?

输入指令
bash Miniconda3-latest-Linux-x86_64.sh按回车跳过安装过程

Thank you for installing Miniconda3!

miniconda安装成功
【注意】最后还要激活conda
使用命令source ~/.bashrc来激活conda,接着命令行输入conda

(base) bio17@VM-0-10-ubuntu:~/soft$ 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/bio17/.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

出现这样满屏的信息说明就成功了安装conda

添加镜像

将以下代码复制并输入到命令行即可

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

1.查看当前所有软件列表

命令:conda list

(base) bio17@VM-0-10-ubuntu:~/soft$ conda list
# packages in environment at /home/bio17/miniconda3:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
_openmp_mutex             4.5                       0_gnu    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ca-certificates           2019.11.28           hecc5488_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
certifi                   2019.11.28       py37hc8dfbb8_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
cffi                      1.14.0           py37hd463f26_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
chardet                   3.0.4                 py37_1003    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda                     4.8.2                    py37_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda-package-handling    1.6.0            py37h516909a_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
cryptography              2.8              py37h72c5cf5_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
idna                      2.9                        py_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libedit                   3.1.20181209         hc058e9b_0    defaults
libffi                    3.2.1             he1b5a44_1006    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libgcc-ng                 9.2.0                h24d8f2e_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libgomp                   9.2.0                h24d8f2e_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libstdcxx-ng              9.2.0                hdf63c60_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ncurses                   6.1               hf484d3e_1002    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
openssl                   1.1.1d               h516909a_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pip                       20.0.2                     py_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pycosat                   0.6.3           py37h8f50634_1003    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pycparser                 2.20                       py_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pyopenssl                 19.1.0                     py_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pysocks                   1.7.1                    py37_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python                    3.7.4                h265db76_1    defaults
python_abi                3.7                     1_cp37m    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
readline                  7.0               hf8c457e_1001    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
requests                  2.23.0                   py37_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ruamel_yaml               0.15.80         py37h516909a_1000    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
setuptools                46.0.0           py37hc8dfbb8_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
six                       1.14.0                   py37_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
sqlite                    3.31.1               h7b6447c_0    defaults
tk                        8.6.10               hed695b0_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
tqdm                      4.43.0                     py_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
urllib3                   1.25.7                   py37_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
wheel                     0.34.2                     py_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
xz                        5.2.4             h14c3975_1001    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
yaml                      0.2.2                h516909a_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
zlib                      1.2.11            h516909a_1006    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge

2.搜索软件

命令:conda search fastqc(以软件fastqc为例)

(base) bio17@VM-0-10-ubuntu:~/soft$ 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 fastqc -y
(加上-y是自动安装)默认安装最新版本
如果想安装指定版本号,可以使用命令conda install fastqc=0.11.7 -y

(base) bio17@VM-0-10-ubuntu:~/soft$ conda install fastqc=0.11.7 -y
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/bio17/miniconda3

  added / updated specs:
    - fastqc=0.11.7


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2019.11.28         |   py37hc8dfbb8_1         149 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ------------------------------------------------------------
                                           Total:         149 KB

The following NEW packages will be INSTALLED:

4.卸载软件

命令:conda remove fastqc -y

(base) bio17@VM-0-10-ubuntu:~/soft$ conda remove fastqc=0.11.7 -y
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/bio17/miniconda3

  removed specs:
    - fastqc=0.11.7


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    six-1.14.0                 |             py_1          13 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ------------------------------------------------------------
                                           Total:          13 KB

The following packages will be REMOVED:

  alsa-lib-1.1.5-h516909a_1002
  fastqc-0.11.7-6

5.查看和新建conda环境

  • 命令conda info --envs查看当前conda有哪些环境
(base) bio17@VM-0-10-ubuntu:~/soft$ conda info --envs
# conda environments:
#
base                  *  /home/bio17/miniconda3

前面带*号的环境就是默认环境,可以看到我们目前就一个conda环境

  • 命令:conda create -n rna-seq python=3 fastqc trimmomatic -y
    新建一个名为rna-seq的conda环境,然后指定python的版本是3,安装软件fastqctrimmonatic(这些都可以一步完成)
    现在来创建一个上述的新的conda环境吧
(base) bio17@VM-0-10-ubuntu:~/soft$ conda create -n rna-seq python=3 fastqc trimmomatic -y
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/bio17/miniconda3/envs/rna-seq

  added / updated specs:
    - fastqc
    - python=3
    - trimmomatic


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2019.11.28         |   py38h32f6830_1         149 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ld_impl_linux-64-2.33.1    |       h53a641e_8         589 KB  https://mirror

创建完成后,用命令conda info --envs来查看一下我的conda环境是否新增了一个rna-seq呢?

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

可以看到,默认 * 还是base,只有激活新的conda环境rna-seq,* 号才能转移到rna-seq前面

  • 命令:conda activate rna-seq激活新环境rna-seq,试一下吧
(base) bio17@VM-0-10-ubuntu:~/soft$ conda activate rna-seq
(rna-seq) bio17@VM-0-10-ubuntu:~/soft$ conda info --envs #查看一下当前默认环境是否发生改变
# conda environments:
#
base                     /home/bio17/miniconda3
rna-seq               *  /home/bio17/miniconda3/envs/rna-seq
  • 命令fastqc可以直接调用软件fastqc,如果出现一大片帮助信息,说明现在可以直接使用fastqc软件了
(rna-seq) bio17@VM-0-10-ubuntu:~/soft$ 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阅读 204,921评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 87,635评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,393评论 0 338
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,836评论 1 277
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,833评论 5 368
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,685评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,043评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,694评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 42,671评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,670评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,779评论 1 332
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,424评论 4 321
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,027评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,984评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,214评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,108评论 2 351
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,517评论 2 343

推荐阅读更多精彩内容