Question: bedtools:intersectBed - how to get overlapping information?
gravatar for anastasiya-terskih
4.1 years ago by
Russian Federation
anastasiya-terskih0 wrote:

Hello! I need some help consearning intersectBed.

I have file main.bed that contains information: chomosome, start position, end position. (it contains 350 lines) 

I want to intersect my file with annotation file  (Ensemble) to know information about regions (coding,nonciding, etc)

which correspond to my coordinates (start-end position). So I expect to get following file: chr,my coordinates + information about regions (maybe another info).

I use: intersectBed –a annotation.bed –b main.bed –c >  result.bed

As a result I've got a file with the same information from annotation.bed and the last column - it's the number of overlapping lines from my file.

Does somebody know how I can get the file that contains also 350 lines but with additional information about regions? 

ADD COMMENTlink modified 4.1 years ago by Neilfws48k • written 4.1 years ago by anastasiya-terskih0
gravatar for Sakti
4.1 years ago by
United States
Sakti360 wrote:

intersectBed will always give you the intersect segments from your datafile overlapping the other features. But seems that what you want to do is simply attach the annotation.bed overlap info onto your original main.bed file. If you're familiar with perl you can write a small script where you save array keys for your chr:start:end positions and then go over it and search against your annotation.bed file for chromosomal region overlaps (also in array chr:start:end key format) and save the overlaps onto the main.bed keys.

ADD COMMENTlink written 4.1 years ago by Sakti360

Thank you very much! I'll try to do it.

ADD REPLYlink written 4.1 years ago by anastasiya-terskih0
Please log in to add an answer.


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