Question: How To Intersect Two Tracks In Ucsc Table Browser And Get Fields From Both?
0
gravatar for Nachocab
5.9 years ago by
Nachocab80
Boston, MA
Nachocab80 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 • 3.1k views
ADD COMMENTlink modified 10 months ago by max10 • written 5.9 years ago by Nachocab80
3
gravatar for Alex Reynolds
5.9 years ago by
Alex Reynolds26k
Seattle, WA USA
Alex Reynolds26k 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 5.9 years ago • written 5.9 years ago by Alex Reynolds26k

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 5.9 years ago by Nachocab80
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 5.9 years ago • written 5.9 years ago by Alex Reynolds26k

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 5.7 years ago by Alex Reynolds26k
2
gravatar for Aaronquinlan
5.9 years ago by
Aaronquinlan10k
United States
Aaronquinlan10k 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 5.9 years ago • written 5.9 years ago by Aaronquinlan10k
0
gravatar for Nachocab
5.9 years ago by
Nachocab80
Boston, MA
Nachocab80 wrote:

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

intersectBed -a custom.bed -b gencode_exons.bed -wb
ADD COMMENTlink written 5.9 years ago by Nachocab80
0
gravatar for max
10 months ago by
max10
max10 wrote:

Use the UCSC Data Integrator to intersect two tables and keep both fields:

https://genome.ucsc.edu/cgi-bin/hgIntegrator

ADD COMMENTlink written 10 months ago by max10
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: 1082 users visited in the last hour