View source: R/roi_functions.R
subsetRegionsBySignal | R Documentation |
A convenience function to subset regions of interest by the amount of signal they contain, according to their quantile (i.e. their signal ranks).
subsetRegionsBySignal(
regions.gr,
dataset.gr,
quantiles = c(0.5, 1),
field = "score",
order.by.rank = FALSE,
density = FALSE,
keep.signal = FALSE,
expand_ranges = FALSE
)
regions.gr |
A GRanges object containing regions of interest. |
dataset.gr |
A GRanges object in which signal is contained in metadata (typically in the "score" field). |
quantiles |
A value pair giving the lower quantile and upper quantile of
regions to keep. Regions with signal quantiles below the lower quantile are
removed, and likewise for regions with signal quantiles above the upper
quantile. Quantiles must be in range |
field |
The metadata field of |
order.by.rank |
If |
density |
A logical indicating whether signal counts should be
normalized to the width (chromosomal length) of ranges in
|
keep.signal |
Logical indicating if signal counts should be kept. If set
to |
expand_ranges |
Logical indicating if ranges in |
A GRanges object of length length(regions.gr) * (upper_quantile
- lower_quantile)
.
Mike DeBerardine
getCountsByRegions
data("PROseq") # load included PROseq data
data("txs_dm6_chr4") # load included transcripts
txs_dm6_chr4
#--------------------------------------------------#
# get the top 50% of transcripts by signal
#--------------------------------------------------#
subsetRegionsBySignal(txs_dm6_chr4, PROseq)
#--------------------------------------------------#
# get the middle 50% of transcripts by signal
#--------------------------------------------------#
subsetRegionsBySignal(txs_dm6_chr4, PROseq, quantiles = c(0.25, 0.75))
#--------------------------------------------------#
# get the top 10% of transcripts by signal, and sort them by highest signal
#--------------------------------------------------#
subsetRegionsBySignal(txs_dm6_chr4, PROseq, quantiles = c(0.9, 1),
order.by.rank = TRUE)
#--------------------------------------------------#
# remove the most extreme 10% of regions, and keep scores
#--------------------------------------------------#
subsetRegionsBySignal(txs_dm6_chr4, PROseq, quantiles = c(0.05, 0.95),
keep.signal = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.