上游分析!SRA数据的下载和数据质控!

学术   2024-09-22 07:30   上海  

高通量测序数据分析流程:①测序数据下载(SRA Toolkit);②测序数据质控与过滤(fastp);③序列比对(SAMtools、HISAT2);④序列组装(StringTie、TACO);⑤表达定量和差异表达分析(Salmon、DESeq2)及富集分析(clusterProfiler)等。SRA(Sequence Read Archive)数据库存储了二代测序的原始数据,也存储raw reads在参考基因的比对信息。根据数据产生特点,将SRA数据分为四类:Studies--研究课题;Experiments--实验设计;Runs--测序结果集;Samples--样品信息。SRA中数据结构的层次关系为:Studies->Experiments->Samples->Runs。

一个Study可能包含多个Experiments。Experiments则包含了Sample、DNA source、测序平台、数据处理等。一个Experiment可包含一个或多个Runs。Runs表示测序仪运行所产生的Reads。SRA数据库用不同的前缀加以区分:ERP或SRP表示Studies;SRS表示 Samples;SRX 表示 Experiments;SRR 表示 Runs。
1. SRA toolkit软件下载

SRA Toolkit可用于直接下载NCBI中的SRA数据文件和参考序列并转换为fastq格式。下载SRA数据前,我们需要先安装SRA Toolkit软件包。
## 下载地址https://github.com/ncbi/sra-tools/wiki/01.-Downloading-SRA-Toolkit

目前已经更新到3.3.1版本。我这里使用的是Ubuntu Linux 64 bit。

## 下载安装 SRA toolkitwget "https://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/3.1.1/sratoolkit.3.1.1-ubuntu64.tar.gz"## 提取压缩文件tar -zxvf sratoolkit.3.1.1-ubuntu64.tar.gz  # 解压缩vdb-config --interactive # 配置(按X退出后即可正常使用)
## 检查配置prefetch -V

用SRAtoolkit下载并处理NCBI数据。将 .sra文件转换为 .fstaq.gz文件。

# 下载prefetch SRR6283792 -O .  #-O . 指定到当前路径,否则默认路径难找# 解压fastq-dump SRR6283792.sra #解压后从sra文件变为fastq文件# 双端测序要加–split-files,否则两端的数据不会分开,难以被其他软件读取# 建议加上–gzip,将解压后的数据用gzip压缩,避免占用过多空间

2.测序数据质控与过滤:fastp

fastq格式是一种基于文本的存储生物序列和对应碱基(或氨基酸)质量的文件格式。最初由桑格研究所(Wellcome Trust Sanger Institute)开发,现在是存储高通量测序数据的标准。

第1行主要储存序列测序时的坐标信息等。

第2行是测序得到的序列信息,一般用ATCGN来表示。

第3行以“+”开始,可以储存一些附加信息,一般是空的。

第4行储存质量信息,与第2行的碱基序列一一对应。每个符号对应的ASCII值成为phred值,可以简单理解为对应位置碱基的质量,越大说明测序质量越好。

