Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-f does not work if used with -split in v2.29 #773

Closed
dominik-handler opened this issue Sep 18, 2019 · 2 comments
Closed

-f does not work if used with -split in v2.29 #773

dominik-handler opened this issue Sep 18, 2019 · 2 comments

Comments

@dominik-handler
Copy link

Hi,
I came across a very strange bug. It seems that starting with v2.29 -f does not function properly anymore if used in conjunction with option -split.
read-file

cat b.bed
X       10      30      A2      1       +       0       30      255,0,0 1       20      0
cat x.bed
X       0       20      B1      0       +

cat y.bed
X       0       20      B1      0       +
X       0       20      B2      0       +

cat z.bed
X       0       20      B1      0       +
X       0       20      B2      0       +
X       0       20      B1      0       +

v.2.28

./bedtools.2-28.simg intersect -wao -split -f 0.61 -a b.bed -b x.bed
X       10      30      A2      1       +       0       30      255,0,0 1       20      0       .       -1      -1      .       -1      .     0
./bedtools.2-28.simg intersect -wao -split -f 0.61 -a b.bed -b y.bed
X       10      30      A2      1       +       0       30      255,0,0 1       20      0       .       -1      -1      .       -1      .     0
./bedtools.2-28.simg intersect -wao -split -f 0.61 -a b.bed -b z.bed
X       10      30      A2      1       +       0       30      255,0,0 1       20      0       .       -1      -1      .       -1      .     0

v.2.29

./bedtools.2-29.simg intersect -wao -split -f 0.61 -a b.bed -b x.bed
X       10      30      A2      1       +       0       30      255,0,0 1       20      0       .       -1      -1      .       -1      .     0
./bedtools.2-29.simg intersect -wao -split -f 0.61 -a b.bed -b y.bed
X       10      30      A2      1       +       0       30      255,0,0 1       20      0       X       0       20      B1      0       +     10
X       10      30      A2      1       +       0       30      255,0,0 1       20      0       X       0       20      B2      0       +     20
./bedtools.2-29.simg intersect -wao -split -f 0.61 -a b.bed -b z.bed
X       10      30      A2      1       +       0       30      255,0,0 1       20      0       X       0       20      B1      0       +     10
X       10      30      A2      1       +       0       30      255,0,0 1       20      0       X       0       20      B2      0       +     20
X       10      30      A2      1       +       0       30      255,0,0 1       20      0       X       0       20      B1      0       +     30

One difference I observed is the extent of overlap printed in the last column. it seems v2.29 sums this one up for all the regions in b a read in a is overlapping. If I create an example where one read can overlap the regions in y.bed then I get this:

v2.28
./bedtools.2-28.simg intersect -wao -split -f 0.61 -a a.bed -b y.bed
X       0       20      A1      1       +       0       20      255,0,0 1       20      0       X       0       20      B1      0       +     20
X       0       20      A1      1       +       0       20      255,0,0 1       20      0       X       0       20      B2      0       +     20
X       10      30      A2      1       +       0       30      255,0,0 1       20      0       .       -1      -1      .       -1      .     0

v2.29
./bedtools.2-29.simg intersect -wao -split -f 0.61 -a a.bed -b y.bed
X       0       20      A1      1       +       0       20      255,0,0 1       20      0       X       0       20      B1      0       +     20
X       0       20      A1      1       +       0       20      255,0,0 1       20      0       X       0       20      B2      0       +     40
X       10      30      A2      1       +       0       30      255,0,0 1       20      0       X       0       20      B1      0       +     10
X       10      30      A2      1       +       0       30      255,0,0 1       20      0       X       0       20      B2      0       +     20

You can see that for both reads the overlaps are summed up in v2.29 but not in v2.28.
This behavior only occurs if -split is selected.

./bedtools.2-29.simg intersect -wao  -f 0.61 -a a.bed -b y.bed
X       0       20      A1      1       +       0       20      255,0,0 1       20      0       X       0       20      B1      0       +     20
X       0       20      A1      1       +       0       20      255,0,0 1       20      0       X       0       20      B2      0       +     20
X       10      30      A2      1       +       0       30      255,0,0 1       20      0       .       -1      -1      .       -1      .     0

Hope this helps.

@arq5x
Copy link
Owner

arq5x commented Sep 18, 2019

There was a bug in -f -split fixed in 2.29, but the fix may have introduced another issue. I will be able to dig into this in a few days. Thanks for reporting.

arq5x added a commit that referenced this issue Dec 1, 2019
@arq5x
Copy link
Owner

arq5x commented Dec 1, 2019

Thank you for reporting this bug. It has been fixed in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants