track hub with external link including two variables

3 views
Skip to first unread message

Yoko Yuzawa

unread,
Aug 17, 2015, 7:32:13 PM8/17/15
to gen...@soe.ucsc.edu
Dear UCSC management team

Thank to you, we are glad to have our public track hub.
http://portal.nersc.gov/dna/RD/ChIP-Seq/VISTA_enhancer_e/VistaEnhancerTrackHub/hub.txt

We'd like to further improve this and replace the old version of our track which is registered in the default track set with our new one.
Our track hub in each genome includes two tracks, e.g. in hg19 track there are human enhancers and mouse (lifted over to human) enhancers. We'd like to merge these two tracks but I'm struggling to do it since it contains link to VISTA browser.

Now organism name is fixed and link is working with this.
url http://enhancer.lbl.gov/cgi-bin/imagedb3.pl?form=presentation&show=1&experiment_id=$$&organism_id=1
To make a link from merged track I need to specify both ID and organism name (1 for human and 2 for mouse).


What I tried was
1)make merged bed9+2 file like this (organism id in 10th column).
chr1    2808410    2809683    1088    1    .    2808410    2809683    255,0,0    2    forebrain[4/7], limb[7/7], branchial arch[6/7]
chr1    3190581    3191428    705    1    .    3190581    3191428    255,0,0    1    hindbrain (rhombencephalon)[5/6]
chr1    3262093    3266365    1912    1    .    3262093    3266365    255,0,0    1    heart[4/4]
chr1    10593123    10594209    677    0    .    10593123    10594209    0,0,255    1    negative
chr1    10757664    10758631    361    0    .    10757664    10758631    0,0,255    1    negative
chr1    10781239    10781744    389    1    .    10781239    10781744    255,0,0    1    heart[3/8]
chr1    16175203    16176288    316    0    .    16175203    16176288    0,0,255    2    negative
chr1    18473083    18476025    8    0    .    18473083    18476025    0,0,255    2    negative

2)
then create bb with this
bedToBigBed -tab -type=bed9+2 -as=field.as extraIndex=database,evidence hg19_merged_test.bed hg19.chrom.sizes hg19_merged_test.bb

3)
setting enhancerAssay.txt (trackDb.txt) and change organism_id="$D" or "database" etc.. but nothing worked.
url http://enhancer.lbl.gov/cgi-bin/imagedb3.pl?form=presentation&show=1&experiment_id=$$&organism_id=2

I think I did something wrong (and stupid), and I'd appreciate if you could point it to me. Thanks a lot!
Yoko

Steve Heitner

unread,
Aug 19, 2015, 3:39:36 PM8/19/15
to Yoko Yuzawa, gen...@soe.ucsc.edu

Hello, Yoko.

This is an interesting situation.  With your current linkout, the “$$” pulls the “name” field from your bigBed which corresponds to the experiment ID, and the organism ID is simply hard-coded as “1” for human and “2” for mouse.

With your proposed change, you now require two variables in the linkout – the experiment ID and the organism ID.  The way you have proposed to change it is by using the “urls” option instead of “url”.  This allows you to specify a field other than “name” with “$$”, but the problem here is that you still require the “name” field, too.  When you assign “$$” to another variable, you lose the ability to refer to the “name” field with “$$”.  You can still only refer to one variable, not two.  The $D option merely refers to the current assembly, not any field in the bigBed file, so if you were viewing the hg19 version of the track, $D would always just return “hg19” and not “1” or “2” like you need it to.

There is a solution that requires a little alteration to your “name” field.  Currently, the “name” field is something like “316” which refers to the experiment ID.  You can change this to something like “316:1” which would indicate experiment 316 in the human database or “316:2” which would indicate experiment 316 in the mouse database.  You could then make your linkout URL:

url http://enhancer.lbl.gov/cgi-bin/imagedb3.pl?form=presentation&show=1&experiment_id=$P&organism_id=$p

The $P option specifies that only the portion to the left of the “:” in the “name” field be used.  Conversely, the $p option specifies that only the portion to the right of the “:” in the “name” field be used.  This works nicely, but unfortunately, it also displays “316:1” or “316:2” as the item name in hgTracks and hgc.  Unfortunately, there is currently no way to specify the “name” field plus some other field in a linkout.  This workaround is the best way to accomplish what you are trying to do.

Please contact us again at gen...@soe.ucsc.edu if you have any further questions. 
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.

---
Steve Heitner
UCSC Genome Bioinformatics Group

--

Yoko Yuzawa

unread,
Aug 19, 2015, 6:22:37 PM8/19/15
to Steve Heitner, gen...@soe.ucsc.edu
Hello Steve
The solution you suggested worked and it I personally think is great. Thanks for your help!
Yoko
Reply all
Reply to author
Forward
0 new messages