pairs | R Documentation |
Represent interactions in a GInteractions or Interaction object as a Pairs, SelfHits or GRangesList object.
## S4 method for signature 'GInteractions'
pairs(x, id=FALSE, as.grlist=FALSE)
# Equivalent call for InteractionSet to above.
makeGInteractionsFromGRangesPairs(x)
x |
For |
id |
A logical scalar specifying whether indices should be returned instead of regions. |
as.grlist |
A logical scalar specifying whether a GRangesList should be returned. |
Recall that the GInteractions object stores anchor regions for each interaction in two parallel GRanges,
where corresponding entries between the two GRanges constitute the pair of regions for one interaction.
These parallel ranges can be extracted and stored as a Pairs object for further manipulation.
This is similar to the GRangesList reported by anchors
with type="both"
and id=FALSE
.
The reverse conversion is performed using makeGInteractionsFromGRangesPairs
.
An alternative representation involves storing the two anchors for each interaction in a single GRanges of length 2.
Multiple interactions are then stored as a GRangesList, along with any metadata and sequence information.
This is returned if as.grlist=FALSE
, may be more useful in some applications where the two interacting regions must be in the same GRanges.
Finally, if id=TRUE
, the anchor indices are extracted and returned as a SelfHits object.
This may be useful for graph construction.
For pairs
, if id=TRUE
, a SelfHits object is returned.
Otherwise, if as.grlist=TRUE
, a GRangesList object is returned.
Otherwise, a Pairs object is returned.
For makeGInteractionsFromGRangesPairs
, a GInteractions object is returned.
Aaron Lun
GInteractions
,
Pairs
,
SelfHits
,
GRangesList
example(GInteractions, echo=FALSE)
y <- pairs(gi)
y
makeGInteractionsFromGRangesPairs(y)
pairs(gi, id=TRUE)
pairs(gi, as.grlist=TRUE)
example(InteractionSet, echo=FALSE)
pairs(iset)
pairs(iset, id=TRUE)
pairs(iset, as.grlist=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.