This is a test version of Biostars. For the public version, visit https://www.biostars.org.
UCSC custom track - can different peaks have different color+height?

Hi,

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

I read the instructions here, http://genome.ucsc.edu/goldenPath/help/customTrack.html, 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.

http://genome.ucsc.edu/goldenpath/help/bedgraph.html

Do you know if this is possible at all?

Edit:

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 "http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=chrX&hgct_customText=https://my_data_file.txt" (where my_data_file.txt is the data file that I generated)]

Thanks!

genome gene

2 answers

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

A bed format doesn't support my request?

Thanks!

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.

Hi

Thanks for the prompt reply. I ment that I want a different width per peak, like here (but having them all positive)

this fig. was generated using the file:

browser position chr17:41052953-41066370
browser hide all
browser pack refGene encodeRegions
browser full altGraph
track type=bedGraph name="BedGraph Format" description="BedGraph format" visibility=full 
chr17    41052876    41052877    0.214750
chr17    41052953    41052954    0.409103
chr17    41052989    41052990    0.118746
chr17    41053021    41053022    0.004209
chr17    41053061    41053062    0.187258
chr17    41053082    41053083    0.068467
chr17    41053123    41053124    0.412266
chr17    41053128    41053129    0.011305
...

(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.

You should update your question rather than post an answer as a comment.

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.

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

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.

Log in to answer this question.