gr.dist: Pairwise distance between two 'GRanges'

gr.distR Documentation

Pairwise distance between two GRanges

Description

Computes matrix of pairwise distance between elements of two GRanges objects of length n and m.

Distances are computed as follows:

  • NA for ranges on different seqnames

  • 0 for overlapping ranges

  • min(abs(end1-end2), abs(end1-start2), abs(start1-end2), abs(start1-end1),) for all others

If only gr1 is provided, then will return n x n matrix of gr1 vs itself
If max.dist = TRUE, then will replace min with max above

Usage

gr.dist(gr1, gr2 = NULL, ignore.strand = FALSE, ...)

Arguments

gr1

First GRanges

gr2

Second GRanges

ignore.strand

Don't required elements be on same strand to avoid NA [FALSE]

...

Additional arguments to be supplied to GenomicRanges::distance

Value

N by M matrix with the pairwise distances, with gr1 on rows and gr2 on cols

Author(s)

Marcin Imielinski


mskilab/gUtils documentation built on June 6, 2023, 12:08 a.m.