I have a few GRanges that I need to sort based on their chromosomes/seqnames, start and end coordinates of the intervals.
I used to be able to do it in this way:
sort(gr, by = ~ seqnames + start + end)
But now I get this error:
Error in get(nm, parent, mode = "function") : object 'seqnames' of mode 'function' was not found
Is there anything wrong with my code?
What's the best way to reliably sort multiple GRanges objects in the same way (similar to bedtools sort or bedops sort-bed)?