"boundingBox"(x, f)# Note, the same call is used for the InteractionSet method.
x, indicating the group to which each pairwise interaction belongs.
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.
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 GInteractions 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.
It is recommended to run
swapAnchors prior to computing the bounding box for intra-chromosomal groups.
anchor1 >= anchor2 or all
anchor1 <= anchor2<="" code="">, all interactions will lie on one side of the diagonal of the intra-chromosomal interaction space.
This results in the smallest possible minimum bounding box, which will only increase in size if interactions are placed on the other side of the diagonal.
Alternatively, users can specify a StrictGInteractions object as an input into
x, in which
anchor1 <= anchor2<="" code=""> is enforced automatically.=>=>
example(GInteractions, echo=FALSE) # Making up a sensible grouping. gi <- sort(gi) all.chrs <- as.character(seqnames(regions(gi))) f <- paste0(all.chrs[anchors(gi, type="first", id=TRUE)], ".", all.chrs[anchors(gi, type="second", id=TRUE)]) boundingBox(gi, f) boundingBox(swapAnchors(gi), f) # Fails for multiple chromosomes try(out <- boundingBox(gi)) in.A <- f=="chrA.chrA" out <- boundingBox(gi[in.A])