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

詳情查看:http://www.lxweimin.com/p/5c97a34cc1ad

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 228,646評論 6 533
  • 序言:濱河連續發生了三起死亡事件,死亡現場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機,發現死者居然都...
    沈念sama閱讀 98,595評論 3 418
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事?!?“怎么了?”我有些...
    開封第一講書人閱讀 176,560評論 0 376
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,035評論 1 314
  • 正文 為了忘掉前任,我火速辦了婚禮,結果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當我...
    茶點故事閱讀 71,814評論 6 410
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發上,一...
    開封第一講書人閱讀 55,224評論 1 324
  • 那天,我揣著相機與錄音,去河邊找鬼。 笑死,一個胖子當著我的面吹牛,可吹牛的內容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,301評論 3 442
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 42,444評論 0 288
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當地人在樹林里發現了一具尸體,經...
    沈念sama閱讀 48,988評論 1 335
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 40,804評論 3 355
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發現自己被綠了。 大學時的朋友給我發了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 42,998評論 1 370
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,544評論 5 360
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質發生泄漏。R本人自食惡果不足惜,卻給世界環境...
    茶點故事閱讀 44,237評論 3 347
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 34,665評論 0 26
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 35,927評論 1 287
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個月前我還...
    沈念sama閱讀 51,706評論 3 393
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 47,993評論 2 374

推薦閱讀更多精彩內容