Bedops --element-of misses elements
1
0
Entering edit mode
6.2 years ago
rs ▴ 40

Bedops --element-of misses an element in a test input file that I think it should be reporting and I'm not sure why. Here is the command I run:

bedops --element-of 1 A_file.bed B_file.bed

A_file:

chr17 14 19 ENST20 . +

chr17 20 26 ENST21 . +

chr17 24 27 ENST22 . -

chr17 28 35 ENST23 . +

chr17 32 37 ENST24 . +

B_file:

chr17 14 17 ENST20 . +

chr17 16 18 ENST21 . +

chr17 27 30 ENST22 . -

chr17 29 30 ENST23 . +

chr17 31 34 ENST24 . -

chr17 32 38 ENST24 . +

This is the output I am expecting:

chr17 14 19 ENST20 . +

chr17 28 35 ENST23 . +

chr17 32 37 ENST24 . +

This is the output that I'm getting:

chr17 14 19 ENST20 . +

chr17 28 35 ENST23 . +

In other terms, I am not recovering the last element in A_file, even though it overlaps the last two elements in B_file. I would be really grateful for any ideas as to what is going on!

bedops --element-of • 1.1k views
ADD COMMENT
2
Entering edit mode
6.2 years ago

Does the last line end in a newline character? Use cat -e file.bed to check. If it lacks a newline it might get ignored.

ADD COMMENT
0
Entering edit mode

Good thinking! yep, file A lacked a newline. Strangely enough, bedtools doesn't seem to care either way, it's only an issue with bedops. Thanks a lot for your help!

ADD REPLY
0
Entering edit mode

Good to know, thanks!

ADD REPLY

Login before adding your answer.

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