Learn R Programming

charm (version 2.18.0)

regionMatch: Given two data frames with columns "chr", "start", and "end", identify the nearest region in one to the other.

Description

Given two data frames with columns "chr", "start", and "end", identify the nearest region in one (object2) to the other (object1).

Usage

regionMatch(object1, object2, verbose=TRUE)

Arguments

object1
Data frame with columns "chr", "start", and "end". For each of the rows of this data frame, find the nearest regions in object2.
object2
Data frame with columns "chr", "start", and "end".
verbose
print progress.

Value

A data frame with one row corresponding for each row of object1, and columns:
dist
bp separating the region in object1 and the nearest region in object2
matchIndex
row index of object2 for the region that is closest to the region in object1
type
"inside" if nearest region in object2 is wholly contained inside the region in object 1, "cover" if nearest region in object2 covers the whole region in object1, "disjoint" if there is no overlap between the region in object1 and the nearest region in object1, and "overlap" if the region in object1 and the nearest region in object2 overlap but one does not wholly cover the other.
amountOverlap
amount of overlap between the region in object1 and the nearest region in object2
insideDist
for type="inside" regions, the smaller (fewest bp) of 1., the end position of region in object1 - the end position of the nearest region in object2, and 2., the start position of region in object1 - the start position of the nearest region in object2.
size1
number of bp in region in object1
size2
number of bp in nearest region in object2

Details

Given two data frames with columns "chr", "start", and "end", identify the nearest region in one (object2) to the other (object1).

See Also

dmrFind, plotDMRs, plotRegions

Examples

Run this code
# See qval

Run the code above in your browser using DataLab