gintervals.remove_overlaps: Remove overlapping intervals by selecting one interval per...

View source: R/intervals.R

gintervals.remove_overlapsR Documentation

Remove overlapping intervals by selecting one interval per overlap group

Description

Remove overlapping intervals by selecting one interval per overlap group

Usage

gintervals.remove_overlaps(intervals, select = c("first", "last", "random"))

Arguments

intervals

intervals set

select

how to select intervals from each group: "first", "last", or "random" (default: "first")

Value

The intervals set with overlapping intervals removed, keeping one interval per group based on the selection method

Examples

## Not run: 
# Create sample overlapping intervals
intervs <- data.frame(
    chrom = "chr1",
    start = c(11000, 100, 10000, 10500),
    end = c(12000, 200, 13000, 10600),
    data = c(10, 20, 30, 40)
)

# Remove overlaps keeping first interval in each group
non_overlapping <- gintervals.remove_overlaps(intervs)

# Remove overlaps keeping random interval from each group
non_overlapping <- gintervals.remove_overlaps(intervs, select = "random")

## End(Not run)

tanaylab/misha.ext documentation built on Jan. 2, 2025, 12:27 p.m.