bedtools intersect without range
0
0
Entering edit mode
9.3 years ago

I have two files:

FileA.bed

ZC3H14    1
VRK1    2
G6PC    79
tp63dn    3
G6PD    174

FileB.bed

ZC3H14    1
VRK1    1
G6PC    14
G6PD    1
tp63dn    2

I would like to intersect the two files with bedtools intersect -a FileA.bed -b FileB.bed -lojhowever, I do not have a range to intersect the two files with. I basically want to print the number in FileB.bed into FileA.bed for the corresponding gene as so:

ZC3H14    1    1
VRK1    2    1
G6PC    79    14
tp63dn    3    2
G6PD    174    1

However, when I try the bedtools command as above, I get an error. Can I not use bedtools for this type of intersection?

P.S. I need the -loj because there are some instances in FileA.bed that are not in FileB.bed, however I still want the line in FileA.bed to print.

intersect bedtools • 2.0k views
ADD COMMENT
1
Entering edit mode

use linux join command.

ADD REPLY
0
Entering edit mode

Perfect. Thank you.

ADD REPLY

Login before adding your answer.

Traffic: 1675 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