## an example with ties
gi = GenomeIntervals(c("chr2", "chr2", "chr1", "chr1"), c(1,1,10,10), c(5,3,12,12) )
sort(gi)
rank(gi)
order(gi)
## Define order on seqnames at your convenience
## by specifying the order of the levels
## compare:
gi = GenomeIntervals(
c("chr2", "chr2", "chr10", "chr10"),
c(1,1,10,10),
c(5,3,12,12)
)
sort(gi)
## with:
gi2 = GenomeIntervals(
factor(c("chr2", "chr2", "chr10", "chr10"), levels=c("chr2", "chr10")),
c(1,1,10,10),
c(5,3,12,12)
)
sort(gi2)
Run the code above in your browser using DataLab