Result wrappers | R Documentation |
Convenience wrappers around lower-level functions to easily obtain region-level results from window statistics.
mergeResults(ranges, tab=mcols(ranges), tol, get.best=TRUE,
merge.args=list(), combine.args=list(), best.args=list())
overlapResults(ranges, tab=mcols(ranges), regions, get.best=TRUE,
overlap.args=list(), combine.args=list(), best.args=list())
ranges |
A GRanges or RangedSummarizedExperiment containing genomic intervals, usually for windows. |
tab |
A data.frame of differential binding results with one row per interval in |
tol |
A numeric scalar to be passed to |
get.best |
A logical scalar indicating whether |
regions |
A GRanges class containing reference regions to overlap with the windows. |
merge.args |
Further arguments to pass to |
overlap.args |
Further arguments to pass to |
combine.args |
Further arguments to pass to |
best.args |
Further arguments to pass to |
mergeResults
simply calls mergeWindows
to identify clusters of windows corresponding to regions.
These clusters are used in combineTests
and (optionally) getBestTest
to obtain per-region statistics.
overlapResults
simply calls findOverlaps
to identify all windows overlapping each reference region.
These overlaps are used in combineOverlaps
and (optionally) getBestOverlaps
,
where each set of overlapping windows for a reference region are used to define the latter's statistics.
These wrapper functions are simply for convenience. No other work is performed and so users are free to call the individual functions separately.
mergeResults
will return a DataFrame containing
regions
, the GRanges generated by clustering windows into regions;
combined
, the DataFrame containing combined statistics for each clustered region;
and best
, the DataFrame containing statistics for the best window in each clustered region.
The metadata contains ids
, an integer vector of cluster IDs for ranges
from mergeWindows
.
overlapResults
will return a DataFrame containing
regions
, the same as the input GRanges of the same name;
combined
, the DataFrame containing combined statistics for each reference region;
and best
, the DataFrame containing statistics for the best window in each reference region.
The metadata contains overlaps
, a Hits object specifying the overlaps from findOverlaps
.
Aaron Lun
mergeWindows
, combineTests
and getBestTest
,
for the functions that actually do the work in mergeResults
.
findOverlaps
, combineOverlaps
and getBestOverlaps
,
for the functions that actually do the work in overlapResults
.
# Making up some data.
tab <- data.frame(logFC=rnorm(20), logCPM=rnorm(20), PValue=rbeta(20, 1, 2))
gr <- GRanges("chrA", IRanges(sample(1000, 20), width=40))
# Merging windows.
(merge.out <- mergeResults(gr, tab, tol=1))
merge.out$merged
merge.out$combined
# Overlapping windows with a reference region.
regions <- GRanges("chrA", IRanges(c(10, 500, 900), width=20))
(olap.out <- overlapResults(gr, tab, regions=regions))
olap.out$regions
olap.out$combined
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.