This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BEDOPS sort-bed BED_LINE_LEN question

So I am just trying to sort a bed file in the following way:

sort-bed GSE63137_ATAC-seq_PV_neurons_HOMER_peaks.bed > GSE63137_ATAC-seq_PV_neurons_HOMER_peaks_sorted.bed

It is only a 3 column bed file:

e.g.

chrY            90810610    90811697
chrY            90812379    90813359
chrY            90828628    90829131
chrY            90838917    90839418

I am getting the following error, and that last line you see is whats causing it seems, thanks!

File has never been opened in excel.

No end of line found at 103361 in GSE63137_ATAC-seq_PV_neurons_HOMER_peaks.bed.
May need to increase BED_LINE_LEN and recompile.
First check that you have unix newlines (cat -A).
bedops bed sort-bed intervals

1 answer

What is the output of sort -k1,1 -k2,2n your.bed | tail ?

sort -k1,1 -k2,2n is totally sufficient for sorting a BED file. There is actually no need for any other tool than Unix sort.

That worked well thanks. Have been using bedops for other stuff so it was moreso what was in my head, and have used sort-bed always with no issues except today!

Log in to answer this question.