Welcome to the Genome Toolbox! I am glad you navigated to the blog and hope you find the contents useful and insightful for your genomic needs. If you find any of the entries particularly helpful, be sure to click the +1 button on the bottom of the post and share with your colleagues. Your input is encouraged, so if you have comments or are aware of more efficient tools not included in a post, I would love to hear from you. Enjoy your time browsing through the Toolbox.

Tuesday, November 19, 2013

Color Features in UCSC Genome Browser Custom Track with RGB BED File Field

Custom tracks are incredibly useful in visualizing your data in the UCSC genome browser.  All that is needed is for your data to be in a compatible format.  I typically use .bed files.  The first three columns of .bed files are required fields for chromosome, start, and stop position:

(1) chrom - name of the chromosome or scaffold.  Chromosome names can be given with or without the 'chr' prefix.
(2) chromStart - Start position of the feature in standard chromosomal coordinates (i.e. first base is 0).
(3) chromEnd - End position of the feature in standard chromosomal coordinates

The next six fields are optional. Note that columns cannot be empty (ie: lower-numbered fields must always be populated if higher-numbered ones are used).

(4) name - Label to be displayed under the feature.
(5) score - A score between 0 and 1000.
(6) strand - defined as + (forward), - (reverse), or . (not applicable).
(7) thickStart - field used by UCSC drawing code, typically same as chromStart.
(8) thickEnd - field used by UCSC drawing code, typically same as chromEnd.
(9) itemRgb - an RGB color value (e.g. 0,0,255).

Coloring elements is fairly straightforward.  First define RGB values for each track feature in the itemRgb field (9th column) and ensure fields 1-8 have appropriate values.  Then, upload your track as a custom track (see above link) to UCSC.  Once uploaded, click on the track name (usually "User Track") and edit the configuration to include: itemRgb="On".  Other configuration values can be changed as well:

name - unique name to identify this track in the custom tracks list.
description - label to be displayed above the track in Genome Browser.
priority - integer defining the order in which to display tracks, if multiple tracks are defined.
useScore - a value from 1 to 4, which determines how scored data will be displayed. Additional parameters may be needed.
itemRgb - if set to 'on' (case-insensitive), the individual RGB values defined in tracks will be used.

Here's an example configuration:

No comments:

Post a Comment