RNA-seq(3):sra到fastq格式轉換并進行質量控制

把RNA-seq(2)-2下載的sra文件轉換為fastq格式的測序文件,并且用fastqc軟件測試測序文件的質量,理解各指標的意義。

1 數(shù)據解壓:用samtools中的fastq-dump將sra格式轉為fastq格式

#先啟動python3環(huán)境
kelly@DESKTOP-MRA1M1F:/mnt/f/rna_seq/data$ source ~/miniconda3/bin/activate
#查看fastqc命令是否有效(注意現(xiàn)在是base環(huán)境)
(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:
@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):

 !"#$%&'()*+,-./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
參數(shù):
-o 輸出目錄,需自己創(chuàng)建目錄
--(no)extract 是否解壓輸出文件,默認是自動解壓縮zip文件。加上--noextract不解壓文件。
-f 指定輸入文件的類型,支持fastq|bam|sam三種格式的文件,默認自動識別。
-t 同時處理的文件數(shù)目。
-c 是contaminant 文件,會從中搜索overpresent 序列。

#將所有的數(shù)據進行質控,得到zip的壓縮文件和html文件
fastqc -o .  *.fastq.gz

注意:-o后面有空格,表示輸出到當前文件夾,之后的.后也有空格

3 質控結果解讀

  • fastqc結果詳細解讀(包括代表意義,出錯代表的意義等,極其詳細)稍后會寫一篇專門解讀的文章

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

在本作業(yè)中,每個 fastq 文件都能生成一個 html 報告文件,很詳細。結果可知,測序質量非常好。
QQ圖片20180730145517.png

4 質控結果批量查看工具:multiQC

如果不嫌麻煩,可以一個個查看質控結果,畢竟前期數(shù)據下載處理等就花那么多時間,在進行質控的同時查看結果完全可以滿足。但如果文件很多,可以進行合并查看,具體見
青山屋主:https://zhuanlan.zhihu.com/p/27646873
Hoptop:http://www.itdecent.cn/p/303de2c95239
lxmic:http://www.itdecent.cn/p/14fd4de54402

備注:稍后我會更新這部分內容
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,854評論 0 10
  • 親愛的家人: 大家好!童話劇在上個周二華麗落下了帷幕!這其中不僅僅有我和孩子們共同努力的結果,還有你們花...
    于向雨閱讀 445評論 0 0
  • 我不是一個合格的編導生,不僅因為我無法準確地描述編導是一個什么樣的專業(yè),還在于每當別人讓我給他推薦電影時,我往往是...
    趙治清閱讀 224評論 0 0
  • 語言風格:非常接近自然語言,但是代碼效率不高 解析型語言,依賴于解析器,跨平臺性好 面向對象 動態(tài)編程 兼容性:3...
    奉仲閱讀 184評論 1 0

友情鏈接更多精彩內容