# \dontshow{
options(gmax.processes = 2)
# }
gdb.init_examples()
# Create some intervals
intervs <- gintervals(
c("chr1", "chr1", "chr2"),
c(100, 150, 1000),
c(200, 250, 2000)
)
# Calculate total bp covered
# Note: intervals [100,200) and [150,250) overlap,
# so total is (200-100) + (250-150) + (2000-1000) = 100 + 100 + 1000 = 1200
# But after canonicalization: [100,250) + [1000,2000) = 150 + 1000 = 1150
gintervals.covered_bp(intervs)
Run the code above in your browser using DataLab