Learn R Programming

InteractionSet (version 1.0.4)

Interaction distances: Get the linear distance for each interaction

Description

Compute the distance between interacting regions on the linear genome, for each pairwise interaction contained in a GInteractions or InteractionSet object.

Usage

"pairdist"(x, type="mid") "pairdist"(x, type="mid")
"intrachr"(x) "intrachr"(x)

Arguments

x
A GInteractions or InteractionSet object.
type
A character string specifying the type of distance to compute. Can take values of "mid", "gap", "span", "diag" or "intra".

Value

An integer or logical vector of distances.

Details

For each interaction in x, the pairdist method computes the distance between the two interacting regions. An integer vector is returned, with values computed according to the specified value of type:
"mid":
The distance between the midpoints of the two regions (rounded down to the nearest integer) is returned.

"gap":
The length of the gap between the closest points of the two regions is computed - negative lengths are returned for overlapping regions, indicating the length of the overlap.

"span":
The distance between the furthermost points of the two regions is computed.

"diag":
The difference between the anchor indices is returned. This corresponds to a diagonal on the interaction space when bins are used in the regions slot of x.

Interchromosomal interactions are marked with NA. Alternatively, if type="intra", a logical vector is returned indicating whether the interaction occurs between two regions on the same chromosome. intrachr(x) is an alias for pairdist(x, type="intra").

The return values of the assorted methods are the same for both GInteractions and InteractionSet objects. Methods for the latter operate on the GInteractions object in the interactions slot.

See Also

GInteractions-class, InteractionSet-class

Examples

Run this code
example(GInteractions, echo=FALSE)

pairdist(gi)
pairdist(gi, type="gap")
pairdist(gi, type="span")
pairdist(gi, type="diag")
intrachr(gi)

example(InteractionSet, echo=FALSE)

pairdist(iset)
pairdist(iset, type="gap")
pairdist(iset, type="span")
pairdist(iset, type="diag")
intrachr(iset)

Run the code above in your browser using DataLab