# 进行fastqc, 每个*.fq.gz文件都会得到一个网页文件,可直接通过浏览器查看测序的质量nohup fastqc -t 6 -o ./ SRR*.fastq.gz >qc.log &  
#安装 multiqcconda install multiqc
# fastqc后的zip数据进行multiqc,将多个质控报告合并为一个,便于查看nohup multiqc ./*.zip -o ./ > ./multiqc.log &
## 数据过滤的目的:去除低质量的数据和测序接头等conda install trim-galore$ trim_galore –help$ trim_galore –help | more$ trim_galore --illumina --fastqc SRR6283792.fastq.gz
运行之后,输出的结果如下:
>>> Now performing quality (cutoff '-q 20') and adapter trimming in a single pass for the adapter sequence: 'AGATCGGAAGAGC' from file SRR6283792.fastq.gz <<< 10000000 sequences processed20000000 sequences processed30000000 sequences processed40000000 sequences processed50000000 sequences processed60000000 sequences processed70000000 sequences processed80000000 sequences processed90000000 sequences processedThis is cutadapt 4.9 with Python 3.12.2Command line parameters: -j 1 -e 0.1 -q 20 -O 1 -a AGATCGGAAGAGC SRR6283792.fastq.gzProcessing single-end reads on 1 core ...Finished in 2139.308 s (21.405 µs/read; 2.80 M reads/minute).
=== Summary ===
Total reads processed: 99,943,320Reads with adapters: 24,370,603 (24.4%)Reads written (passing filters): 99,943,320 (100.0%)
Total basepairs processed: 11,991,108,334 bpQuality-trimmed: 311,435,040 bp (2.6%)Total written (filtered): 11,642,048,903 bp (97.1%)
=== Adapter 1 ===
Sequence: AGATCGGAAGAGC; Type: regular 3'; Length: 13; Trimmed: 24370603 times
Minimum overlap: 1No. of allowed errors:1-9 bp: 0; 10-13 bp: 1
Bases preceding removed adapters: A: 19.4% C: 37.8% G: 25.6% T: 16.8% none/other: 0.3%
Overview of removed sequenceslength count expect max.err error counts1 14970037 24985830.0 0 149700372 6674781 6246457.5 0 66747813 2426999 1561614.4 0 24269994 125056 390403.6 0 1250565 139063 97600.9 0 1390636 13074 24400.2 0 130747 4523 6100.1 0 45238 184 1525.0 0 1849 1727 381.3 0 21 170610 3619 95.3 1 181 343811 2073 23.8 1 1 207212 856 6.0 1 4 85213 146 1.5 1 0 14614 60 1.5 1 0 6015 123 1.5 1 0 12316 68 1.5 1 0 6817 59 1.5 1 0 5918 61 1.5 1 0 6119 116 1.5 1 0 11620 73 1.5 1 0 7321 110 1.5 1 0 11022 95 1.5 1 1 9423 69 1.5 1 0 6924 143 1.5 1 0 14325 85 1.5 1 0 8526 81 1.5 1 0 8127 109 1.5 1 1 10828 39 1.5 1 0 3929 77 1.5 1 0 7730 55 1.5 1 0 5531 43 1.5 1 0 4332 36 1.5 1 0 3633 76 1.5 1 0 7634 73 1.5 1 0 7335 57 1.5 1 0 5736 56 1.5 1 0 5637 38 1.5 1 0 3838 71 1.5 1 0 7139 64 1.5 1 0 6440 63 1.5 1 0 6341 34 1.5 1 0 3442 64 1.5 1 0 6443 94 1.5 1 0 9444 49 1.5 1 0 4945 73 1.5 1 0 7346 64 1.5 1 1 6347 59 1.5 1 0 5948 87 1.5 1 0 8749 49 1.5 1 0 4950 67 1.5 1 1 6651 207 1.5 1 1 20652 73 1.5 1 0 7353 51 1.5 1 0 5154 67 1.5 1 0 6755 75 1.5 1 0 7556 62 1.5 1 0 6257 68 1.5 1 0 6858 60 1.5 1 0 6059 69 1.5 1 0 6960 57 1.5 1 0 5761 89 1.5 1 0 8962 77 1.5 1 0 7763 113 1.5 1 0 11364 96 1.5 1 0 9665 78 1.5 1 0 7866 38 1.5 1 0 3867 51 1.5 1 0 5168 103 1.5 1 0 10369 120 1.5 1 0 12070 123 1.5 1 0 12371 89 1.5 1 1 8872 86 1.5 1 0 8673 114 1.5 1 0 11474 99 1.5 1 0 9975 87 1.5 1 0 8776 110 1.5 1 0 11077 51 1.5 1 0 5178 48 1.5 1 0 4879 47 1.5 1 0 4780 58 1.5 1 0 5881 74 1.5 1 0 7482 52 1.5 1 1 5183 57 1.5 1 0 5784 68 1.5 1 0 6885 46 1.5 1 0 4686 43 1.5 1 0 4387 67 1.5 1 0 6788 51 1.5 1 0 5189 59 1.5 1 0 5990 57 1.5 1 0 5791 53 1.5 1 0 5392 105 1.5 1 0 10593 73 1.5 1 0 7394 54 1.5 1 0 5495 55 1.5 1 0 5596 63 1.5 1 0 6397 50 1.5 1 0 5098 49 1.5 1 0 4999 46 1.5 1 0 46100 40 1.5 1 0 40101 41 1.5 1 0 41102 50 1.5 1 0 50103 112 1.5 1 0 112104 56 1.5 1 0 56105 110 1.5 1 0 110106 71 1.5 1 0 71107 121 1.5 1 0 121108 55 1.5 1 0 55109 76 1.5 1 0 76110 39 1.5 1 0 39111 45 1.5 1 0 45112 26 1.5 1 0 26113 37 1.5 1 0 37114 50 1.5 1 0 50115 36 1.5 1 0 36116 24 1.5 1 0 24117 27 1.5 1 0 27118 38 1.5 1 0 38119 31 1.5 1 0 31120 30 1.5 1 0 30121 26 1.5 1 0 26122 24 1.5 1 0 24123 33 1.5 1 0 33124 29 1.5 1 0 29125 31 1.5 1 0 31126 30 1.5 1 0 30127 27 1.5 1 0 27128 28 1.5 1 0 28129 29 1.5 1 0 29130 28 1.5 1 0 28131 26 1.5 1 0 26132 39 1.5 1 0 39133 29 1.5 1 0 29134 15 1.5 1 0 15135 31 1.5 1 0 31136 28 1.5 1 0 28137 22 1.5 1 0 22138 25 1.5 1 0 25139 27 1.5 1 0 27140 29 1.5 1 0 29141 25 1.5 1 0 25142 17 1.5 1 0 17143 18 1.5 1 0 18144 18 1.5 1 0 18145 17 1.5 1 0 17146 15 1.5 1 0 15147 12 1.5 1 0 12148 12 1.5 1 0 12149 6 1.5 1 0 6150 12 1.5 1 0 12151 14 1.5 1 0 14152 19 1.5 1 0 19153 8 1.5 1 0 8154 10 1.5 1 0 10155 22 1.5 1 0 22156 14 1.5 1 0 14157 21 1.5 1 0 21158 22 1.5 1 0 22159 12 1.5 1 0 12160 7 1.5 1 0 7161 8 1.5 1 0 8162 6 1.5 1 0 6163 11 1.5 1 0 11164 9 1.5 1 0 9165 11 1.5 1 0 11166 9 1.5 1 0 9167 5 1.5 1 0 5168 8 1.5 1 0 8169 5 1.5 1 0 5170 5 1.5 1 0 5171 7 1.5 1 0 7172 6 1.5 1 0 6173 8 1.5 1 0 8174 8 1.5 1 0 8175 5 1.5 1 0 5176 6 1.5 1 0 6177 5 1.5 1 0 5178 7 1.5 1 0 7179 4 1.5 1 0 4180 2 1.5 1 0 2181 2 1.5 1 0 2182 4 1.5 1 0 4183 3 1.5 1 0 3184 4 1.5 1 0 4185 3 1.5 1 0 3186 7 1.5 1 0 7187 5 1.5 1 0 5188 6 1.5 1 0 6189 2 1.5 1 0 2190 6 1.5 1 0 6191 3 1.5 1 0 3192 5 1.5 1 0 5193 2 1.5 1 0 2194 4 1.5 1 0 4195 2 1.5 1 0 2197 2 1.5 1 0 2198 3 1.5 1 0 3199 2 1.5 1 0 2200 4 1.5 1 0 4201 4 1.5 1 0 4202 5 1.5 1 1 4203 3 1.5 1 0 3204 4 1.5 1 0 4205 1 1.5 1 0 1207 2 1.5 1 0 2208 4 1.5 1 0 4210 3 1.5 1 0 3211 1 1.5 1 0 1212 1 1.5 1 0 1213 1 1.5 1 0 1214 2 1.5 1 0 2215 2 1.5 1 0 2216 1 1.5 1 0 1217 2 1.5 1 0 2218 1 1.5 1 0 1220 2 1.5 1 0 2221 1 1.5 1 0 1222 2 1.5 1 0 2224 1 1.5 1 0 1229 1 1.5 1 0 1230 1 1.5 1 0 1231 3 1.5 1 0 3233 1 1.5 1 0 1234 1 1.5 1 0 1236 1 1.5 1 0 1238 1 1.5 1 0 1239 3 1.5 1 0 3240 1 1.5 1 0 1243 1 1.5 1 0 1249 1 1.5 1 0 1254 1 1.5 1 0 1257 1 1.5 1 0 1268 1 1.5 1 0 1
RUN STATISTICS FOR INPUT FILE: SRR6283792.fastq.gz=============================================99943320 sequences processed in totalSequences removed because they became shorter than the length cutoff of 20 bp: 1560266 (1.6%)
>>> Now running FastQC on the data <<<
application/gzipStarted analysis of SRR6283792_trimmed.fq.gzApprox 5% complete for SRR6283792_trimmed.fq.gzApprox 10% complete for SRR6283792_trimmed.fq.gzApprox 15% complete for SRR6283792_trimmed.fq.gzApprox 20% complete for SRR6283792_trimmed.fq.gzApprox 25% complete for SRR6283792_trimmed.fq.gzApprox 30% complete for SRR6283792_trimmed.fq.gzApprox 35% complete for SRR6283792_trimmed.fq.gzApprox 40% complete for SRR6283792_trimmed.fq.gzApprox 45% complete for SRR6283792_trimmed.fq.gzApprox 50% complete for SRR6283792_trimmed.fq.gzApprox 55% complete for SRR6283792_trimmed.fq.gzApprox 60% complete for SRR6283792_trimmed.fq.gzApprox 65% complete for SRR6283792_trimmed.fq.gzApprox 70% complete for SRR6283792_trimmed.fq.gzApprox 75% complete for SRR6283792_trimmed.fq.gzApprox 80% complete for SRR6283792_trimmed.fq.gzApprox 85% complete for SRR6283792_trimmed.fq.gzApprox 90% complete for SRR6283792_trimmed.fq.gzApprox 95% complete for SRR6283792_trimmed.fq.gzAnalysis complete for SRR6283792_trimmed.fq.gz
3.序列比对

