StringTie用法詳解

emanlee發表於2019-01-15

StringTie

參考連結:

https://ccb.jhu.edu/software/stringtie/index.shtml?t=manual#input

https://www.cnblogs.com/adawong/articles/7977314.html

 

引數簡介

StringTie的基本用法stringtie <aligned_reads.bam> [options]*

其中,aligned_reads.bam 是輸入檔案,該輸入檔案要求必須按其基因組位置排序, HISAT2的輸出檔案則需經過samtools sort生成的bam檔案才可當做輸入檔案。

其他可選引數:

-h/--help   幫助資訊

-v  開啟詳細模式,列印程式處理的詳細資訊。

-o [<path/>]<out.gtf> 設定StringTie組裝轉錄本的輸出GTF檔案的路徑和檔名。此處可指定完整路徑,在這種情況下,將根據需要建立目錄。預設情況下,StringTie將GTF寫入標準輸出。

-p <int>    指定組裝轉錄本的執行緒數(CPU)。預設值是1

-G <ref_ann.gff>    使用參考註釋基因檔案指導組裝過程,格式GTF/GFF3。輸出檔案中既包含已知表達的轉錄本,也包含新的轉錄本。選項-B,-b,-e,-C需要此選項(詳情如下)

--rf    鏈特異性建庫方式:fr-firststrand(最常用的是dUTP測序方式,其他有NSR,NNSR).

--fr    鏈特異性建庫方式:fr-secondstrand(如 Ligation,Standard SOLiD).

-l <label>  將<label>設定為輸出轉錄本名稱的字首。預設:STRG

-f <0.0-1.0>    將預測轉錄本的最低isoform的丰度設定為在給定基因座處組裝的丰度最高的轉錄本的一部分。較低丰度的轉錄物通常是經加工的轉錄本的不完全剪接前體的artifacts。預設值為0.1。

-m <int>    設定預測的轉錄本所允許的最小長度.預設值為200

-A <gene_abund.tab> 輸出基因丰度的檔案(製表符分隔格式)

-C <cov_refs.gtf>   輸出所有轉錄本對應的reads覆蓋度的檔案,此處的轉錄本是指參考註釋基因檔案中提供的轉錄本。(需要引數 -G).

-a <int>    Junctions that don't have spliced reads that align across them with at least this amount of bases on both sides are filtered out. Default: 10

-j <float>  連線點的覆蓋度,即設定至少有這麼多的spliced reads 比對到連線點(align across a junction)。 這個數字可以是分數, 因為有些reads可以比對到多個地方。 當一個read 比對到 n 個地方是,則此處連線點的覆蓋度為1/n 。預設值為1。

-t  該引數禁止修剪組裝的轉錄本的末端。預設情況下,StringTie會根據組裝的轉錄本的覆蓋率的突然下降來調整預測的轉錄本的開始和/或停止座標。

-c <float>  設定預測轉錄本所允許的最小read 覆蓋度。 當一個轉錄本的覆蓋度低於閾值,則輸出檔案中不含該轉錄本。預設值為 2.5

-g <int>    設定ga最小值。 Reads that are mapped closer than this distance are merged together in the same processing bundle. Default: 50 (bp)

-B  應用該選項,則會輸出Ballgown輸入表檔案(* .ctab),其中包含用-G選項給出的參考轉錄本的覆蓋率資料。(有關這些檔案的說明,請參閱Ballgown文件。)
    如果選項-o 給出輸出轉錄檔案的完整路徑,則* .ctab檔案與輸出GTF檔案在相同的目錄下。
    
-b <path>   指定 *.ctab 檔案的輸出路徑, 而非由-o選項指定的目錄。
    注意: 建議在使用-B/-b選項中同時使用-e選項,除非StringTie GTF輸出檔案中仍需要新的轉錄本。
    
-e  限制reads比對的處理,僅估計和輸出與用-G選項給出的參考轉錄本匹配的組裝轉錄本。使用該選項,則會跳過處理與參考轉錄本不匹配的組裝轉錄本,這將大大的提升了處理速度。

