linux学习100篇36:转录组分析用软件及安装sra-tools

安装

(rnaseq) root 11:41:39 ~
$ conda install -y sra-tools=2.10.7
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.9.2
  latest version: 4.10.1

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: /root/miniconda3/envs/rnaseq

  added / updated specs:
    - sra-tools=2.10.7


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    curl-7.71.1                |       he644dc0_3         140 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    hdf5-1.10.5                |nompi_h5b725eb_1114         3.1 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    krb5-1.17.2                |       h926e7f8_0         1.4 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libcurl-7.71.1             |       hcdd3856_3         302 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libedit-3.1.20191231       |       he28a2e2_2         121 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libssh2-1.9.0              |       ha56f1ee_6         226 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ncbi-ngs-sdk-2.11.0        |       hff44eed_0         167 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    ossuuid-1.6.2              |    hf484d3e_1000          56 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    perl-5.26.2                |    h36c2ea0_1008        15.4 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    perl-app-cpanminus-1.7044  |          pl526_1         234 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-business-isbn-3.004   |          pl526_0          15 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-business-isbn-data-20140910.003|          pl526_0          15 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-carp-1.38             |          pl526_3          15 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-constant-1.33         |          pl526_1          10 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-data-dumper-2.173     |          pl526_0          35 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-encode-2.88           |          pl526_1         2.1 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-exporter-5.72         |          pl526_1          13 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-extutils-makemaker-7.36|          pl526_1         153 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-file-path-2.16        |          pl526_0          17 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-file-temp-0.2304      |          pl526_2          26 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-mime-base64-3.15      |          pl526_1          15 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-parent-0.236          |          pl526_1           5 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-uri-1.76              |          pl526_0          55 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-xml-libxml-2.0132     |  pl526h7ec2d77_1         260 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-xml-namespacesupport-1.12|          pl526_0          11 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-xml-sax-1.02          |          pl526_0          36 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-xml-sax-base-1.09     |          pl526_0          19 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    perl-xsloader-0.24         |          pl526_0           8 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    sra-tools-2.10.7           |  pl526haddd2b5_2        60.4 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    ------------------------------------------------------------
                                           Total:        84.4 MB

The following NEW packages will be INSTALLED:

  curl               anaconda/cloud/conda-forge/linux-64::curl-7.71.1-he644dc0_3
  hdf5               anaconda/cloud/conda-forge/linux-64::hdf5-1.10.5-nompi_h5b725eb_1114
  krb5               anaconda/cloud/conda-forge/linux-64::krb5-1.17.2-h926e7f8_0
  libcurl            anaconda/cloud/conda-forge/linux-64::libcurl-7.71.1-hcdd3856_3
  libedit            anaconda/cloud/conda-forge/linux-64::libedit-3.1.20191231-he28a2e2_2
  libssh2            anaconda/cloud/conda-forge/linux-64::libssh2-1.9.0-ha56f1ee_6
  ncbi-ngs-sdk       anaconda/cloud/bioconda/linux-64::ncbi-ngs-sdk-2.11.0-hff44eed_0
  ossuuid            anaconda/cloud/conda-forge/linux-64::ossuuid-1.6.2-hf484d3e_1000
  perl-app-cpanminus anaconda/cloud/bioconda/linux-64::perl-app-cpanminus-1.7044-pl526_1
  perl-business-isbn anaconda/cloud/bioconda/linux-64::perl-business-isbn-3.004-pl526_0
  perl-business-isb~ anaconda/cloud/bioconda/linux-64::perl-business-isbn-data-20140910.003-pl526_0
  perl-carp          anaconda/cloud/bioconda/linux-64::perl-carp-1.38-pl526_3
  perl-constant      anaconda/cloud/bioconda/linux-64::perl-constant-1.33-pl526_1
  perl-data-dumper   anaconda/cloud/bioconda/linux-64::perl-data-dumper-2.173-pl526_0
  perl-encode        anaconda/cloud/bioconda/linux-64::perl-encode-2.88-pl526_1
  perl-exporter      anaconda/cloud/bioconda/linux-64::perl-exporter-5.72-pl526_1
  perl-extutils-mak~ anaconda/cloud/bioconda/linux-64::perl-extutils-makemaker-7.36-pl526_1
  perl-file-path     anaconda/cloud/bioconda/linux-64::perl-file-path-2.16-pl526_0
  perl-file-temp     anaconda/cloud/bioconda/linux-64::perl-file-temp-0.2304-pl526_2
  perl-mime-base64   anaconda/cloud/bioconda/linux-64::perl-mime-base64-3.15-pl526_1
  perl-parent        anaconda/cloud/bioconda/linux-64::perl-parent-0.236-pl526_1
  perl-uri           anaconda/cloud/bioconda/linux-64::perl-uri-1.76-pl526_0
  perl-xml-libxml    anaconda/cloud/bioconda/linux-64::perl-xml-libxml-2.0132-pl526h7ec2d77_1
  perl-xml-namespac~ anaconda/cloud/bioconda/linux-64::perl-xml-namespacesupport-1.12-pl526_0
  perl-xml-sax       anaconda/cloud/bioconda/noarch::perl-xml-sax-1.02-pl526_0
  perl-xml-sax-base  anaconda/cloud/bioconda/linux-64::perl-xml-sax-base-1.09-pl526_0
  perl-xsloader      anaconda/cloud/bioconda/linux-64::perl-xsloader-0.24-pl526_0
  sra-tools          anaconda/cloud/bioconda/linux-64::sra-tools-2.10.7-pl526haddd2b5_2

The following packages will be DOWNGRADED:

  perl                                    5.32.0-h36c2ea0_0 --> 5.26.2-h36c2ea0_1008



Downloading and Extracting Packages
perl-5.26.2          | 15.4 MB   | ######################################## | 100% 
perl-xml-sax-1.02    | 36 KB     | ######################################## | 100% 
perl-data-dumper-2.1 | 35 KB     | ######################################## | 100% 
perl-mime-base64-3.1 | 15 KB     | ######################################## | 100% 
perl-xml-namespacesu | 11 KB     | ######################################## | 100% 
perl-business-isbn-3 | 15 KB     | ######################################## | 100% 
ossuuid-1.6.2        | 56 KB     | ######################################## | 100% 
libedit-3.1.20191231 | 121 KB    | ######################################## | 100% 
perl-xsloader-0.24   | 8 KB      | ######################################## | 100% 
libcurl-7.71.1       | 302 KB    | ######################################## | 100% 
perl-extutils-makema | 153 KB    | ######################################## | 100% 
perl-file-temp-0.230 | 26 KB     | ######################################## | 100% 
sra-tools-2.10.7     | 60.4 MB   | ######################################## | 100% 
perl-parent-0.236    | 5 KB      | ######################################## | 100% 
perl-carp-1.38       | 15 KB     | ######################################## | 100% 
perl-xml-libxml-2.01 | 260 KB    | ######################################## | 100% 
krb5-1.17.2          | 1.4 MB    | ######################################## | 100% 
perl-encode-2.88     | 2.1 MB    | ######################################## | 100% 
perl-file-path-2.16  | 17 KB     | ######################################## | 100% 
perl-constant-1.33   | 10 KB     | ######################################## | 100% 
perl-exporter-5.72   | 13 KB     | ######################################## | 100% 
perl-uri-1.76        | 55 KB     | ######################################## | 100% 
hdf5-1.10.5          | 3.1 MB    | ######################################## | 100% 
perl-xml-sax-base-1. | 19 KB     | ######################################## | 100% 
perl-app-cpanminus-1 | 234 KB    | ######################################## | 100% 
ncbi-ngs-sdk-2.11.0  | 167 KB    | ######################################## | 100% 
curl-7.71.1          | 140 KB    | ######################################## | 100% 
perl-business-isbn-d | 15 KB     | ######################################## | 100% 
libssh2-1.9.0        | 226 KB    | ######################################## | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(rnaseq) root 11:45:53 ~

查看

(rnaseq) root 11:51:10 ~
$ prefetch
Usage:
  prefetch [options] <SRA accession> [...]
  Download SRA files and their dependencies

  prefetch [options] --cart <kart file>
  Download cart file

  prefetch [options] <URL> --output-file <FILE>
  Download URL to FILE

  prefetch [options] <URL> [...] --output-directory <DIRECTORY>
  Download URL or URL-s to DIRECTORY

  prefetch [options] <SRA file> [...]
  Check SRA file for missed dependencies and download them

(rnaseq) root 11:51:32 ~

文章目录

1. 介绍

  • Sratools是NCBI官方提供,用于操作SRA (reads and reference alignments) 数据的工具集合
  • 一般常用于下载SRA文件,从SRA文件中提取fastq,sam文件,查看SRA文件信息等

2. 安装

这里提供两种方法,选择一种安装即可,强烈建议使用Conda方式安装

2.1 Conda 安装

conda install -y sra-tools

这里需要安装Conda (一款用于安装多数生物信息分析软件的管理软件,重要的是可以解决软件的依赖问题) : Conda 安装使用图文详解

2.2 传统安装

下载

下载地址1:https://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?cmd=show&f=software&m=software&s=software 下载地址2:https://github.com/ncbi/sra-tools/wiki/Downloads

在Linux系统(以CentOS为例)下将上述的链接下载到本地

解压

设置环境变量

所有的可执行文件均在sratoolkit.2.9.6-1-centos_linux64/bin目录下 环境变量添加的详细方法:Linux 添加环境变量的五种方法

  • 打开环境变量设置文件
  • 添加软件 bin 目录的路径,并用 : 隔开
  • 执行source命令,使配置立即生效

3. 使用

官方文档:https://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=toolkit_doc

3.1 下载SRA

https://github.com/ncbi/sra-tools/wiki/HowTo:-Access-SRA-Data

下载单个文件

prefetch SRR390728

下载多个文件

prefetch cart_0.krt

3.2 抽取fastq文件

fastq-dump --split-3 SRR893046 -O fastq

注意:NCBI其实已经更新了一个多线程抽取工具fasterq-dump,可以在sratools的bin目录里找到,但是文档没有写,没有特殊需求的话,可以考虑直接用新工具替代。

这个fasterq-dumpfastq-dump相比,就像动车碾压绿皮火车,用法如下:

fasterq-dump --split-3 SRR893046 -O fastq

详情查看:https://www.jianshu.com/p/5c97a34cc1ad

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

推荐阅读更多精彩内容