Question: UCSC custom track - can different peaks have different color+height?
gravatar for nonish5
5.8 years ago by
European Union
nonish540 wrote:


I want to build a custom UCSC track where different peaks have different color+height.

I read the instructions here,, but didn't find such example.

The only similar example that I found is presented below, but the different color is only for positive vs. negative peaks. and I want all my peaks to be positive.

Do you know if this is possible at all?


More specifically, the 2 types of data that I want to present (in two colors) is a score per position (some of the scores are 0 and I simply ignore them and don't plot them at all). Thus, the span of each peak is 1 (a single position) and the height is different. In addition, since I have 2 types of data, a position may have a score in both options and there may be an overlap in some cases.

I succeeded drawing something like this using  "track type=bedGraph":

like this:

browser position chr20:41052953-41066370
track type=bedGraph name="BedGraph Format" description="BedGraph format" visibility=full 
chr20    41052876    41052877    0.214750
chr20    41052953    41052954    -0.409103
chr20    41052989    41052990    0.118746

(with positive and negative values for the last column).

I was wondering if there is format that supports two colors for the data where all peaks are positive. and if so, what happens in case the same position contains two such peaks.

In addition, I need the ability to generate an automatic link to the UCSC browser that displays the area of interest.

[This is possible when using bed files, using a link of the form "" (where my_data_file.txt is the data file that I generated)]


gene genome • 3.4k views
ADD COMMENTlink modified 5.7 years ago • written 5.8 years ago by nonish540
gravatar for Madelaine Gogol
5.8 years ago by
Madelaine Gogol5.1k
Kansas City
Madelaine Gogol5.1k wrote:

You can do it in a track hub with a multiwig, but it'll take some set up.

ADD COMMENTlink written 5.8 years ago by Madelaine Gogol5.1k

A bed format doesn't support my request?


ADD REPLYlink modified 5.8 years ago • written 5.8 years ago by nonish540

BED format doesn't do height, thus no contour, no peaks. BED format specifies features, rectangles. To accomplish what you want, you will have to decompose your data into more than one track, and then use multiwig, as Madelaine suggested, to overlay the decomposed tracks and specify the colors you want for each one. You'd essentially have to do the "decomposing" step either way (in principle), since you need a way to classify peaks (i.e. regions) so you can assign color. It's sort of a nifty idea to extract your peaks into classes, such that a given data track contains just the regions of that class. You could have three classes (tracks for overlaying): peaks of type 1, peaks of type 2, data not considered a peak (i.e. the stuff between the peaks). As to the issue of "what happens in case the same position contains two such peaks", this is a little confusing. How many "peaks" can occur in a single position of a data track? How are you calling peaks such that you have more than one at a given spot? Either way, with multiwig the peaks can overlap and the colors can be semitransparent such that they blend.

ADD REPLYlink written 5.8 years ago by seidel7.1k
gravatar for Matt Shirley
5.8 years ago by
Matt Shirley9.3k
Cambridge, MA
Matt Shirley9.3k wrote:

This is possible. Take a look at the BED format description. You'll need a 9 column format; even though you don't require all 9 fields you have to specify them. Check out the example on the same page.

ADD COMMENTlink written 5.8 years ago by Matt Shirley9.3k

I think that's only for a bed track, not wig.

ADD REPLYlink written 5.8 years ago by Madelaine Gogol5.1k

Yes, you are correct. I was thinking that the score value would determine the height, like bedGraph format, but bedGraph is just a wiggle variant.

ADD REPLYlink written 5.8 years ago by Matt Shirley9.3k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1531 users visited in the last hour