Recently, I was asked by one of my collegues if there was a way to display stranded wiggle signal files. A couple of years ago I would say that it is possible, however quite messy, as the only way to display stranded wiggle signal files was to split the original genomic co-ordinate file (BED, SAM) per strand and then create two separate wiggle (or bigWig) tracks. This was happening because the wiggle (and later bedGraph) specification does not allow for overlapping signals. Now it is much clearer (slighlty more complicated though) by using the ability of the UCSC Genome Browser to overlay tracks, by creating a super/parent tracks and assigning children tracks to it. Unfortunately, this ability is only possible with track hubs.
In this post, I will show you how to create stranded wiggle (or in this example, bigWig) files by setting up a track hub that will host your signal files and which you can upload to the genome browser. For additional information on creating a track hub and the checks that have to be made before loading it, see this post and the script attached to it. Apart from your original track (this example uses an initial BED track, mapped to the hg18 human genome), you will need the following tools:
- The kent utilities from UCSC
- The BED tools
/path/to/BEDTools/genomeCoverageBed -i my_file.bed -g /path/to/BEDTools/genomes/human.hg18.genome -bg -strand + > my_file_plus.bed /path/to/BEDTools/genomeCoverageBed -i my_file.bed -g /path/to/BEDTools/genomes/human.hg18.genome -bg -strand - | awk '{ print $1"\t"$2"\t"$3"\t-"$4 }' > my_file_minus.bed /path/to/kent_source/bedGraphToBigWig my_file_plus.bed hg18.chrom.size my_file_plus.bigWig /path/to/kent_source/bedGraphToBigWig my_file_minus.bed hg18.chrom.size my_file_minus.bigWig
The hg18.chrom.size text file contains simply the size of each chromosome can be downloaded using the fetchChromSizes tool from kent source:
/path/to/kent_source/fetchChromSizes hg18
The next step is to follow the instructions about track hubs and create the directory structure described in the help page. In our case, the hub.txt file would be:
hub My_Stranded_Hub shortLabel Stranded Signal longLabel A custom track that displays stranded signal genomesFile genomes.txt email admin@yourdomain.com
The genomes.txt file would be:
genome hg18 trackDb hg18/trackDb.txt
and the trackDb.txt file would be:
track strandedSignal container multiWig aggregate transparentOverlay showSubtrackColorOnUi on shortLabel stranded longLabel An example of stranded wiggle signal boxedCgf on type bigWig         track myFilePlus         parent strandedSignal         type bigWig         bigDataUrl http://your_bigdata_server/hg18/my_file_plus.bigWig         color 180,0,0         track myFileMinus         parent strandedSignal         type bigWig         bigDataUrl http://your_bigdata_server/hg18/my_file_minus.bigWig         color 0,180,0
Finally, you have to load the following custom hub:
http://your_bigdata_server/hub.txt