bedtools2 icon indicating copy to clipboard operation
bedtools2 copied to clipboard

Sorted input has out of order record

Open lieuv opened this issue 5 years ago • 1 comments

I have an issue when I try to intersect two sorted bed files with bedtools v2.29.2

$ cat  test_a.bed
Y       9429489 9429490
Y       13139020        13139020
Y       13142410        13142411
Y       13142410        13142413

$ cat test_b.bed
1       645710  645711  ALU     0.00698882      0.0189

$ bedtools intersect -sorted -a test_a.bed -b test_b.bed
Error: Sorted input specified, but the file test_a.bed has the following out of order record
Y       13142410        13142413

I read similar threads reporting issues with "0 length" variants and incorrect sorted bed files. But both files are sorted. When I delete any of the variants of test_a.bed it works again.

lieuv avatar Sep 14 '20 13:09 lieuv

Thanks for reporting this. It appears to be a logic bug, as changing the chromosomes in test_a.bed to "A" or "X" or "1" seems to work. @38 could you please have a look into this? Test files attached. a.bed.gz b.bed.gz

arq5x avatar Sep 14 '20 17:09 arq5x