Hisat2是一款短序列比对的工具,主要用于转录组数据的比对,是Hisat工具的升级版。Hisat2优化了索引建立的策略,采用了新的比对策略,使其与Bowtie/TopHat2等软件相比具有更高的敏感性和更快的运算速度。Hisat2支持剪切位点的识别和转录本的重构:利用已知或发现的剪切位点信息进行剪切比对,提高比对率和准确性;结合StringTie等软件进行转录本的重构和定量,提供更全面和精确的转录组信息。

## 数据⽐对到参考基因组conda install -c bioconda hisat2
## 载基因组文件wget -c https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/001/405/GCF_000001405.40_GRCh38.p14/GCF_000001405.40_GRCh38.p14_genomic.fna.gz##下载基因组注释文件wget -c https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/001/405/GCF_000001405.40_GRCh38.p14/GCF_000001405.40_GRCh38.p14_genomic.gff.gz

##解压gunzip GCF_000001405.40_GRCh38.p14_genomic.fna.gzgunzip GCF_000001405.40_GRCh38.p14_genomic.gff.gz
## 建立索引$ mkdir -p reference/index$ cd reference/index$ wget ftp://ftp.ccb.jhu.edu/pub/infphilo/hisat2/data/hg38.tar.gz$ wget ftp://ftp.ccb.jhu.edu/pub/infphilo/hisat2/data/mm10.tar.gz# 解压得到两个目录,hg38和mm10$ tar -zxvf *.tar.gz# 删除压缩包$ rm -rf *.tar.gz

参考资料:

  1. https://www.codenong.com/cs105958520/#google_vignette
  2. https://www.jianshu.com/p/479c7b576e6f

芒果师兄聊生信
1.生信技能和基因编辑。2.论文发表和基金写作。3. 健康管理和医学科研资讯。4.幸福之路,读书,音乐和娱乐。
 最新文章