Limits intervals to chromosomal range.
gintervals.force_range(intervals = NULL, intervals.set.out = NULL)
If 'intervals.set.out' is 'NULL' a data frame representing the intervals.
This function enforces the intervals to be within the chromosomal range [0, chrom length) by altering the intervals' boundaries. Intervals that lay entirely outside of the chromosomal range are eliminated. The new intervals are returned.
If 'intervals.set.out' is not 'NULL' the result is saved as an intervals set. Use this parameter if the result size exceeds the limits of the physical memory.
gdb.init_examples()
intervs <- data.frame(
chrom = "chr1",
start = c(11000, -100, 10000, 10500),
end = c(12000, 200, 13000000, 10600)
)
gintervals.force_range(intervs)
#> chrom start end
#> 1 chr1 11000 12000
#> 2 chr1 0 200
#> 3 chr1 10000 500000
#> 4 chr1 10500 10600