Skip to main content

UCSC Track Hubs

Track hubs allow you to share custom genome browser tracks with collaborators or make your data publicly accessible through the UCSC Genome Browser.

What is a Track Hub?

A track hub is a collection of genomic tracks that can be loaded into the UCSC Genome Browser. It consists of configuration files and data files hosted on a publicbly accessible web server.

Track Hub Structure

A basic track hub requires:

  • hub.txt - Main configuration file
  • genomes.txt - Lists the genome assemblies
  • trackDb.txt - Describes individual tracks
  • Track data files (bigWig, bigBed, BAM, etc.)

These files must be organized in a specific directory structure which is publicbly accessible on the web server, ie our datashare folder:

/project/higsslab/datashare/username

The directory structure for a track hub might look like this:

/project/higsslab/datashare/username/my_hub/
├──hub.txt
├──genomes.txt
├──mm39/
    ├──trackDb.txt
    ├──ATAC/
        ├──ATAC_sample1.bw
        ├──ATAC_sample2.bw

hub.txt

hub Project XYZ
shortLabel Data for Project XYZ
longLabel Data for Project XYZ in a type of cells and conditions
genomesFile genomes.txt
email myemail@example.com

genomes.txt

genome mm39
trackDb mm39/trackDb.txt

trackDb.txt

If possitioned in the mm39/ folder, the trackDb.txt file would contain entries for each track, such as:

track ATAC_sample1
type bigWig
bigDataUrl ATAC/ATAC_sample1.bw
shortLabel ATAC-seq
longLabel ATAC_sample1
color 200,100,0
visibility full
autoScale on

Composite Tracks

There is also the option to build composite tracks, which group multiple related tracks together. For example:

track ATAC_composite
shortLabel ATAC_composite
longLabel Data from erythroid cells from Project XYZ
type bigWig
visibility full
compositeTrack on

    track ATAC_sample1
    bigDataUrl ATAC/ATAC_sample1.bw
    shortLabel ATAC_sample1
    longLabel ATAC_sample1
    type bigWig
    visibility full
    color 0,0,0
    autoScale on
    maxHeightPixels 120:100:20
    windowingFunction mean
    parent ATAC_composite on

    track ATAC_sample2
    bigDataUrl ATAC/ATAC_sample2.bw
    shortLabel ATAC_sample2
    longLabel ATAC_sample2
    type bigWig
    visibility full
    color 0,0,0
    autoScale on
    maxHeightPixels 120:100:20
    windowingFunction mean
    parent ATAC_composite on

The UCSC Genome Browser supports a wide range of track types, each with its own set of configuration options. However they must be in a format that is compatible with the UCSC Genome Browser, such as bigWig, bigBeds. These formats are optimized for efficient data retrieval and visualization in the browser. You can use tools like bamCoverage and bedToBigBed to convert your data into the appropriate format.

A bed file of enhancer regions was converted to a bigBed file using bedToBigBed and added to the track hub as follows:

/project/higsslab/datashare/username/my_hub/
├──hub.txt
├──genomes.txt
├──mm39/
    ├──trackDb.txt
    ├──Mouse_alpha_enhancers.bigbed
    ├──ATAC/
        ├──ATAC_sample1.bw
        ├──ATAC_sample2.bw

In the trackDb.txt file, the entry for the composite track including the bigBed file would look like this:

track ATAC_composite
shortLabel ATAC_composite
longLabel Data from erythroid cells from Project XYZ
type bigWig
visibility full
compositeTrack on

    track Mouse_alpha_enhancers
    bigDataUrl Mouse_alpha_enhancers.bigbed
    shortLabel Mouse_alpha_enhancers
    longLabel Mouse_alpha_enhancers
    type bigBed
    visibility pack
    color 0,0,0
    parent ATAC_composite on

    track ATAC_sample1
    bigDataUrl ATAC/ATAC_sample1.bw
    shortLabel ATAC_sample1
    longLabel ATAC_sample1
    type bigWig
    visibility full
    color 0,0,0
    autoScale on
    maxHeightPixels 120:100:20
    windowingFunction mean
    parent ATAC_composite on

There is also an option to create overlay tracks, which allow you to overlay multiple tracks on top of each other for easier comparison. See Multiwig tracks for more information.

See this location in our datashare for a template that can be copied and modified for your own track hub:

/project/higgslab/datashare/publications/Template_hub

Other examples are also availible within this folder.

Loading a Track Hub

TipURL to hub.txt

If a the hub.txt is stored in /project/higsslab/datashare/username/my_hub/ the URL will be:

https://datashare.molbiol.ox.ac.uk/public/project/higgslab/username/my_hub/hub.txt

Be aware of case sensitivity in the URL and ensure that the path is correct. You can then load the track hub into the UCSC Genome Browser by following these steps:

  1. Go to the UCSC Genome Browser
  2. Navigate to “My Data” > “Track Hubs”
  3. Go to “Connected Hubs”
  4. Enter the URL to your hub.txt file
  5. Click “Add Hub”
  6. You can then navigate to the data by clicking the genome assembley link

If there are no errors in your configuration files, the tracks should now be available for visualization in the browser. It may take a few moments for the tracks to load or update, especially if you have large data files.

Resources