This function identifies all interactions in query
where one anchor overlaps an entry in subject1
and the other anchor overlaps an entry in subject2
.
It is designed to be used to identify regions that are linked by interactions in query
.
For example, one might specify genes as subject1
and enhancers as subject2
, to identify all gene-enhancer contacts present in query
.
This is useful when the exact pairings between subject1
and subject2
are undefined.The function returns a dataframe specifying the index of the interaction in query
; the index of the overlapped region in subject1
;
and the index of the overlapped region in subject2
.
If multiple regions in subject1
and/or subject2
are overlapping the anchor regions of a particular interaction,
all combinations of two overlapping regions (one from each subject*
set) are reported for that interaction.
By default, use.region="both"
such that overlaps will be considered between any first/second interacting region in query
and either subject1
or subject2
.
If use.region="same"
, overlaps will only be considered between the first interacting region in query
and entries in subject1
,
and between the second interacting region and subject2
.
The opposite applies with use.region="reverse"
, where the first and second interacting regions are overlapped with subject2
and subject1
respectively.
If subject2
is not specified, links within subject1
are identified instead, i.e., subject2
is set to subject1
.
In such cases, the returned dataframe is such that the first subject index is always greater than the second subject index, to avoid redundant permutations.