Hi,
I'm working on uniquifying a BED file. I tried the version of bedops installed in my HPC, and then since it did not have an option to uniquify on the fly, I downloaded the latest version of bedops from GitHub. The numbers I see are different and I don't know why that's happening.
Note: The line counts below are not completely genuine, as I masked the first four digits (which were uniform in all wc outputs). The BED file is 7.5G in size and smaller numbers are easier to eyeball-compare.
wc -l file.bed
xxxx4305
module load bedops #this loads bedops/2.4.2
sort-bed file.bed | uniq | wc -l
xxxx4305
sort -u file.bed | wc -l
xxxx3670
The above difference shows that sort-bed and sort work differently. The BED file is all numbers with no header, so I don't see why this difference should happen.
sort-bed from the current version (2.4.37) of bedops has a --unique option built in, so I installed that from github
/new/version/sort-bed --unique file.bed | wc -l
xxxx3035 #where did this number come from???
/new/version/sort-bed file.bed | uniq | wc -l
xxxx3670 #same as previous sort-bed | uniq combo
What could be happening here? Could the newer version be finding more duplicates because it uses memory more efficiently? Why is sort-bed | uniq not the same as sort -u?
I'll be getting raw output and running a diff to dig into what's happening here but in the meantime, I'd appreciate any pointers. Thank you!
bedops
sort-bed