Question: bedtools intersect without range
0
gravatar for christylynn002
4.1 years ago by
United States
christylynn0020 wrote:

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 -loj however, 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 bedtool 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 • 1.2k views
ADD COMMENTlink written 4.1 years ago by christylynn0020
1

use linux join command.

ADD REPLYlink written 4.1 years ago by PoGibas4.8k

Perfect. Thank you.

ADD REPLYlink written 4.1 years ago by christylynn0020
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: 1303 users visited in the last hour