conversion: Converting to/from pairs

Description Usage Arguments Details Value Author(s) Examples

Description

Convert a GenomicInteractions object to a Pairs object, or vice versa.

Usage

1

Arguments

x

A Pairs object with two GRanges and/or GRangesFactor entries.

Details

An automated coercion from a Pairs object to a GenomicInteractions object is not possible, as the former may not contain two GRangesFactor objects (in which case no standard conversion exists). Hence the need for the more wordy function to be explicit about the expected inputs.

Value

An object of the converted type.

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))
test <- GenomicInteractions(anchor1, anchor2)

p <- as(test, "Pairs")
makeGInteractionsFromGRangesPairs(p)

# Also works with two GRanges.
alt <- Pairs(unfactor(first(p)), unfactor(second(p)))
makeGInteractionsFromGRangesPairs(alt)

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