This function extends each region in a Genomic Ranges object by a designated upstream and downstream extension in a strand-aware fashion

extendGR(gr = NULL, upstream = NULL, downstream = NULL)

Arguments

gr

A GRanges object.

upstream

The number of basepairs upstream (5') to extend each region in gr in a strand-aware fashion.

downstream

The number of basepairs downstream (3') to extend each region in gr in a strand-aware fashion.

Examples


# Dummy GR
gr <- GRanges(
  seqnames = "chr1",
  ranges = IRanges(
    start = c(1, 4, 11),
    end = c(10, 12, 20)
  ),
  score = c(1, 2, 3)
)

# Non Overlapping
extendGR(gr, 1, 2)