安裝
(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) 數(shù)據(jù)的工具集合
- 一般常用于下載SRA文件,從SRA文件中提取fastq,sam文件原环,查看SRA文件信息等
2. 安裝
這里提供兩種方法祠锣,選擇一種安裝即可束莫,強(qiáng)烈建議使用Conda方式安裝
2.1 Conda 安裝
conda install -y sra-tools
這里需要安裝Conda (一款用于安裝多數(shù)生物信息分析軟件的管理軟件碧注,重要的是可以解決軟件的依賴問題) : Conda 安裝使用圖文詳解
2.2 傳統(tǒng)安裝
下載
下載地址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系統(tǒng)(以CentOS為例)下將上述的鏈接下載到本地
解壓
設(shè)置環(huán)境變量
所有的可執(zhí)行文件均在
sratoolkit.2.9.6-1-centos_linux64/bin
目錄下 環(huán)境變量添加的詳細(xì)方法:Linux 添加環(huán)境變量的五種方法
- 打開環(huán)境變量設(shè)置文件
- 添加軟件 bin 目錄的路徑竖哩,并用
:
隔開 - 執(zhí)行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
下載單個(gè)文件
prefetch SRR390728
下載多個(gè)文件
prefetch cart_0.krt
3.2 抽取fastq文件
fastq-dump --split-3 SRR893046 -O fastq
注意:NCBI其實(shí)已經(jīng)更新了一個(gè)多線程抽取工具fasterq-dump
怀跛,可以在sratools的bin目錄里找到,但是文檔沒有寫柄冲,沒有特殊需求的話吻谋,可以考慮直接用新工具替代。
這個(gè)fasterq-dump
與fastq-dump
相比现横,就像動車碾壓綠皮火車漓拾,用法如下:
fasterq-dump --split-3 SRR893046 -O fastq