Skip to contents

Merge peaks according to ArchR's iterative merging algorithm. More details on the ArchR website

Usage

merge_peaks_iterative(peaks)

Arguments

peaks

Peaks given as GRanges, data.frame, or list. See help("genomic-ranges-like") for details on format and coordinate systems. Required attributes:

  • chr, start, end: genomic position

Must be ordered by priority and have columns chr, start, end.

Value

tibble::tibble() with a nonoverlapping subset of the rows in peaks. All metadata columns are preserved

Details

Properties of merged peaks:

  • No peaks in the merged set overlap

  • Peaks are prioritized according to their order in the original input

  • The output peaks are a subset of the input peaks, with no peak boundaries changed

Examples

## Create example peaks
peaks <- tibble::tibble(
 chr = "chr1",
 start = as.integer(1:10),
 end = start + 2L
)
peaks
#> # A tibble: 10 × 3
#>    chr   start   end
#>    <chr> <int> <int>
#>  1 chr1      1     3
#>  2 chr1      2     4
#>  3 chr1      3     5
#>  4 chr1      4     6
#>  5 chr1      5     7
#>  6 chr1      6     8
#>  7 chr1      7     9
#>  8 chr1      8    10
#>  9 chr1      9    11
#> 10 chr1     10    12

## Merge peaks
merge_peaks_iterative(peaks)
#> # A tibble: 5 × 3
#>   chr   start   end
#>   <chr> <int> <int>
#> 1 chr1      1     3
#> 2 chr1      3     5
#> 3 chr1      5     7
#> 4 chr1      7     9
#> 5 chr1      9    11