How to display a base-sequence track that "disappears" when zooming out

5 views
Skip to first unread message

Nilson, Kyle A

unread,
Oct 5, 2017, 5:20:42 PM10/5/17
to gen...@soe.ucsc.edu
I am performing genomics experiments on viral sequences and would like to display my underlying genome when zoomed in on a small region. I realize the official solution is to create an Assembly Hub, but these hubs cannot be readily archived on GEO and our work would cease to be available if our server went down or we closed shop. As a work-around for my ChIP- and PRO-Seq tracks, I instead change my chromosome to "chr1" and show all my viral data from, say, chr1:1-235147 (the length of a popular hCMV genome). To show my reference genome, I create a Bed or bigBed file that displays every base. For example:

...
chr1 235113 235113 G 255 .
chr1 235114 235114 C 255 .
chr1 235115 235115 A 255 .
chr1 235116 235116 C 255 .
...

My problem: I want such a track to disappear gracefully when the user zooms out (or if you prefer, when the number of elements exceeds N).

As a feature, would it be possible to have a "visibility=" track parameter switch from "pack" to "hide" when N exceeds 50, or when a user zooms out too far?

As a general question, is there a better way to display single nucleotide information from a single file (no multiple files, directory structures, etc. that cannot be hosted on GEO)?

Thank you!

Kyle Nilson | Price Lab | University of Iowa

Brian Lee

unread,
Oct 6, 2017, 3:36:06 PM10/6/17
to Nilson, Kyle A, gen...@soe.ucsc.edu

Dear Kyle,

Thank you for using the UCSC Genome Browser and your inventive use of displaying viral sequences on the browser.

While there is a solution that would likely work we really want to encourage an alternate approach where you would host your data remotely (otherwise you risk the chance of uploaded custom track data being lost, please do keep backups of your files locally). If you are using track lines for your tracks you can add a parameter called maxWindowToDraw= where you give then number of base pairs you want the track to shut off. For example this below track should display a note to tell a user to zoom in beyond 50 bp:

track name="myTrack" description="My track represents X,Y,Z" maxWindowToDraw=50 visibility=pack


chr1 235113 235113 G 255 . 

...data

While this is a solution for your situation, there is a concern that if you are loading large regions, it would be better if your data was hosted remotely using bigBeds for this current data type (or assembly hubs for a more complex and likely rewarding display). The reasoning for this is that the Browser has to upload all your data if you are using text files, so if you have a 1G text file, but a user is only displaying say a small region, we have to take in all that 1G locally and then in the end display only the small regions the user views. By turning your data into a binary indexed file called a bigBed the browser would only fetch the regions a person is viewing over the internet (and you also keep full retention of your data in case our local machines fail for some reason, or if you update your data, the data is updated for viewers if the same file name and location is used with a 5 minute caching delay).

There is a free online service provider called CyVerse, funded by the NSF, that can host your bigBed (or assembly hub). Please see this previous answer about uploading and hosting data there (you may have to select on the right side "Info-Type: bigBed" to activate the option to "Send to: Genome Browser" where you obtain a link) : https://groups.google.com/a/soe.ucsc.edu/forum/#!msg/genome/_Ws2jxNfJV4/0c5aGb_PAQAJ

There is one further obstacle that can sometimes keep people from jumping from text files to using bigBeds, you have to do some command-line operations using our bedToBigBed tool. With data like the above (pointing to the hg19 assembly) here are the steps to do that converstion:

1. Download and make executable the bedToBigBed utility for your computer system to wrap up your bed file into a bigBed: http://hgdownload.soe.ucsc.edu/admin/exe/
(for example if you have a Mac: http://hgdownload.soe.ucsc.edu/admin/exe/macOSX.x86_64/bedToBigBed)

2. Run bedToBigBed on your file (called in.bed here), using the correct chrom.sizes for the assembly you are working with (for example this URL to hg19 below)

bedToBigBed in.bed http://hgdownload.cse.ucsc.edu/goldenPath/hg19/bigZips/hg19.chrom.sizes out.bigBed

3. Place your resulting out.bigBed file in an internet accessible location like CyVerse that will accept byte-range requests (so only small sections of the file are sent over the internet). Then you can use a custom track like this below, where the only additions compared to the text version are "type=bigBed and bigDataUrl=http://location/data/file.bigBed":

track name="myTrack" description="My track represents X,Y,Z" maxWindowToDraw=50 visibility=pack type=bigBed bigDataUrl=http://URL/byte-range-accepted/location/like/CyVerse/file.bigBed

To make sure this works fine, I did a test run upload to CyVerse with your small example. I did one small change, where I moved to use our 0-based coordinate system (chr1 235112 235113 G 255 . see more here: http://genome.ucsc.edu/blog/the-ucsc-genome-browser-coordinate-counting-systems/) to display blocks, and I added the labelOnFeature=on feature so the name would display on the block (this might not be desired as names will disappear around 25 bp depending on screen size). Here is that example that you can paste into the hgCustom page:

browser position chr1:235110-235120 
track name="myTrack" description="My track represents X,Y,Z" maxWindowToDraw=50 visibility=dense labelOnFeature=on type=bigBed bigDataUrl=https://de.cyverse.org/anon-files/iplant/home/brianlee/out.bigBed

Once you are comfortable making bigBeds, the jump to building an Assembly Hub isn't that much harder. You basically use tools to wrap a fasta file into what we call a binary indexed 2bit file, and with a few text files you have an assembly hub. The payoff is tremendous and really recommended. Here are some MLQs in our archives about building assembly hubs:

Archived answer (you can search archives for related responses):
https://groups.google.com/a/soe.ucsc.edu/d/msg/genome/7fSLtg5ruBk/KDy9rIOnAwAJ
Quick Start Guide to Assembly Hubs: http://genome.ucsc.edu/goldenPath/help/hubQuickStartAssembly.html
Assembly Hub wikipage: http://genomewiki.ucsc.edu/index.php/Assembly_Hubs
Presentation about Assembly Hubs: http://genomewiki.ucsc.edu/images/0/04/AssemblyHubsUCSC.pdf

Thank you again for your inquiry and using the UCSC Genome Browser. 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 forum. If your question includes sensitive data, you may send it instead to genom...@soe.ucsc.edu.

All the best,

Brian Lee
UCSC Genomics Institute



--

---
You received this message because you are subscribed to the Google Groups "UCSC Genome Browser Public Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genome+un...@soe.ucsc.edu.
To post to this group, send email to gen...@soe.ucsc.edu.
Visit this group at https://groups.google.com/a/soe.ucsc.edu/group/genome/.
To view this discussion on the web visit https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome/BY1PR0401MB117572D60DD3986589691FEFEA700%40BY1PR0401MB1175.namprd04.prod.outlook.com.
For more options, visit https://groups.google.com/a/soe.ucsc.edu/d/optout.

Reply all
Reply to author
Forward
0 new messages