BED file support

From ZENBU documentation wiki
Revision as of 17:34, 11 April 2012 by Jessica Severin (talk | contribs) (moved BED to BED file support)
Jump to: navigation, search

BED file support

BED files are a common interchange format for genomic annotations. BED lines have three required fields and nine additional optional fields. The number of fields per line must be consistent throughout any single set of data in an annotation track. The order of the optional fields is binding: lower-numbered fields must always be populated if higher-numbered fields are used.

If your data set is BED-like, but it is very large and you would like to keep it on your own server, you should use the bigBed data format.

The first three required BED fields are:

chrom - The name of the chromosome (e.g. chr3, chrY, chr2_random) or scaffold (e.g. scaffold10671). chromStart - The starting position of the feature in the chromosome or scaffold. The first base in a chromosome is numbered 0. chromEnd - The ending position of the feature in the chromosome or scaffold. The chromEnd base is not included in the display of the feature. For example, the first 100 bases of a chromosome are defined as chromStart=0, chromEnd=100, and span the bases numbered 0-99. The 9 additional optional BED fields are:

name - Defines the name of the BED line. This label is displayed to the left of the BED line in the Genome Browser window when the track is open to full display mode or directly to the left of the item in pack mode. score - A score between 0 and 1000. If the track line useScore attribute is set to 1 for this annotation data set, the score value will determine the level of gray in which this feature is displayed (higher numbers = darker gray). This table shows the Genome Browser's translation of BED score values into shades of gray: shade score in range ≤ 166 167-277 278-388 389-499 500-611 612-722 723-833 834-944 ≥ 945 strand - Defines the strand - either '+' or '-'. thickStart - The starting position at which the feature is drawn thickly (for example, the start codon in gene displays). thickEnd - The ending position at which the feature is drawn thickly (for example, the stop codon in gene displays). itemRgb - An RGB value of the form R,G,B (e.g. 255,0,0). If the track line itemRgb attribute is set to "On", this RBG value will determine the display color of the data contained in this BED line. NOTE: It is recommended that a simple color scheme (eight colors or less) be used with this attribute to avoid overwhelming the color resources of the Genome Browser and your Internet browser. blockCount - The number of blocks (exons) in the BED line. blockSizes - A comma-separated list of the block sizes. The number of items in this list should correspond to blockCount. blockStarts - A comma-separated list of block starts. All of the blockStart positions should be calculated relative to chromStart. The number of items in this list should correspond to blockCount.

ZENBU interpretation of BED files

The BED file format easily maps into the ZENBU data model. Genomic coordinate columns (chrom, chromStart, chromEnd, strand) are directly interpreted, but it should be noted that BED files are in a zero-exclusive coordinate space, while ZENBU uses a 1based-inclusive coordinate space. ZENBU automatically handles the conversion between coordinate spaces.

  • name is stored in the ZENBU Feature name
  • score is stored in the Feature significance. On upload there is an option to copy the score into an Expression value of a specified Datatype.
  • the three columns blockCount, blockSizes, blockStarts work together and are interpreted into subfeatures on the primary Feature. Each of these subfeatures are created with a FeatureSource category of block.


BED specification

The official BED specification is available here http://genome.ucsc.edu/FAQ/FAQformat.html#format1