Reduce panel regions to input target ranges by respecting a minimum region size.

reduce_panel(reg_gr, target_gr, min_size = 100)

Arguments

reg_gr

A GRanges object with regions defining the panel.

target_gr

A GRanges object with regions defining the target regions to which the panel should be reduced.

min_size

integer size in bp as the minimal size an individual region can be reduced to.

In cases where the overlapping part of an input region with a target region is smaller than min_size, the overlapping part will be resized to min_size by fixing the center of the overlapping part.

Examples

reg_gr <- GenomicRanges::GRanges(c(
  "1:100-500",
  "1:700-900",
  "1:1100-1200"
))
target_gr <- GenomicRanges::GRanges(c(
  "1:200-600",
  "1:800-1000"
))

r <- reduce_panel(reg_gr, target_gr, min_size = 100)