Display multiple custom tracks with hgRenderTracks url?

36 views
Skip to first unread message

Endre Bakken Stovner

unread,
Aug 24, 2016, 12:45:26 PM8/24/16
to UCSC Genome Browser Discussion List
I want to 1) display multiple custom tracks in the genome browser and 2) get the results by curl-ing.

Therefore I have tried creating a link with hgRenderTracks, like so:


This is a link that has 2 hgct_customText parts with the following info:

type,name,description,visibility,url
bigWig,myBigWig,"PolII for Sample1 at time 0",full,https://github.com/endrebak/git-lfs/raw/master/PolII.bw
bigWig,myBigWig2,"PolII for Sample2 at time 0",full,https://github.com/endrebak/git-lfs/raw/master/PolII2.bw

The problem is, when I try to curl this link, like so:


only the last of the two tracks (the one called "myBigWig2") is displayed.

Is it possible to display more than one custom track with a hgRenderTracks url? If so, how do I display more than one track at the same time?

Thanks.

Ps. the files https://github.com/endrebak/git-lfs/raw/master/PolII.bw and https://github.com/endrebak/git-lfs/raw/master/PolII2.bw are two copies of the same file, so if the two custom tracks look identical this is not a bug :)


Endre Bakken Stovner

unread,
Aug 24, 2016, 12:57:02 PM8/24/16
to UCSC Genome Browser Discussion List
There is a cryptic hint about this:

Tip: Multiple tracks can be placed into one custom track submission. To do so, create a new file that contains the track lines to each file that will be included. To submit this custom set of tracks, merely use the URL to this new file.

1) How would a file with multiple tracks look?
2) How would I link to such a file in a hgRenderTracks url?
3) How can I include UCSC native tracks in such a URL? (Such as wgEncodeRegMarkPromoter and knownGene)

Thanks!

Matthew Speir

unread,
Aug 24, 2016, 1:43:49 PM8/24/16
to Endre Bakken Stovner, UCSC Genome Browser Discussion List
Hi Endre,

Thank you for your question about displaying multiple custom tracks in the UCSC Genome Browser using URL parameters.


1) How would a file with multiple tracks look?

I took the information you provided in your email to create a file for loading these custom tracks here: http://genome-test.soe.ucsc.edu/~mspeir/mlqCTs.txt. Essentially, you are taking all of the information that would normally be provided in a custom track line, as described on https://genome.ucsc.edu/goldenPath/help/customTrack.html#TRACK, and placing it into a file.


2) How would I link to such a file in a hgRenderTracks url?

You would use the "&hgct_customText=" parameter. For example, I was able to use the file I linked above in the hgRenderTracks URL to get a picture containing both custom tracks:

curl 'http://genome.ucsc.edu/cgi-bin/hgRenderTracks?&db=hg18&position=chr1%3A16514270-16514470&hgct_customText=http://genome-test.soe.ucsc.edu/~mspeir/mlqCTs.txt&knownGene=full' > 2Tracks.new.png

3) How can I include UCSC native tracks in such a URL? (Such as wgEncodeRegMarkPromoter and knownGene)

You can use these track names in the URL along with a visibility setting to set the visibility of that track in the subsequent image. For example, to set knownGene to display dense, you would add "&knownGene=dense" to your URL. You can also control the display of tracks using "browser" lines in the custom track file I described in my response to your first question. You can find details on using "browser" lines here: https://genome.ucsc.edu/goldenPath/help/customTrack.html#BROWSER.

I should also note that it looks like there is one mistake in your URL that is cuase the "db=" parameter to be ignored. You should remove the "&" before "db=hg18" in the URL: http://genome.ucsc.edu/cgi-bin/hgRenderTracks?&db=hg18. When I was looking at the images generated by curling that URL, it was ignoring the "db" parameter and displaying hg38 instead of hg18. Once I remove that extra "&", it displayed hg18.

I hope this is helpful. If you have any further questions, please reply to gen...@soe.ucsc.edu. All messages sent to that address are archived on a publicly-accessible Google Groups forum. If your question includes sensitive data, you may send it instead to genom...@soe.ucsc.edu.

Matthew Speir
UCSC Genome Bioinformatics Group
--


Endre Bakken Stovner

unread,
Aug 25, 2016, 12:16:16 PM8/25/16
to Matthew Speir, UCSC Genome Browser Discussion List
Thank you for your answer - I very much appreciate it. Perhaps the FAQ should be updated with something like your example above?

Anyways, when I click the link I get the correct image. However, when I try to curl the link, I get the same image as yesterday with only one custom track displayed. I wonder whether this has to do with caching or what, but using


did not work either. 

Do you know what might be the problem or a possible fix? (I have tried downloading the link from multiple servers.)


Endre Bakken Stovner

unread,
Aug 25, 2016, 12:16:44 PM8/25/16
to Matthew Speir, UCSC Genome Browser Discussion List
I found the likely error myself; in the second line, by a slip of the keyboard, visibility became "visbility" in your text file.

Thanks again.
Reply all
Reply to author
Forward
0 new messages