vlookup type array matching command for BED analysis
0
0
Entering edit mode
8.5 years ago
rishi ▴ 10

Hi. I am a beginner in computational biology.

I have a bed file with four columns; CHR#, START, STOP, READVALUE. I have a second bed file with five columns; CHR#, START, STOP, ENSG-ID, GENE-ID. The CHR#s are not in order.

I want to create a third bed file which intersects the START and STOP intervals of File 1 and 2 (or 2 and 1) and prints the READVALUE as a sixth column after the GENE-ID column. I've tried my best but am unable to do so. What command(s) should I try?

Thanks in advance for the help.

ChIP-Seq unix • 1.8k views
ADD COMMENT
1
Entering edit mode

I've tried my best but am unable to do so

what have you tried ?

ADD REPLY
0
Entering edit mode

I've tried intersecting in different ways but doesn't work. I need all the six columns. I guess I have to write something in awk but I don't know how to

ADD REPLY
1
Entering edit mode

Have you looked at BedTools intersectBed (http://bedtools.readthedocs.io/en/latest/content/tools/intersect.html )?

ADD REPLY
0
Entering edit mode

Got the answer! Adding -wb and then editing made it possible. Thank you

ADD REPLY

Login before adding your answer.

Traffic: 1983 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6