生信文件格式-BED文件


BED文件格式


注釋文件就是基因組的說明書。告訴我們哪些序列是編碼蛋白的基因,哪些是非編碼基因,外顯子、內含子、UTR等的位置等等。注釋文件在以下三個提供參考基因組的網站中都有提供,比如Ensemble、NCBI 、UCSC。但是現在最權威的人類和小鼠基因組的注釋還屬Gencode數據庫。

基因組注釋(genomic features)通常使用Browser Extensible Data (BED) 或者 General Feature Format (GFF)文件格式表示,用UCSC Genome Browser進行可視化比較。

Bed文件和GFF文件最基本的信息就是染色體或Contig的ID或編號,然后就是DNA的正負鏈信息,接着就是在染色體上的起始和終止位置數值。

BED文件中起始坐標為0,結束坐標至少是1; GFF中起始坐標是1而結束坐標至少是1。
處理BED格式和GFF格式的工具主要有BedTools和Tophat 。

1. BED文件格式介紹

BED文件每行至少包含chrom,chromStart,chromEnd三列;另外還可以添加額外的9列,這些列的順序是固定的。

必須的3個字段

1) chrom 染色體的名稱(例如,chr1,chrX,chr2_random)或支架(例如scaffold10671)。

2) chromStart 染色體或scaffold中特征的起始位置。染色體中的第一鹼基的編號為0。

3) chromEnd 染色體或scaffold中特征的結束位置。chromEnd鹼基不包括在特征內,如,染色體的前100個鹼基定義為chromSatrt=0, chromEnd=100, 跨越編號為0-99的鹼基。

可選的9個字段

4) name 定義BED行的名稱,這個名稱標簽會展示在基因組瀏覽器中的bed行的左側

5)score 0-1000的分值,如果在注釋數據的設定中將原始基線設置為1,那么這個分值會決定顯示灰度水平(數字越大,灰度越高)

6) strand 定義鏈的方向,"+"或"-"

7) thickStart 起始位置(The starting position at which the feature is drawn thickly)(例如,基因起始編碼位置)

8) thickEnd 終止位置(The ending position at which the feature is drawn thickly)(例如:基因終止編碼位置) 

9) itemRGB 是一個RGB值的形式, R, G, B (eg. 255, 0,0), 如果itemRgb設置為'On”, 這個RBG值將決定數據的顯示顏色

10) blockCount BED行中的block數目,也就是外顯子數目

11) blockSize 用逗號分割的外顯子的大小, 這個item的數目對應於BlockCount的數目

12) blockStarts 用逗號分割的列表, 所有外顯子的起始位置,數目也與blockCount數目對應

## UCSC定義BED格式中的兩個例子
In BED files with block definitions, the first blockStart value must be 0, so that the first block begins at chromStart. 
Similarly, the final blockStart position plus the final blockSize value must equal chromEnd. Blocks may not overlap.

## Example:
Here is an example of an annotation track, introduced by a header line, that is followed by a complete BED definition:

track name=pairedReads description="Clone Paired Reads" useScore=1
chr22 1000 5000 cloneA 960 + 1000 5000 0 2 567,488, 0,3512
chr22 2000 6000 cloneB 900 - 2000 6000 0 2 433,399, 0,3601

## Example:
This example shows an annotation track that uses the itemRgb attribute to individually color each data line. In this track, 
the color scheme distinguishes between items named "Pos*" and those named "Neg*". See the usage note in the itemRgb description 
above for color palette restrictions. NOTE: The track and data lines in this example have been reformatted for documentation 
purposes. This example can be pasted into the browser without editing.

browser position chr7:127471196-127495720
browser hide all
track name="ItemRGBDemo" description="Item RGB demonstration" visibility=2 itemRgb="On"
chr7    127471196  127472363  Pos1  0  +  127471196  127472363  255,0,0
chr7    127472363  127473530  Pos2  0  +  127472363  127473530  255,0,0
chr7    127473530  127474697  Pos3  0  +  127473530  127474697  255,0,0
chr7    127474697  127475864  Pos4  0  +  127474697  127475864  255,0,0
chr7    127475864  127477031  Neg1  0  -  127475864  127477031  0,0,255
chr7    127477031  127478198  Neg2  0  -  127477031  127478198  0,0,255
chr7    127478198  127479365  Neg3  0  -  127478198  127479365  0,0,255
chr7    127479365  127480532  Pos5  0  +  127479365  127480532  255,0,0
chr7    127480532  127481699  Neg4  0  -  127480532  127481699  0,0,255


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM