本文主要内容
- 从NCBI下载SRA文件,并转换fastq 文件
- 导入QIIME2
从NCBI下载SRA文件
安装SRA下载小工具
- 检查服务器版本
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命令会出问题,或者没有输出
- 根据教程安装之后,输入这个命令,出现一个界面
教程路径
允许远程访问 ,配置命令
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 中