intersectBed Segmentation fault or Received illegal bin number
2
2
Entering edit mode
9.8 years ago
Ct586 ▴ 630

I have met an weird error.

Here lists my two bed files

a.bed

chr1 645339590 645344590
chr1 645485603 645490603
chr1 646267584 646272584
chr1 651156159 651161159
chr1 652224601 652234601
chr1 654584466 654589466
chr1 656200028 656210028
chr1 658335720 658345720
chr1 672881471 672886471
chr1 673481036 673486036

b.bed

chr1 567457 567702
chr1 569801 570047
chr1 713857 714086
chr1 714475 714736
chr1 762251 763163
chr1 762416 762594
chr1 762691 762997
chr1 793349 794537
chr1 800991 801931
chr1 805262 805484

When I was running intersectBed -a a.bed -b b.bed, there is an error intersectBed: line 2: 21275 Segmentation fault (core dumped) ${0%/*}/bedtools intersect "$@".

When I was running intersectBed -a b.bed -b a.bed, there is another error ERROR: Received illegal bin number 39388 from getBin call. ERROR: Unable to add record to tree.

I can not figure out what causes this. Thanks for the help.

Chen Tong

intersectBed • 12k views
ADD COMMENT
0
Entering edit mode

What version of bedtools are you using? I tried to reproduce your error using the files you posted and it worked fine, this was with bedtools 2.17.0. So maybe try upgrading to the latest version of bedtools...

ADD REPLY
0
Entering edit mode

Thanks, the version I am using is bedtools 2.22.1.

ADD REPLY
0
Entering edit mode

Anyway I think it is weird since it works fine for you. Maybe I will give bedtools 2.17.0 a try just for curiosity.

ADD REPLY
0
Entering edit mode

Actually I can reproduce the error myself with bedtools 2.22 (but not with 2.17)

ADD REPLY
2
Entering edit mode
9.8 years ago

@aaronquinlan will confirm but I suspect that the value for chr1 is just to high for the internal 'binning' system of bedtools. See http://genomewiki.ucsc.edu/index.php/Bin_indexing_system

position  max = 536,870,912

but you used

position  max = 673,486,036

my idea / hypothesis.

ADD COMMENT
0
Entering edit mode

Thanks! That's the problem. This may be a potential bug of `shuffleBed` since the bed file is generated using it with `-chrom` parameter given.

ADD REPLY
1
Entering edit mode
9.8 years ago

You might try BEDOPS:

$ bedops --intersect a.bed b.bed > answer.bed

So long as your input files are sorted, you shouldn't run into these problems.

ADD COMMENT
0
Entering edit mode

It is a great choice. Just before trying `bedops`, I found my coordinates are too large, which causing the problem. Anyway, I'd like to try `bedops` since I am attracted by its homepage.

ADD REPLY
0
Entering edit mode

I am also facing the same error. kindly tell me how i can solve it ?

bedtools intersect -a SPRINT_identified_all.res.col3 -b wheat_col6.bed -wa -wb > output.bed

ERROR: Received illegal bin number 37458 from getBin call.

ERROR: Unable to add record to tree.

ADD REPLY

Login before adding your answer.

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