Description Usage Arguments Value Details for GInteractions Details for InteractionSet Author(s) See Also Examples
Methods to subset or combine InteractionSet or GInteractions objects.
1 2 3 4 5 6 7 8 9 10 11 | ## S4 method for signature 'InteractionSet,ANY,ANY'
x[i, j, ..., drop=TRUE]
## S4 replacement method for signature 'InteractionSet,ANY,ANY,InteractionSet'
x[i, j] <- value
## S4 method for signature 'InteractionSet'
subset(x, i, j)
## S4 replacement method for signature 'GInteractions,ANY,GInteractions'
x[i] <- value
|
x |
A GInteractions or InteractionSet object. |
i, j |
A vector of logical or integer subscripts.
For InteractionSet objects, these indicate the rows and columns to be subsetted for |
..., drop |
Additional arguments that are ignored. |
value |
A GInteractions or InteractionSet object with length or number of rows equal to length of |
A subsetted object of the same class as x
.
Subsetting operations are not explicitly listed above as they inherit from the Vector
class.
They will return a GInteractions object containing the specified interactions.
Values of the anchor1
and anchor2
slots will be appropriately subsetted in the returned object, along with any metadata in mcols
.
However, note that the value of regions
will not be modified by subsetting.
For short index vectors, subsetting a GInteractions object prior to calling anchors
may be much faster than the reverse procedure.
This is because the anchors
getter will construct a GRanges(List) containing the genomic loci for all pairwise interactions.
Subsetting beforehand ensures that only loci for the desired interactions are included.
This avoids constructing the entire object just to subset it later.
Subset assignment will check if the regions
are identical between x
and value
.
If not, the regions
slot in the output object will be set to a sorted union of all regions
from x
and value
.
Indices are refactored appropriately to point to the entries in the new regions
.
Subsetting behaves in much the same way as that for the SummarizedExperiment class.
Interactions are treated as rows and will be subsetted as such.
All subsetting operations will return an InteractionSet with the specified interactions (rows) or samples (columns).
Again, note that the value of regions
will not be modified by subsetting.
Aaron Lun
InteractionSet-class
GInteractions-class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | example(GInteractions, echo=FALSE)
# Subsetting:
gi[1,]
gi[1:2,]
gi[3]
gi[3:4]
temp.gi <- gi
temp.gi[3:4] <- gi[1:2]
# Splitting:
f <- sample(4, length(gi), replace=TRUE)
out <- split(gi, f)
out[[1]]
#################
# Same can be done for an InteractionSet object:
example(InteractionSet, echo=FALSE)
# Subsetting:
iset[1,]
iset[1:2,]
iset[,1]
iset[,1:2]
iset[3,3]
iset[3:4,3:4]
# Splitting:
out <- split(iset, f)
out[[1]]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.