1. 程式人生 > >HISAT2,StringTie,Ballgown處理轉錄組資料

HISAT2,StringTie,Ballgown處理轉錄組資料

HISAT2,StringTie,Ballgown處理轉錄組資料 

本文總閱讀量

HISAT2,StringTie,Ballgown處理轉錄組資料思路如下:

  1. 資料質控
  2. 將RNA-seq的測序reads使用hisat2比對
  3. samtools將sam檔案轉成bam,並且排序,為下游分析做準備
  4. stringtie對每個樣本進行轉錄本組裝
  5. stringtie 將所有樣本的轉錄本進行合併 注意:此處的mergelist.txt是自己建立的
  6. 計算表達量並且為Ballgown包提供輸入檔案
  7. Ballgown的安裝 分析,需提供一個分組資訊;

0.資料質控(QC):
Ubuntu軟體包內自帶Fastqc,故安裝命令apt-get install fastqc
fastqc命令:
fastqc -o . -t 5 SRR3101238_1.fastq.gz &
-o . 將結果輸出到當前目錄
-t 5 表示開5個執行緒執行
(四個樣本,雙端測序,要分別對八個fastq檔案執行八次)

1.將RNA-seq的測序reads使用hisat2比對
準備軟體:
安裝HISAT2
下載地址:
http://ccb.jhu.edu/software/hisat2/downloads/
wget http://ccb.jhu.edu/software/hisat2/downloads/hisat2-2.0.0-beta-Linux_x86_64.zip

 -P ./
解 壓 縮:
unzip hisat2-2.0.0-beta-Linux_x86_64.zip

準備檔案:

  1. 參考基因組序列;genome (chr.fa)
  2. 參考基因組的註釋檔案;genes (chr.gtf)
  3. Hisat2索引檔案;indexes (chr_tran.1.ht2)
  4. 測序資料;samples (chr_1.fastq.gz, chr_2,fastq.gz;樣本表型資訊 與 樣本列表)

下載人類參考基因組和註釋檔案:
1.1 人類參考基因組:Hisat2官網上有Ensemble GRCh38的基因組索引, 連結:http://ccb.jhu.edu/software/hisat2/index.shtml


1.2 註釋檔案:下載自ensemble資料庫ftp://ftp.ensembl.org/pub/release-86/gtf/homo_sapiens
1.3 索引檔案的建立:從gtf檔案中構建索引,命定如下:
extract_exons.py hg19.annotation.gtf > exons.txt
extract_splice_sites.py hg19.annotation.gtf > splicesites.txt

建立索引另外一種方法:
hisat2-build [options]*<reference_in><ht2_base>

<reference_in>:用於指定參考基因組;

<ht2_base>:用於指定生成的索引檔案的基名;

./hisat2-2.0.0-beta/hisat2-build -f ucsc.hg19.fasta –ss splicesites.txt –exon exons.txt -p 7 ./ucsc.hg19

#新增–ss和–exon選項後,需要很大的記憶體,build 人基因組的話需要200G RAM,如果沒有這麼大記憶體,不要新增這兩個選項,但要在後續執行hisat時新增 –known-splicesite-infile選項(見下文)
如hisat2-build -f ucsc.hg19.fasta -p 7 ./uscs.hg19 ##大概需要一小時二十分鐘

(1). 比對,生成bam檔案:“將RNA-seq的測序reads使用hisat2比對對參考基因租組”
hisat2 -q -x ./ucsc.hg19 -1 reads_1.fastq -2 reads_2.fastq -S alns.sam -t

hisat2 -q -x ./ucsc.hg19 -1 reads_1.fastq -2 reads_2.fastq -S alns.sam –known-splicesite-infile splicesites.txt -t

-x :用於指定參考基因組所對應的索引檔案;

-1, -2: 用於指定測序 Reads 所在的檔案;

-S:用於指定儲存比對結果的檔名;

-p: 用於指定執行緒數;

(2) Sort and convert the SAM files to BAM

samtools sort [email protected] 8 -o ERR188044_chrX.bam ERR188044_chrX.sam

[email protected]:用於指定執行緒數;

-o:用於指定儲存轉化結果的檔名;

注:*.bam 格式的檔案為二進位制檔案;

在-b 指定的資料夾下生成特定的檔案
e2t.ctab
e_data.ctab
i2t.ctab
i_data.ctab
t_data.ctab
e即外顯子、i即內含子、t轉錄本;
e2t即外顯子和轉錄本間的關係,
i2t即內含子和轉錄本間的關係,
t_data即轉錄本的資料

(3) assemble and quantify expressed genes and transcripts

stringtie -p 8 -G chrX_data/genes/chrX.gtf -o ERR188044_chrX.gtf -l ERR188044 ERR188044_chrX.bam

-G :用於指導組裝過程的參考註釋的檔案;

-o:用於指定儲存組裝結果的檔名;

-l: 為轉錄本的ID指定字首;

-p: 用於指定執行緒數;

(4) Merge transcripts from all samples:

stringtie –merge -p 40 -G chrX_data/genes/chrX.gtf -o stringtie_merged.gtf chrX_data/mergelist.txt

-G :用於指導組裝過程的參考註釋檔案;

-o:用於指定儲存組裝結果的檔名;

-p: 用於指定執行緒數;

注: mergelist.txt 檔案包含所有*.gtf 檔名的列表, 並且每個檔名佔據一行。

(5) Examine how the transcripts compare with the reference annotation (optional)

./bin/gffcompare -r chrX_data/genes/chrX.gtf -G -o merged stringtie_merged.gtf

-r :用於指定參考的註釋檔案;

-o:用於指定儲存結果的檔名的字首;

-G:用於指定是否比較所有轉錄本(即使是冗餘的);

(6) Estimate transcript abundances and create table counts for Ballgown

stringtie -e -B -p 48 -G stringtie_merged.gtf -o ballgown/ERR188044/ERR188044_chrX.gtf ERR188044_chrX.bam

-e:用於指定是否僅為參考轉錄本估計表達丰度;

-B:用於指定是否輸出 Ballgown table 檔案;

-p: 用於指定執行緒數;

-G :用於指定已組裝的註釋檔案;

-o:用於指定輸出結果的檔名;