前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >RNA-seq(3):sra到fastq格式转换并进行质量控制

RNA-seq(3):sra到fastq格式转换并进行质量控制

作者头像
Y大宽
发布2018-09-10 11:41:47
1.7K0
发布2018-09-10 11:41:47
举报
文章被收录于专栏:Y大宽Y大宽

把RNA-seq(2)-2下载的sra文件转换为fastq格式的测序文件,并且用fastqc软件测试测序文件的质量,理解各指标的意义。

1 数据解压:用samtools中的fastq-dump将sra格式转为fastq格式

代码语言:javascript
复制
#先启动python3环境
kelly@DESKTOP-MRA1M1F:/mnt/f/rna_seq/data$ source ~/miniconda3/bin/activate
#查看fastqc命令是否有效(注意现在是base环境)
(base) kelly@DESKTOP-MRA1M1F:/mnt/f/rna_seq/data$ fastq-dump -h
#命令1
fastq-dump --gzip --split-3 -O *.sra .
#或者命令2
for id in `seq 56 62`
do
    fastq-dump --gzip --split-3 -O  -A SRR35899${id} .
done
#或者命令3
for ((i=56;i<=62;i++));do fastq-dump --gzip --split-3 -A SRR35899$i.sra -O .;done
注意

A FASTQ file normally uses four lines per sequence.

  • Line 1 begins with a '@' character and is followed by a sequence >identifier and an optional description (like a FASTA title line).
  • Line 2 is the raw sequence letters.
  • Line 3 begins with a '+' character and is optionally followed by the same sequence identifier (and any description) again.
  • Line 4 encodes the quality values for the sequence in Line 2, and must contain the same number of symbols as letters in the sequence. A FASTQ file containing a single sequence might look like this:
代码语言:javascript
复制
@SEQ_ID
GATTTGGGGTTCAAAGCAGTATCGATCAAATAGTAAATCCATTTGTTCAACTCACAGTTT
+
!''*((((***+))%%%++)(%%%%).1***-+*''))**55CCF>>>>>>CCCCCCC65

The character '!' represents the lowest quality while '~' is the highest. Here are the quality value characters in left-to-right increasing order of quality (ASCII):

代码语言:javascript
复制
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG
HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

The original Sanger FASTQ files also allowed the sequence and quality strings to be wrapped (split over multiple lines), but this is generally discouraged as it can make parsing complicated due to the unfortunate choice of "@" and "+" as markers (these characters can also occur in the quality string).

2 用fastqc进行质量控制

FastQCaims to provide a simple way to do some quality control checks on raw sequence data coming from high throughput sequencing pipelines. It provides a modular set of analyses which you can use to give a quick impression of whether your data has any problems of which you should be aware before doing any further analysis. The main functions of FastQC are

  • Import of data from BAM, SAM or FastQ files (any variant)
  • Providing a quick overview to tell you in which areas there may be problems
  • Summary graphs and tables to quickly assess your data
  • Export of results to an HTML based permanent report
  • Offline operation to allow automated generation of reports without running the interactive application

用法: fastqc [-o output dir] [--(no)extract] [-f fastq|bam|sam] [-c contaminant file] seqfile1 .. seqfileN 参数: -o 输出目录,需自己创建目录 --(no)extract 是否解压输出文件,默认是自动解压缩zip文件。加上--noextract不解压文件。 -f 指定输入文件的类型,支持fastq|bam|sam三种格式的文件,默认自动识别。 -t 同时处理的文件数目。 -c 是contaminant 文件,会从中搜索overpresent 序列。

代码语言:javascript
复制
#将所有的数据进行质控,得到zip的压缩文件和html文件
fastqc -o .  *.fastq.gz

注意:-o后面有空格,表示输出到当前文件夹,之后的.后也有空格

3 质控结果解读

  • fastqc结果详细解读(包括代表意义,出错代表的意义等,极其详细)稍后会写一篇专门解读的文章

https://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/3%20Analysis%20Modules/

在本作业中,每个 fastq 文件都能生成一个 html 报告文件,很详细。结果可知,测序质量非常好。

QQ图片20180730145517.png

4 质控结果批量查看工具:multiQC

如果不嫌麻烦,可以一个个查看质控结果,毕竟前期数据下载处理等就花那么多时间,在进行质控的同时查看结果完全可以满足。但如果文件很多,可以进行合并查看,具体见 青山屋主:https://zhuanlan.zhihu.com/p/27646873 Hoptop:https://www.jianshu.com/p/303de2c95239 lxmic:https://www.jianshu.com/p/14fd4de54402

备注:稍后我会更新这部分内容
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018.07.30 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1 数据解压:用samtools中的fastq-dump将sra格式转为fastq格式
  • 2 用fastqc进行质量控制
  • 3 质控结果解读
  • 4 质控结果批量查看工具:multiQC
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档