Skip to contents

Given a query set of genome intervals, report distance to all others within window

Usage

getPeakDistances(query, windowSize = 10000)

Arguments

query

GRanges object of intervals to query

windowSize

with of window around each interval in bp

Value

for all pairs of peaks within windowSize, report distance

Details

A smaller window size will create a covariance matrix that is faster to evaluate, but larger windows give a better approximation and are less likely to have negative eigen value

Examples

library(GenomicRanges)

query = GRanges(rep('chr1', 5), IRanges(1:5, 1:5))

getPeakDistances( query )
#>    queryHits subjectHits distance
#> 1          1           1        0
#> 6          2           1        1
#> 7          2           2        0
#> 11         3           1        2
#> 12         3           2        1
#> 13         3           3        0
#> 16         4           1        3
#> 17         4           2        2
#> 18         4           3        1
#> 19         4           4        0
#> 21         5           1        4
#> 22         5           2        3
#> 23         5           3        2
#> 24         5           4        1
#> 25         5           5        0