Overlaps query ranges with reference ranges.
The function assumes that there is no overlap between reference ranges.
Usage
overlap(qry, ref)
Arguments
qry
data.frame with query ranges.
qry should have columns 'id','start' and 'end'.
The routine assumes that the table is ascending sorted
by column 'start'.
ref
data.frame with reference ranges.
ref should have columns 'id','start' and 'end'.
The routine assumes that the table is ascending
sorted by column 'start'.
Value
The function returns a data.frame
overlap
Factor which encodes type of overlap between query and
reference range. Levels no (no overlap; refid is set to 0),
l (qry left overhangs ref), n (qry is contained in ref ),
r (qry right overhangs ref)
%
leftDiff
Distance on left side between margins
of query and reference.
%
rightDiff
Distance on right side between margins
of query and reference.
%
queryid
id from qry table.
%
refid
id from ref table.
%
Details
The routine assumes that qry and ref tables are ascending sorted by
column 'start'.
Otherwise the result will be incorrect (i.e. missing hits).
The function assumes that there is no overlap between reference ranges.
It will otherwise return only one, possibly arbitrary, hit per query range.