This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Does BEDOPS sort-bed sort in the same order as sort -k1,1 -k2,2n?

Does anyone know if BEDOPS sort-bed sorts in the same order as sort -k1,1 -k2,2n?

bedops

2 answers

The sort-bed tool applies a lexicographical sort on the first column (chromosome), a numerical sort on the second column (start position) and then a numerical sort on the third column (stop position) on ties for the second column.

This is not equivalent to the GNU sort options you list, which only sort on the first and second columns and ignore start position ties. In any case, BEDOPS sort-bed will still run faster than the equivalent three-column GNU sort, even with parallelization.

FWIW, the equivalent on GNU sort would be 'sort -k 1,1V -k 2,2n'

O.k. thanks. It does run at seeming light speeds faster then GNU sort, so it's definitely worth switching to. But it's good to know that files I've previously sorted with GNU sort are not exactly the same (although the same for files with no ties in the start position). Thanks!!!!

Log in to answer this question.