QuantitativeCategorySeries
The Quantitative category series track extends categorical track by allowing each genomic interval to be associated with more than one category, and each category to be associated with a quantitative value. The categories are distinguished by colors, and the quantitative value is indicated by bar heights. This creates a highly combinatorial and informative track to display quantitative change of various qualities/categories along the genomic coordinate.
Note that a vertical axis is shown on the left of the track, indicating the cumulative quantities from all categories shown in the view range. Move cursor over one genomic interval to show the category name as well as quantity for that category.
Data format
The track format extends the hammock format, each line contains four columns:
- chromosome name
- start, 0-based
- stop
- json
The 4th field must contain two attributes: id and qcat array.
An example of the qcat array:
qcat:[ [0,3], [0,11], [0,10], [0,12], [0,8], [0,6], [0,2], [0.0001,1], [0.0001,13], [0.0002,9], [0.0002,7], [0.0003,4], [0.0006,14], [0.0009,5], [0.9975,15] ]
Each element of the qcat array is an array of two numbers. The first number is the quantitative value. The second number is the category id.
The order of appearance for the categories in a qcat array defines their rendering order, the earlier to appear, towards the bottom it goes.
Lines in the track file may have variable length of qcat array.
Track definition
The quantitative category series track must be submitted through datahub, an example track definition:
{type:'quantitativeCategorySeries', name:'qcats test', height:150, url:'http://xx/qcats.gz', backgroundcolor:'#000000', mode:'show', categories:{ '1':['Active TSS','#ff0000'], '2':['Flanking Active TSS','#ff4500'], '3':['Transcr at gene 5\' and 3\'','#32cd32'], '4':['Strong transcription','#008000'], '5':['Weak transcription','#006400'], '6':['Genic enhancers','#c2e105'], '7':['Enhancers','#ffff00'], '8':['ZNF genes & repeats','#66cdaa'], '9':['Heterochromatin','#8a91d0'], '10':['Bivalent/Poised TSS','#cd5c5c'], '11':['Flanking Bivalent TSS/Enh','#e9967a'], '12':['Bivalent Enhancer','#bdb76b'], '13':['Repressed PolyComb','#808080'], '14':['Weak Repressed PolyComb','#c0c0c0'], '15':['Quiescent/Low','#ffffff'] }, },
Track preparation
Take following steps to prepare a track file:
1. sort the track file using "sort" command:
sort -k1,1 -k2,2n old_file > new_file
2. compress file
bgzip new_file
3. index file
tabix -p bed new_file.gz
4. move files "new_file.gz" and "new_file.gz.tbi" to a web server. The two files must be in the same directory. Obtain the URL to "new_file.gz" to be used in the track definition.