-M <0.0-1.0>    設定。預設值為0.95.
-x <seqid_list> 忽略所有比對到指定的參考序列上的reads,因此這部分的reads不需要組裝轉錄本。 引數 <seqid_list>可以是單個參考序列名稱 (如: -x chrM),也可以是逗號分隔的序列名稱列表 (如: -x 'chrM,chrX,chrY')。這可以加快StringTie的組裝分析的速度,特別是在排除線粒體基因組的情況下,在某些情況下,線粒體的基因可能具有非常高的覆蓋率,但是它們對於特定的RNA-Seq分析可能不感興趣的。

--merge 轉錄本合併模式。 在合併模式下,StringTie將所有樣品的GTF/GFF檔案列表作為輸入,並將這些轉錄本合併/組裝成非冗餘的轉錄本集合。這種模式被用於新的差異分析流程中,用以生成一個跨多個RNA-Seq樣品的全域性的、統一的轉錄本。
    如果提供了-G選項(參考註釋基因組檔案),則StringTie將從輸入的GTF檔案中將參考轉錄本組裝到transfrags中。(個人理解:transfrags可能指的是拼接成更大的轉錄本片段,tanscript fragments)

在此模式下可以使用以下附加選項:
-G <guide_gff>  參考註釋基因組檔案(GTF/GFF3)
-o <out_gtf>    指定輸出合併的GTF檔案的路徑和名稱 (預設值:標準輸出)
-m <min_len>    合併檔案中,指定允許最小輸入轉錄本的長度 (預設值: 50)
-c <min_cov>    合併檔案中,指定允許最低輸入轉錄本的覆蓋度(預設值: 0)
-F <min_fpkm>   合併檔案中,指定允許最低輸入轉錄本的FPKM值 (預設值: 0)
-T <min_tpm>    合併檔案中,指定允許最低輸入轉錄本的TPM值  (預設值: 0)
-f <min_iso>    minimum isoform fraction (預設值: 0.01)
-i  合併後,保留含retained introns的轉錄本 (預設值: 除非有強有力的證據,否則不予保留)
-l <label>  輸出轉錄本的名稱字首 (預設值: MSTRG)

輸入檔案

其中,aligned_reads.bam 是輸入檔案,該輸入檔案要求必須按其基因組位置排序,如TopHat的輸出檔案accepted_hits.bam可直接當做輸入檔案,而 HISAT2的輸出檔案則需經過samtools sort生成的bam檔案才可當做輸入檔案。

輸入BAM檔案中的每個 spliced read 比對(即跨越至少一個連線點的比對)必須包含標籤XS,用以指示測序產生的read是來源於基因組序列上的哪條鏈產生的RNA。由TopHat和 HISAT2 (需引數 --dta,該引數用於發現剪接位點) 產生的比對結果中已經包含標籤XS。但是,有的mapping程式(read mapper)未必含有標籤XS,所以,使用者在進行下一步分析時需要進行檢查。

注意:一定要使用-dta選項來執行HISAT2,否則結果將會受到影響。

作為選項,可以向StringTie提供GTF / GFF3格式的參考註釋基因組檔案。在這種情況下,StringTie更喜歡使用註釋檔案中的這些“已知”基因,對於那些被表達的基因,它將計算coverage,TPM和FPKM值。它還會產生額外的轉錄本,而註釋檔案中並沒有這些轉錄本。請注意,如果不使用選項-e,那麼參考轉錄本就需要被reads 完全覆蓋,以便包含在StringTie的輸出中。在這種情況下,其他通過StringTie從資料中組裝的轉錄本,且不在註釋檔案中的轉錄本也會輸出。

注意:如果使用者正在分析註釋較好的基因組,例如人類,小鼠或其他模型生物,則強烈建議您提供註釋檔案。

輸出檔案

主要輸出檔案有:

1、 GTF檔案: 記錄組裝的轉錄本資訊

