磕盐——从入门到自闭

RNA-seq从入门到自闭(SRA2Fastq)

2020-09-09  本文已影响0人  邵扬_Barnett

SRA2Fastq本来是想跟上一节一起写的,但是写着写着发现又有些新的想法了。既然是写命令行,不如就写的完整一些。

安装miniconda

Miniconda is a free minimal installer for conda. It is a small, bootstrap version of Anaconda that includes only conda, Python, the packages they depend on, and a small number of other useful packages, including pip, zlib and a few others. Use the conda install command to install 720+ additional conda packages from the Anaconda repository.
Miniconda是conda的最小化安装程序。 Miniconda是anaconda的一个小引导版本,其中只包含conda、Python和它们所依赖的少量安装包,如pip、zlib等。我们可以通过使用conda install命令,从Anaconda仓库中安装720多个额外的conda包。

首先linux需要安装miniconda,最新版本地址见链接。
https://docs.conda.io/en/latest/miniconda.html#installing


复制链接
在硬盘里找个地方新建一个文件夹,名字随意。

这文件夹中打开WSL,然后使用wget命令下载文件。
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

注意:这一步其实直接右键保存也一样的。这里是为了让大家熟悉命令行

然后输入

bash Miniconda3-latest-Linux-x86_64.sh

按照命令行的提示一步一步来



如输入回车,然后看license



如输入
yes

回车(默认目录安装就好),等待完成就好了
最后输入

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge

给miniconda增加上bioconda的channel

安装SRA-tools

还是在命令行,直接输入

conda install sra-tools

看到提示所有的package都已经被installed的就行,因为我早就安装过了,不知道重新安装是否还需要输入y/yes之类的。总之看提示随机应变吧。

Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

打开你存储sra文件的位置,发动技能,“瞧”
可以看到文件是从56-79,不难用for语句写出
for i in `seq 56 79`;
do
    fasterq-dump --split-3 -p SRR51316${i}.sra;
done

当然,也可以发动技能“懒得瞧”,让系统给我把叫sra的都处理了。

ls *sra |while read id; do fasterq-dump --split-3 -p $id;done

之后你需要等就完了

spots read      : 22,452,438
reads read      : 44,904,876
reads written   : 22,452,438
reads 0-length  : 22,452,438
join   :|------------- 26.76

TBtools SRA2Fastq

对于参与内测的用户,瞧与不瞧就无所谓了。你只要把文件“拖”进来


点击开始,然后就能去喝咖啡了。

这之后你也可以再看看两种方法最终结果有没有区别,最后发现行数一样的,所以一样的……
最后命令行除了fasterq-dump外还有fastq-dump和pfastq-dump,感兴趣的话请自行尝试吧。这里发现fastq-dump似乎不能用--split-3命令了,具体原因不清楚了。更新,群里小伙伴提醒fasta-dump改成--split-e了。



最后给出一张时间对比图,祝大家磕盐顺利。

上一篇下一篇

猜你喜欢

热点阅读