stitchRanges: Stitch Ranges within a given distance

View source: R/stitchRanges.R

stitchRangesR Documentation

Stitch Ranges within a given distance

Description

Stitch together ranges within a given distance, using excluded ranges as barriers that cannot be crossed

Usage

stitchRanges(x, exclude, maxgap = 12500L, ignore.strand = TRUE)

Arguments

x

Ranges to be stitched together

exclude

Ranges to exclude

maxgap

The maximum distance between ranges to be stitched

ignore.strand

logical

Details

Stitches together ranges within a given distance, using any ranges provided for exclusion as barriers between stitched ranges. This may be particularly useful if wanting to stitch enhancers whilst excluding promoters.

All inputs and outputs are Genomic Ranges objects

Value

A GRanges object

Examples

x <- GRanges(c("chr1:1-10", "chr1:101-110", "chr1:201-210", "chr2:1-10"))
y <- GRanges("chr1:200:+")
stitchRanges(x, exclude = y, maxgap = 100)


steveped/chipExtra documentation built on Aug. 1, 2024, 12:33 a.m.