boundingBox: Get the bounding box

Description Usage Arguments Details Value Author(s) Examples

Description

Compute a minimum bounding box for groups of pairwise genomic interactions.

Usage

1
2
## S4 method for signature 'GenomicInteractions'
boundingBox(x, f, reflect = TRUE)

Arguments

x

A GenomicInteractions object.

f

A factor or vector of length equal to that of x, indicating the group to which each pairwise interaction belongs.

reflect

A logical scalar indicating whether intra-chromosomal interactions can be flipped around the diagonal to achieve a smaller bounding box.

Details

For any group of pairwise interactions, the minimum bounding box is the smallest rectangle in the interaction space that contains all interactions in the group. Each side of the box has coordinates spanning the most extreme anchor regions on the corresponding chromosome. This is often useful for summarizing clusters of interactions.

Grouping of interactions is specified using f, where interactions in x with the same level of f are considered to be in the same group. If f is not specified, all interactions in x are assumed to be in a single group (named as “1”). An error will be raised if a group spans multiple chromosomes for either the first or second anchor regions.

The function returns a GenomicInteractions object containing the coordinates of the bounding boxes for all groups. Each interaction represents a bounding box for a group, where the anchor regions represent the sides of the box. Entries are named according to the levels of f, in order to specify which bounding box corresponds to which group.

reflect=TRUE will ensure that all interactions lie on one side of the diagonal of the interaction space. (Specifically, the first anchor will always start before the second anchor, see swapAnchors for details.) This has a number of implications:

Value

A GenomicInteractions object containing the coordinates of each bounding box.

Author(s)

Aaron Lun

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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))
gi <- GenomicInteractions(anchor1, anchor2)

# Making up a sensible grouping, e.g., chromosome pairs.
f <- c(1,1,1,2)
boundingBox(gi, f)

# Fails for multiple chromosomes
try(out <- boundingBox(gi))

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