Description Usage Arguments Details Value Author(s) Examples
Convert a GenomicInteractions object to a Pairs object, or vice versa.
1 |
x |
A Pairs object with two GRanges and/or GRangesFactor entries. |
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.
An object of the converted type.
Aaron Lun
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.