removeOverlappingRanges: removeOverlappingRanges

View source: R/scanning.R

removeOverlappingRangesR Documentation

removeOverlappingRanges

Description

Removes elements from a GRanges that overlap (or are within a given distance of) other elements higher up in the list (i.e. assumes that the ranges are sorted in order of priority). The function handles overlaps between more than two ranges by successively removing those that overlap higher-priority ones.

Usage

removeOverlappingRanges(
  x,
  minDist = 7L,
  retIndices = FALSE,
  ignore.strand = FALSE
)

Arguments

x

A GRanges, sorted by (decreasing) importance.

minDist

Minimum distance between ranges.

retIndices

Logical; whether to return the indices of entries to remove, rather than the filtered GRanges.

ignore.strand

Logical. Whether the strand of the input ranges should be ignored or not.

Value

A filtered GRanges, or an integer vector of indices to be removed if 'retIndices==TRUE'.

Examples

library(GenomicRanges)
gr <- GRanges(seqnames=rep("A",4), IRanges(start=c(10,25,45,35), width=6))
removeOverlappingRanges(gr, minDist=7)

ETHZ-INS/scanMiR documentation built on April 16, 2024, noon