从NCBI 下载SRA文件,导入到QIIME2 软件中(上)-安装并配置SRA下载小工具,小工具使用

本文主要内容

  1. 从NCBI下载SRA文件,并转换fastq 文件
  2. 导入QIIME2

从NCBI下载SRA文件

安装SRA下载小工具

  1. 检查服务器版本
uname -a

在这里插入图片描述
2. toolkit下载地址 - 版本选择
https://github.com/ncbi/sra-tools/wiki/01.-Downloading-SRA-Toolkit

压缩包地址
https://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/2.10.8/sratoolkit.2.10.8-ubuntu64.tar.gz

安装教程

https://github.com/ncbi/sra-tools/wiki/02.-Installing-SRA-Toolkit

主要是解压,然后配置环境变量即可,没有用到管理员权限,下次开机可能要重新配

配置环境变量的方法:
$PWD 表示输入当前命令所在的路径
确保指向的是这个bin文件夹

export PATH=$PATH:$PWD/sratoolkit.2.10.8-ubuntu64/bin

如果路径没有设置对,which命令会出问题,或者没有输出

在这里插入图片描述

  1. 根据教程安装之后,输入这个命令,出现一个界面
    教程路径
    允许远程访问 ,配置命令
vdb-config -i

https://github.com/ncbi/sra-tools/wiki/03.-Quick-Toolkit-Configuration
在这里插入图片描述
在这里插入图片描述
设置这两处,[X]表示enable
4. 测试是否成功下载,并得到结果

fastq-dump --stdout SRR390728 | head -n 8
@SRR390728.1 1 length=72
CATTCTTCACGTAGTTCTCGAGCCTTGGTTTTCAGCGATGGAGAATGACTTTGACAAGCTGAGAGAAGNTNC
+SRR390728.1 1 length=72
;;;;;;;;;;;;;;;;;;;;;;;;;;;9;;665142;;;;;;;;;;;;;;;;;;;;;;;;;;;;;96&&&&(
@SRR390728.2 2 length=72
AAGTAGGTCTCGTCTGTGTTTTCTACGAGCTTGTGTTCCAGCTGACCCACTCCCTGGGTGGGGGGACTGGGT
+SRR390728.2 2 length=72
;;;;;;;;;;;;;;;;;4;;;;3;393.1+4&&5&&;;;;;;;;;;;;;;;;;;;;;<9;<;;;;;464262

根据SRA-accessions 提取fastq文件

extract FASTQ-files from SRA-accessions

https://github.com/ncbi/sra-tools/wiki/08.-prefetch-and-fasterq-dump

combination of ‘prefetch’ + ‘fasterq-dump’ is the fastest way to extract FASTQ-files from SRA-accessions.

这里需要注意磁盘容量

Before you perform the extraction, you should make a quick estimation about the hard-drive space required. The final fastq-files will be approximately 7 times the size of the accession . Fasterq-dump needs temporary space ( scratch space ) during the conversion of about 1.5 times the amount of the fastq-files . Overall the space you need during the conversion is approximately 17 times the size of the accession . You can check how much space you have by running $df -h … Under the 4th column ( 'Avail" ), you see the amount of space you have available. Please take into account that here might be quotas set by your administrator, which are not always visible.

比如下面这个accession 是5G

在这里插入图片描述

尝试下载,官方给的案例找不到accession
在ncbi官网上找了一个
这个比较小,实验跑起来比较快

在这里插入图片描述

prefetch SRR11192680 -O data

转换为fastq,默认是分割成三个子文件,这里不需要分割,用下面代码

fastq-dump SRR000001 --split-spot --skip-technical

可以不用prefetch先下载,直接根据accession 拿到fastq

fastq-dump --split-files SRR390728

至此,成功下载sra文件,并解压出fastq
sra-> fastq

在这里插入图片描述
上文是直接提取fastq文件,如果需要根据单双端进行拆分,参考下文

根据单双端拆分

在这里插入图片描述

fastq-dump --split-e SRR11192680

在这里插入图片描述

红色方框里面是得到的是拆分后的双端序列,一个是前向,一个是反向

下一步是把fastq文件导入QIIME2 中

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值