2、 Tab檔案: 記錄基因丰度資訊

3、 GTF檔案:完全覆蓋與參考註釋基因組檔案所匹配的轉錄本資訊

4、 *.ctab檔案:用於下游Ballgown軟體做差異表達分析的輸入檔案

5、 GTF檔案:在合併模式下,生成一個合併的GTF檔案

GTF檔案:記錄組裝的轉錄本資訊

  • seqname: 染色體,contig, 或 scaffold

  • source: GTF檔案的原始檔。

  • feature: 特徵型別;如:exon, transcript, mRNA, 5'UTR。

  • start: 開始位置,使用基於1的索引

  • end: 結束位置,使用基於1的索引

  • score: 組裝的轉錄本的可信度分數。目前這個欄位沒有被使用,並且如果轉錄本 與a read alignment bundle

    有連線,則StringTie輸出常數值1000。

  • strand: 正向鏈: '+'; 反向鏈: '-'.

  • frame: CDS特徵的 Frame or phase 。 StringTie不使用該欄位,只記錄一個“.”。

  • attributes:

    • gene_id: A unique identifier for a single gene and its child transcript and exons based on the alignments' file name.
    • transcript_id: A unique identifier for a single transcript and its child exons based on the alignments' file name.
    • exon_number: A unique identifier for a single exon, starting from 1, within a given transcript.
    • reference_id: The transcript_id in the reference annotation (optional) that the instance matched.
    • ref_gene_id: The gene_id in the reference annotation (optional) that the instance matched.
    • ref_gene_name: The gene_name in the reference annotation (optional) that the instance matched.
    • cov: The average per-base coverage for the transcript or exon.
    • FPKM: Fragments per kilobase of transcript per million read pairs. This is the number of pairs of reads aligning to this feature, normalized by the total number of fragments sequenced (in millions) and the length of the transcript (in kilobases).
    • TPM: Transcripts per million. This is the number of transcripts from this particular gene normalized first by gene length, and then by sequencing depth (in millions) in the sample. A detailed explanation and a comparison of TPM and FPKM can be found here, and TPM was defined by B. Li and C. Dewey here.

Tab檔案: 記錄基因丰度資訊

如果StringTie使用-A <gene_abund.tab>選項執行,則返回包含基因丰度的檔案。

  • Column 1 / Gene ID: The gene identifier comes from the reference annotation provided with the -G option. If no reference is provided this field is replaced with the name prefix for output transcripts (-l).
  • Column 2 / Gene Name: This field contains the gene name in the reference annotation provided with the -G option. If no reference is provided this field is populated with '-'.
  • Column 3 / Reference: Name of the reference sequence that was used in the alignment of the reads. Equivalent to the 3rd column in the .SAM alignment.
  • Column 4 / Strand: '+' denotes that the gene is on the forward strand, '-' for the reverse strand.
  • Column 5 / Start: Start position of the gene (1-based index).
  • Column 6 / End: End position of the gene (1-based index).
  • Column 7 / Coverage: Per-base coverage of the gene.
  • Column 8 / FPKM: normalized expression level in FPKM units (see previous section).
  • Column 9 / TPM: normalized expression level in RPM units (see previous section).

GTF檔案:完全覆蓋與參考註釋基因組檔案所匹配的轉錄本資訊

如果StringTie與 -C <cov_refs.gtf> 選項一起執行(需要選項-G

*.ctab檔案:用於下游Ballgown軟體做差異表達分析的輸入檔案

如果StringTie與-B選項一起執行,它將返回Ballgown輸入檔案,包含以下檔案:(1) e2t.ctab, (2) e_data.ctab, (3) i2t.ctab, (4) i_data.ctab, and (5) t_data.ctab。

GTF檔案:在合併模式下,生成一個合併的GTF檔案

如果StringTie使用--merge選項執行,它將多個GTF / GFF檔案作為輸入,並將這些轉錄本合併和組裝成非冗餘轉錄本集合。