linkOverlaps: Link overlapping regions

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Identify interactions that link two sets of regions by having anchor regions overlapping one entry in each set.

Usage

1
2
3
4
5
6
7
## S4 method for signature 'GenomicInteractions,Vector,Vector'
linkOverlaps(query, subject1,
  subject2, ..., use.region = c("any", "match"))

## S4 method for signature 'GenomicInteractions,Vector,missing'
linkOverlaps(query,
  subject1, subject2, ..., use.region = NULL)

Arguments

query

A GenomicInteractions object.

subject1

A Vector object supporting one-dimensional findOverlaps with query.

subject2

A Vector object supporting one-dimensional findOverlaps with query. This can be missing.

...

Additional arguments to be passed to findOverlaps.

use.region

String specifying which anchor regions of query should be matched to which subjects. Ignored when subject2 is missing.

Details

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 overlap the anchor regions of a particular interaction, all combinations of two overlapping regions (one from each subject* set) are reported for that interaction.

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 less than the second subject index, to avoid redundant permutations. Any trivial interaction of a subject with itself is discarded from the output.

If use.region="any", there is no constraint on the overlaps between anchor regions and entries in subject1 and subject2. If use.region="match", linking overlaps are only considered between the first anchor region and subject1, and the second anchor region and subject2. (Obviously, users can simply swap the arguments in subject1 and subject2 to achieve the reverse effect.) All settings of use.region are ignored when subject2 is missing, as both anchors must overlap subject1.

Value

A DataFrame of integer indices indicating which elements of query link which elements of subject1 and subject2.

Author(s)

Aaron Lun

See Also

findOverlaps for GenomicInteractions instances.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
anchor1 <- GRanges(c("chr1", "chr1", "chr1", "chr1"), 
    IRanges(c(10, 20, 30, 20), width=5))
anchor2 <- GRanges(c("chr1", "chr1", "chr1", "chr2"), 
    IRanges(c(100, 200, 300, 50), width=5))
test <- GenomicInteractions(anchor1, anchor2)
test

all.genes <- GRanges("chr1", IRanges(0:9*20, 1:10*20))
all.enhancers <- GRanges("chr2", IRanges(0:9*20, 1:10*20))

out <- linkOverlaps(test, all.genes, all.enhancers)
out

out <- linkOverlaps(test, all.genes)
out

LTLA/GenomicInteractions documentation built on June 24, 2019, 2:09 p.m.