Dear Jagat,
Thank you for using the UCSC Genome Browser and your question about displaying remote bam files in the browser. The solution is to build a track hub, but first I will show you a simple custom track approach and then provide steps to building an easy track hub.
If you go to the custom tracks page, http://genome.ucsc.edu/cgi-bin/hgCustom, you can enter a URL to a named.bam file where the related named.bam.bai also exists. You can paste that URL in the "Paste URLs or data" box and click submit. Alternatively you can build a direct URL to the browser, in this example using an ENCODE.bam and ENCODE.bam.bai file address, following the&hgt.customText= parameter:
Please test to see that you can put the URL to your bam file in this example. If it does not work, you want to trouble shoot your internet connections before going forward. Data must be on a publicly accessible server that allows range requests. To check your server, in a terminal you can use the curl -I http://URL/to/your/file.bam
and look to be sure "Accept-Ranges: bytes" is displayed.
Now that we've ensured your bam files are accessible and can display in the browser, for full annotation control you will want to put them into a track hub. A track hub is just a series of text documents that allow you to fully annotate your files, giving both a structured display and rich descriptions. In the publicly accessible server location that you have your bam files, grab this example hub by following the steps in this Basic Hub Quick Start Guide, http://genome.ucsc.edu/goldenPath/help/hubQuickStart.html with the following wget command:
wget -r --no-parent --reject "index.html*" -nH --cut-dirs=3http://genome.ucsc.edu/goldenPath/help/examples/hubDirectory/
Once you verify that this copied hub displays when provided form your http://URL/to/your/copyof/hub.txt, you can go in and edit the hub.txt and trackDb.txt files (and genomes.txt file if you aren't using the hg19 assembly).
In the trackDb.txt remove all the stanza except for the track bam1 stanza. Make several copies of that stanza, giving each new stanza new a unique name (i.e., "track bam2", "track bam3", ect...). Replace the bigDataUrl that points to http://hgdownload.soe.ucsc.edu/.../file.bam to point instead to yourhttp://URL/to/your/file.bam and edit the annotations to give meaningful descriptions. Once you have that basic hub of bams working fine, explore the further control that is possible with Track Hubs by reviewing the User Guide: http://genome.ucsc.edu/goldenPath/help/hgTrackHubHelp.html
On the Track Hub User Guide page you will also find links to other Quick Start Guides, such as about grouping related tracks, and a very good step by step "Setting up Your Own Track Hub" section. Also, please note that once you start editing these text files, you will likely want to momentarily add "&udcTimeout=1" to your UCSC URL, to allow the browser to check quickly for any changes. Usually the browser waits five minutes to check for changes, see more in the "Debugging and Updating Track Hubs" section. Lastly, if you did not want to do this over the internet, you can install a virtual machine Genome Browser In a Box and create Track Hubs locally on your laptop, see an example here:http://genome.ucsc.edu/goldenPath/help/hubQuickStartAssembly.html#blatGbib
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 Genome Bioinformatics Group
--
On Thu, Feb 19, 2015 at 9:48 AM, Jagat S Chauhan <jaga...@gmail.com> wrote:when i used Debug Help page..now my URL is http://127.0.0.1/~jagatchauhan/hubDirectory/hub.txt , when paste this URLplease see attached snapshot.
http://127.0.0.1/~jagatchauhan/hubDirectory/hub.txt and click Add hub" button and this time file is added but gives error in description.
ERROR: Couldn't open http://127.0.0.1/~jagatchauhan/hubDirectory/hub.txti copied mac os based hubCheck and
jagatchauhan$ ./hubCheck http://127.0.0.1/~jagatchauhan/hubDirectory/hub.txtCouldn't open /Users/jagatchauhan/.hg.conf , No such file or directorythen i copy hg.conf file from http://genome-source.cse.ucsc.edu/gitweb/?p=kent.git;a=blob_plain;f=src/product/ex.hg.conf;hb=HEAD,put in my hubDirectory (without any changes) ( http://127.0.0.1/~jagatchauhan/hubDirectory)but still give error....please help.with regards,jagatOn Thu, Feb 19, 2015 at 12:27 AM, Brian Lee <bria...@soe.ucsc.edu> wrote:Dear Jagat,
One of our engineers shares that you can not use http://localhost/ as a URL for a local hosted hub file. You need to use: http://127.0.0.1/ as a reference to localhost. The bug for this is in the javaScript functions that parse the URL to verify it is legitimate.
All the best,
Brian Lee
On Wed, Feb 18, 2015 at 11:44 AM, Jagat S Chauhan <jaga...@gmail.com> wrote:chmod 777 hubDirectorymkdir hubDirectoryso i have install xampp and apache is working..Dear Brian,
Thank you so much for your kind reply and an excellent explanation.
But i have still problem in Basic Hub Quick Start Guide step 2:some points...I am using my local mac os system..
I used following steps..
1. sudo /usr/sbin/apachectl restart
curl -O http://genome.ucsc.edu/goldenPath/help/examples/hubDirectory/hub.txt
curl -O http://genome.ucsc.edu/goldenPath/help/examples/hubDirectory/genomes.txt
mkdir hg19
cd hg19
curl -O http://genome.ucsc.edu/goldenPath/help/examples/hubDirectory/hg19/trackDb.txt2. Jagats-MacBook-Pro:hubDirectory jagatchauhan$ curl -I http://localhost/~jagatchauhan/WTCHG_33776_110.bam
HTTP/1.1 200 OK
Date: Wed, 18 Feb 2015 19:25:07 GMT
Server: Apache/2.4.9 (Unix)
Last-Modified: Thu, 19 Apr 2012 15:21:19 GMT
ETag: "8ee4ef44-4be09b942f9c0"
Accept-Ranges: bytes
Content-Length: 2397368132
3. Jagats-MacBook-Pro:hubDirectory jagatchauhan$ curl -I http://localhost/~jagatchauhan/hubDirectory/hub.txt
HTTP/1.1 200 OK
Date: Wed, 18 Feb 2015 19:25:27 GMT
Server: Apache/2.4.9 (Unix)
Last-Modified: Wed, 18 Feb 2015 19:13:56 GMT
ETag: "b2-50f619eeb0500"
Accept-Ranges: bytes
Content-Length: 178
Content-Type: text/plain4. go to My Hubs tab of the Track Data Hubs page http://genome.ucsc.edu/cgi-bin/hgHubConnect, and i paste my url
http://localhost/~jagatchauhan/hubDirectory/hub.txt and click Add hub" buttonwhen i paste http://genome.ucsc.edu/goldenPath/help/examples/hubDirectory/hub.txt URL, then its working.Please help me...with regards,jagat
Hello Jagat,
Instructions to create a URL that you can share with other people to view your hub on the UCSC Genome Browser can be found in the Track Hub User Guide at http://genome.ucsc.edu/goldenPath/help/hgTrackHubHelp.html#Session. There are several options available, but a simple URL to share your hub would be something like http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&hubUrl=http://163.1.96.179/~jagatchauhan/hubDirectory/hub.txt.
If the publicly accessible URL for your hub is not "http://163.1.96.179/~jagatchauhan/hubDirectory/hub.txt", then replace that text with the URL for your hub.
I hope this is helpful. If you have any further questions, please reply to gen...@soe.ucsc.edu or genome...@soe.ucsc.edu. Questions sent to those addresses will be archived in publicly-accessible forums for the benefit of other users. If your question contains sensitive data, you may send it instead to genom...@soe.ucsc.edu.
--
Jonathan Casper
UCSC Genome Bioinformatics Group
--