bedtools icon indicating copy to clipboard operation
bedtools copied to clipboard

bedtools: unionBedGraphs.cpp:99 error

Open xmzhuo opened this issue 6 years ago • 2 comments

When I ran bedtools unionbedg -i 1.bg 2.bg -name 1 2> union.txt I got bedtools: unionBedGraphs.cpp:99: CHRPOS UnionBedGraphs::ConsumeNextCoordinate(): Assertion `!queue.empty()' failed. Aborted (core dumped)

The bedtools is v2.25.0

The head of my bedgraph files

1.bg chr1 10000 125177984 -0.0553952 chr1 143186644 143289543 0.275241 chr1 143289543 143497399 0.990598 chr1 143497399 143666153 0.706978 chr1 143666153 144351460 0.971119 chr1 144351460 144614882 1.18038 chr1 144614882 144847433 0.948291 chr1 144847433 145178768 1.08364 chr1 145178768 145302246 1.22399 chr1 145302246 145329000 0.79742

2.bg chr1 10001 1629000 -0.102214 chr1 1629001 2352000 -0.125595 chr1 2352001 2441000 -0.176067 chr1 2441001 3193000 -0.126910 chr1 3193001 4575000 -0.097342 chr1 4575001 4988000 -0.162679 chr1 4988001 6286000 -0.106630 chr1 6286001 9089000 -0.096024 chr1 9089001 12132000 -0.151516 chr1 12132001 13123000 -0.095164

I tried sorting sort -c -k1,1 -k2,2n 1.bg sort -c -k1,1 -k2,2n 2.bg

but still generated the same error message.

I also tried latest version : v2.27.1 getting similar error Assertion failed: (!queue.empty()), function ConsumeNextCoordinate, file unionBedGraphs.cpp, line 99. Abort trap: 6

Please help.

xmzhuo avatar Jun 18 '18 18:06 xmzhuo

Hi xmzhuo,

I ran into the same issue lately and found this old post: https://github.com/arq5x/bedtools2/issues/496 which explained that the issue might result from a space-delimited input (instead of tab-delimited). I checked my pipeline, and indeed my input wasn't tab-delimited. When I corrected this the issue was resolved. Hope this works for you too.

bioXiaoheng avatar Feb 04 '19 18:02 bioXiaoheng

Thanks bioXiaoheng, did a sed to replace all space with tab and it work.

xmzhuo avatar Feb 06 '19 14:02 xmzhuo