dbGap官方FQ:
下载: https://www.ncbi.nlm.nih.gov/books/NBK36439/
解密: https://www.ncbi.nlm.nih.gov/books/NBK63512/
SRA toolkit documentation:
https://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=toolkit_doc
https://github.com/ncbi/sra-tools/wiki
dbGap数据下载及解密
- 登录dbGap
- "My Requests" --> "Approved" --> 选择数据集 --> "Request Files" --> "Access Request"
- 选择SRA数据或者Phenotype and Genotype数据
- SRA数据通过"SRA RUN Selector"选择数据,Phenotype and Genotype数据通过dgGap File Selector选择数据
- 下载"Cart File" (.kart)
- 下载project的秘钥文件:
dbGap --> "My projects" --> "get dbGap repository key" 下载秘钥文件(.ngc) - 通过SRA toolkit工具下载,v2.10.2之后本版无需配置工作空间即可下载数据,只需在下载时添加 --ngc 秘钥.ngc参数
v2.10.2之前版本配置方法:运行SRA toolkit bin目录下的vdb-config:vdb-config -i
配置:https://github.com/ncbi/sra-tools/wiki/05.-Toolkit-Configuration
下载方式(v2.10.2之后版本):
1) 已经安装Aspera Connect:
prefetch -a %ASPERA_CONNECT_DIR%/bin/ascp|%ASPERA_CONNECT_DIR%/ect/asperaweb_id_dsa.openssh --ngc 秘钥.ngc --cart cart_file.kart -O output_dir/
NOTE: %ASPERA_CONNECT_DIR%为Aspera Connect安装目录。
2) 未安装Aspera Connect, 通过http下载:
prefetch --ngc 秘钥.ngc --cart cart_file.kart -O output_dir/
- 对数据进行解密
使用SRA toolkit中的vdb-decrypt工具进行解密,v2.10.x之前版本需要配置工作空间,之后版本无需配置,直接使用--ngc参数。
NOTE: SRA文件无需解密可直接使用fastq-dump进行转换。
SRA文件使用SRA toolkit中的fastq-dump转换成fastq文件,相比于普通的SRA文件,dbGAP申请的SRA文件添加--ngc 密钥.ngc
参数。
NOTE: 必须使用当次申请的密钥文件,举个例子,同一个数据我前后申请了2次,下载了2个不同的密钥文件,第二次的密钥文件就不能用于第一次申请的数据(虽然数据相同)。
解密整个文件夹:
vdb-decrypt --ngc 秘钥.ngc 待解密文件夹
解密单个文件:
vdb-decrypt --ngc 秘钥.ngc input_file output_file
常规SRA数据下载
NOTE: Prefetch已经不支持ascp下载:https://github.com/ncbi/sra-tools/issues/255
#SRA数据下载:
prefetch --option-file accession_lixt.txt -O output_dir/
#转换为fastq文件:
fastq-dump --split-e --gzip input.sra -O output_dir/
--option-file: 从文件中读取参数,直接使用SRR号时不使用此参数。
--split-e: 3-way splitting for mate-pairs. For each spot, if there are two biological reads satisfying filter conditions, the first is placed in the *_1.fastq
file, and the second is placed in the *_2.fastq
file. If there is only one biological read satisfying the filter conditions, it is placed in the *.fastq
file.All other reads in the spot are ignored. 如果是pair的reads将分别保存在 1.fastq和2.fastq两个文件中,非pair的reads将保存在单独的文件中。
--gzip/--bzip2: 压缩