This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bedtools complement issue

Hello,

2.25.0 version seems to give wierd result. I get lots of regions with the start higher than the end position. Most of the time here is what I get :
scaffold_ID 1 -1
Is there an explanation to this behavior? I get expected results with 2.19 version so it seems related to the version.
Thanks for any help.

Anaïs

software error

when you report unexpected results you should show a simple example (one line) for the input and the output you believe to be incorrect as well as the corresponding command line

You are right. Here is an example.

initial bed file :

scaffold_1055   0       79 (with scaffold_1055 of size 88587)

result of bedtools complement v2.25:

scaffold_1055   0       0
scaffold_1055   80      88586

result of bedtools complement v2.19:

scaffold_1055   79      88587 (expected)

Looks like it is linked to 0-based/1-based issue, doesn't it?

Here is my command line:

bedtools complement -i mybedfile.bed -g mygenome.file

1 answer

Via BEDOPS bedops --complement:

$ sort-bed A.unsorted > A
$ sort-bed B.unsorted > B
$ sort-bed C.unsorted > C
...
$ bedops --complement A B C ... > answer.bed

The output should not contain any data other than the genomic regions between two or more sorted input sets.

Log in to answer this question.