Question: How To Intersect Two Tracks In Ucsc Table Browser And Get Fields From Both?
0
gravatar for Nachocab
4.3 years ago by
Nachocab50
Boston, MA
Nachocab50 wrote:

In the UCSC Table browser, I'm trying to intersect a custom track (with genomic coordinates and a name field) and the knownGenes track.

What I'm getting are the lines in my custom track that contain a knownGene, but it doesn't tell me which gene. If I reverse the intersection, I get the genes that contain one of my custom lines, but not the name field of my custom track.

What am I doing wrong?

ucsc • 2.0k views
ADD COMMENTlink modified 4.3 years ago • written 4.3 years ago by Nachocab50
3
gravatar for Alex Reynolds
4.3 years ago by
Alex Reynolds18k
Seattle, WA USA
Alex Reynolds18k wrote:

One way to do this is to export your custom and knownGenes tracks to BED files, using an application like bedmap to report gene IDs from knownGenes, which overlap custom track regions by one or more bases, e.g.:

$ bedmap --echo --echo-map-id --delim '\t' custom.bed knownGenes.bed > answer.bed

The answer.bed file will contain results of the form:

[ custom-element-1 ] \t [ semi-colon-delimited list of known genes overlapping element 1 ]
[ custom-element-2 ] \t [ semi-colon-delimited list of known genes overlapping element 2 ]
...
[ custom-element-N ] \t [ semi-colon-delimited list of known genes overlapping element N ]

I think the UCSC browser exports sorted BED data, so there shouldn't be a need to pre-sort the BED inputs.

ADD COMMENTlink modified 4.3 years ago • written 4.3 years ago by Alex Reynolds18k

I tried using your tool, but I kept getting errors like this one:

dyld: lazy symbol binding failed: Symbol not found: __ZNSt8__detail15_List_node_base7_M_hookEPS0_
  Referenced from: /Users/nacho/Documents/Code/BioTools/bedops/bedmap
  Expected in: /usr/lib/libstdc++.6.dylib
ADD REPLYlink written 4.3 years ago by Nachocab50
1

You could build BEDOPS from source (so that the build takes into account your local versions of kernel and core libraries) or just use the solution you found. If you're interested in the first option, see: http://code.google.com/p/bedops/source/checkout

ADD REPLYlink modified 4.3 years ago • written 4.3 years ago by Alex Reynolds18k

I have created a beta v2.1 BEDOPS installer for Mac OS X Intel 10.5-10.8, which attempts to address this specific issue. If you are interested, I would welcome feedback on it. It is available here: https://dl.dropbox.com/u/31495717/BEDOPS%20v2p1p0%20%28beta%29.mpkg.zip

ADD REPLYlink written 4.1 years ago by Alex Reynolds18k
2
gravatar for Aaronquinlan
4.3 years ago by
Aaronquinlan9.7k
United States
Aaronquinlan9.7k wrote:

I don't think the UCSC Tables interface has this functionality. Under the assumption that you'd prefer to work in a browser as opposed to the command line, I would recommend using Galaxy - specifically the join intervals tool. Using the Get Data -> UCSC Main interface you can grab the knownGenes track in the manner you are used to. And using the Upload data interface you can upload your custom track.

ADD COMMENTlink modified 4.3 years ago • written 4.3 years ago by Aaronquinlan9.7k
0
gravatar for Nachocab
4.3 years ago by
Nachocab50
Boston, MA
Nachocab50 wrote:

I ended up downloading the UCSC table (gencode v14) and doing

intersectBed -a custom.bed -b gencode_exons.bed -wb
ADD COMMENTlink written 4.3 years ago by Nachocab50
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1296 users visited in the last hour