
Merge neighboring loop anchor positions into one representative anchor.
Source:R/mergeAnchors.R
mergeAnchors.RdThe representative anchor is chosen as the mode of a set of neighboring anchors. If there are no modes, the middle-most anchor of the set of neighboring anchors is chosen. If there are multiple modes, the middle-most anchor of the set of modes is chosen. In the case of an even number in the set, the anchor at a higher genomic coordinate is chosen to break ties.
Arguments
- loops
GInteractions object of loops from Hi-C data
- pixelOverlap
numeric representing the number of pixels away from an anchor is considered to be overlapping For example, `pixelOverlap = 1` means only immediately neighboring pixels will be merged and `pixelOverlap = 2` means all anchors within 2 pixels will be merged
- dropDups
logical determining whether duplicates should be dropped from output
Examples
mergeAnchors(loops = GM12878_10KbLoops, pixelOverlap = 1)
#> GInteractions object with 175 interactions and 0 metadata columns:
#> seqnames1 ranges1 seqnames2 ranges2
#> <Rle> <IRanges> <Rle> <IRanges>
#> [1] 22 33910000-33920000 --- 22 34500000-34510000
#> [2] 22 42360000-42370000 --- 22 42830000-42840000
#> [3] 22 32920000-32930000 --- 22 33390000-33400000
#> [4] 22 50320000-50330000 --- 22 50650000-50660000
#> [5] 22 50710000-50720000 --- 22 51050000-51060000
#> ... ... ... ... ... ...
#> [171] 22 42090000-42100000 --- 22 42330000-42340000
#> [172] 22 30680000-30690000 --- 22 30750000-30760000
#> [173] 22 31020000-31030000 --- 22 31470000-31480000
#> [174] 22 25630000-25640000 --- 22 25730000-25740000
#> [175] 22 20760000-20770000 --- 22 20810000-20820000
#> -------
#> regions: 225 ranges and 0 metadata columns
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths