bedops -u is not sorting the bed files
bedops --version
bedops
citation: http://bioinformatics.oxfordjournals.org/content/28/14/1919.abstract
version: 2.4.14
authors: Shane Neph & Scott Kuehn
#dummy file:
cat my.bed
chr1 1 5 peak_1
chr1 2 6 peak_2
chr1 3 7 peak_3
chr1 2 4 peak_4
chr1 8 10 peak_5
chr1 3 6 peak_6
#test bedops -u
bedops -u my.bed my.bed
chr1 1 5 peak_1
chr1 1 5 peak_1
chr1 2 6 peak_2
chr1 2 6 peak_2
chr1 3 7 peak_3
chr1 2 4 peak_4
chr1 3 7 peak_3
chr1 2 4 peak_4
chr1 8 10 peak_5
chr1 3 6 peak_6
chr1 8 10 peak_5
chr1 3 6 peak_6
correct output should be:
sort-bed my.bed my.bed
chr1 1 5 peak_1
chr1 1 5 peak_1
chr1 2 4 peak_4
chr1 2 4 peak_4
chr1 2 6 peak_2
chr1 2 6 peak_2
chr1 3 6 peak_6
chr1 3 6 peak_6
chr1 3 7 peak_3
chr1 3 7 peak_3
chr1 8 10 peak_5
chr1 8 10 peak_5
please fix this, my bedops -u *bed | bedmap —count —echo —delimit ‘\t’ -
is failing...
according to http://bedops.readthedocs.io/en/latest/content/usage-examples/multiple-inputs.html
bedmap should complain that if the input is not sorted rather than just let it go silently.
Thanks,
Tommy
I think you have to include the
--ec
flag for error checking no?yes, you are right. -ec is for checking error. but bedops -u should not expect sorted bed files, right?
I think the requirements for all bedops operations including
-u
are that the input be sorted prior to being run, however, i've never gotten any errors when giving un-sorted files to bedops, I don't think the-u
flag changes that, at least not in my experience. I always sort every file I give bedops just for this reason.Now it makes sense. every input bed file should be sorted. with -u it does not give me errors, but just missing many overlapping entries. bedops is a very good tool BTW:)
Great, and yes, bedops is among my most used tools, very powerful!
it is under-appreciated compared with bedtools, another good one :)
even version: 2.4.30 (typical) is having the same issue.
Just give
bedops -u
sorted data and it will work fine.Everyone should definitely update to 2.4.30 where possible, which includes a number of major speed enhancements and fixes across the board.