One of the features of the latest update to the UCSC Genome Browser (see http://www.ncbi.nlm.nih.gov/pubmed/20959295), are tracks which overlap or overlay each other. If you’re a regular user of the site, you will have noticed the ENCODE ChIP-Seq tracks that have several layers. After doing a bit of searching, I was able to make my own overlapping tracks. Since it’s a new feature, there is yet to be official documentation on it. But several users have emailed the mailing list regarding this and if you join up the bits and pieces, you can piece together the instructions for making your own custom overlap tracks.
Things you require are access to a web server, and knowledge of making bigWig files. See this post on how to make bigWig files from BAM files. If you have those, next you need to set up your own track hub; follow the official instructions on how to do this.
Once you have setup your track hub and debugged it using hubCheck tool, adapt the following attributes shown below to your own trackDb.txt file. See this thread for more information.
For my example, I made two bigWig files and I wish to overlap them together as one track. So in my trackDb.txt file, I have something like this (pay attention to the lines in bold):
type bigWig 0 30000
The key is to make a container track (which I named all_fun), and for every track that you want to overlap, specify the same container name in the parent field (I have put them in bold above).
Next, the UCSC Genome Browser needs to make it possible to properly display bedGraph files when reads are mapping to the exact same position but on opposite strands. UPDATE 22nd March 2012: As suggested by Xianjun (see comments for this post), to solve the issue of displaying +/- reads that map to the same spot, create two bigWig files, one for the plus strand and the other the minus, and just overlay those into one track as shown above. Worked like a charm.
For more information see http://genome.ucsc.edu/goldenPath/help/trackDb/trackDbHub.html.
This work is licensed under a Creative Commons
Attribution 4.0 International License.