| MatchedGRanges-class {nullranges} | R Documentation |
The MatchedGRanges class is a subclass of both
Matched and GRanges. Therefore, it contains slots
and methods for both of these classes.
The MatchedGRanges class uses a delegate object
during initialization to assign its GRanges slots.
MatchedGRanges behaves as a GRanges but also
includes additional Matched object functionality
(see ?Matched). For more information about
GRanges see ?GenomicRanges::GRanges.
focalA GRanges object containing the focal
data to match.
poolA GRanges object containing the pool
from which to select matches.
delegateA GRanges object used to initialize
GRanges-specific slots. matchRanges() assigns
the matched set to the slot.
matchedDataA data.table with matched data
matchedIndexAn integer vector corresponding
to the indices in the pool which comprise the
matched set.
covarA character vector describing the covariates used for matching.
methodCharacter describing replacement method used for matching.
replaceTRUE/FALSE describing if matching was done with or without replacement.
seqnamesseqnames(delegate)
rangesranges(delegate)
strandstrand(delegate)
seqinfoseqinfo(delegate)
elementMetadataelementMetadata(delegate)
elementTypeelementType(delegate)
metadatametadata(delegate)
Functions that get data from Matched subclasses (x)
such as MatchedDataFrame, MatchedGRanges,
and MatchedGInteractions are listed below:
matchedData(x): Get matched data from a Matched object
covariates(x): Get covariates from a Matched object
method(x): Get matching method used for Matched object
withReplacement(x): Get replace method
indices(x, set): Get indices of matched set
For more detail check the help pages for these functions.
Additional functions that get data from Matched subclasses
(x) such as MatchedDataFrame, MatchedGRanges,
and MatchedGInteractions include:
focal(x): Get focal set from a Matched object
pool(x): Get pool set from a Matched object
matched(x): Get matched set from a Matched object
unmatched(x): Get unmatched set from a Matched object
For more detail check the help pages for these functions.
matchedData, covariates, method, withReplacement, indices
focal, pool, matched, unmatched
## Contructing MatchedGRanges with matchRanges set.seed(123) gr <- makeExampleMatchedDataSet(type = "GRanges") mgr <- matchRanges( focal = gr[gr$feature1, ], pool = gr[!gr$feature1, ], covar = ~ feature2 + feature3, method = "rejection", replace = FALSE ) class(mgr) ## Make MatchedGRanges example set.seed(123) x <- makeExampleMatchedDataSet(type = "GRanges", matched = TRUE) ## Accessor functions for Matched class matchedData(x) covariates(x) method(x) withReplacement(x) head(indices(x, set = 'matched')) ## Accessor functions for Matched subclasses focal(x) pool(x) matched(x) unmatched(x)