How to upload multiple BAM file for visualize

66 views
Skip to first unread message

Jagat S Chauhan

unread,
Feb 18, 2015, 12:09:44 PM2/18/15
to gen...@soe.ucsc.edu
Hi UCSC developers,

I have multiple .bam files (with their index file .bai) and i want to visualize these multiple bam files with description. And how can I make a link (url) genome available to my colleagues. I am unable to proper understanding custom track and hub tracks. please help me.

with regards,
jagat

Brian Lee

unread,
Feb 18, 2015, 1:21:36 PM2/18/15
to Jagat S Chauhan, gen...@soe.ucsc.edu

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:

http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&hgt.customText=http://hgdownload.soe.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeCshlLongRnaSeq/wgEncodeCshlLongRnaSeqK562CellTotalAlnRep2.bam

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


--


Jagat S Chauhan

unread,
Feb 20, 2015, 12:38:19 PM2/20/15
to gen...@soe.ucsc.edu
Hi ,

Finally I successfully created Hub connection but how to create a URL of this hubs.

thanks,
jagat


---------- Forwarded message ----------
From: Brian Lee <bria...@soe.ucsc.edu>
Date: Fri, Feb 20, 2015 at 12:18 AM
Subject: Re: [genome] How to upload multiple BAM file for visualize
To: Jagat S Chauhan <jaga...@gmail.com>


Jagat,

Your problems are stemming from not having a publicly accessible location for your files. Please address your questions to your system administrators for help. 

Regarding the .hg.conf file, it should be start with period and ex.hg.conf is just an example that should be edited, not used directly. The line needed in this configuration file for hubCheck to work is the parameters about what directory to use to put temporary data, udc.cacheDir =.   

If your goal is to make a publicly accessible link to your data for your colleagues, you will need to work out with your system administrators to learn where and how you can put data that will be accessible on the internet. 

If you are just looking to load your data locally, you can install a GBiB on your laptop, as mentioned in the first email.

Please no longer reply to this email address. 

Instead send any further queries 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.

Brian Lee
UCSC Genome Bioinformatics Group

On Thu, Feb 19, 2015 at 3:10 AM, Jagat S Chauhan <jaga...@gmail.com> wrote:

On Thu, Feb 19, 2015 at 9:48 AM, Jagat S Chauhan <jaga...@gmail.com> wrote:
Thanks Brian,
sorry for again..

I have changed http://localhost/URL,
now my URL is  http://127.0.0.1/~jagatchauhan/hubDirectory/hub.txt , when paste this URL
                 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.txt
               please see attached snapshot.
when i used Debug Help page..
i copied mac os based hubCheck  and

jagatchauhan$ ./hubCheck http://127.0.0.1/~jagatchauhan/hubDirectory/hub.txt
                        Couldn't open /Users/jagatchauhan/.hg.conf , No such file or directory

put in my hubDirectory (without any changes)     ( http://127.0.0.1/~jagatchauhan/hubDirectory)

but still give error....

please help.

with regards,
jagat



On 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:
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..
so i have install xampp and apache is working..

I used following steps..
1. sudo /usr/sbin/apachectl restart

mkdir hubDirectory
chmod 777 hubDirectory
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.txt

2. 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/plain

4. 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" button

and it give error:  http://localhost/~jagatchauhan/hubDirectory/hub.txt is an invalid url


Please help me...

with regards,
jagat


hbs.tiff

Jonathan Casper

unread,
Feb 20, 2015, 6:29:39 PM2/20/15
to Jagat S Chauhan, gen...@soe.ucsc.edu

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


--


Reply all
Reply to author
Forward
0 new messages