| gr.val | R Documentation |
GRanges with values from another GRangesAnnotates GRanges in query with aggregated values of GRanges in target in field val.
If val is numeric: given target with value column target representing ranged data
(i.e. segment intensities), thn computes the value
in each query GRanges as the weighted mean of its intersection with target
(ie the target values weighted by the width of the intersections).
Applications include (among others):
Querying the average value of target across a given query interval (e.g. exon to gene pileup)
recasting a high res tiling in terms of low res intervals.
Usually query intervals are bigger than the target intervals.
gr.val(
query,
target,
val = NULL,
mean = TRUE,
weighted = mean,
na.rm = FALSE,
by = NULL,
by.prefix = val,
merge = FALSE,
FUN = NULL,
default.val = NA,
max.slice = Inf,
mc.cores = 1,
sep = ", ",
verbose = FALSE,
...
)
query |
|
target |
|
val |
If a character field: then aggregation will paste together the (unique), overlapping values, collapsing by comma. (default = NULL) |
mean |
boolean If |
weighted |
Calculate a weighted mean. If |
na.rm |
boolean Remove NA values when calulating means. only applies if val column of target is numeric (default = FALSE) |
by |
scalar character, specifies additional "by" column of query AND target that will be used to match up query and target pairs (i.e. in addition to pure GRanges overlap). (default = NULL) |
by.prefix |
Choose a set of |
merge |
boolean If merge = FALSE then will cross every range in query with every level of "by" in target (and create data matrix), otherwise will assume query has "by" and merge only ranges that have matching "by" values in both query and target (default = FALSE) |
FUN |
Optional different function to call than mean. Takes two arguments (value, na.rm = TRUE) if weighted = FALSE, and three (value, width, na.rm = TRUE) if weighted = TRUE. (default = NULL) |
default.val |
If no hit in |
max.slice |
integer Maximum number of query ranges to consider in one memory chunk. (default = Inf) |
mc.cores |
integer Number of cores to use when running in chunked mode (default = 1) |
sep |
string Specifies character to use as separator when aggregating character "vals" from target, only applies if target is character (default = ', ') |
verbose |
boolean Increase the verbosity of the output (default = FALSE) |
... |
Additional arguments to be sent to |
query with the val field populated
query and target can be GRangesList object, in which case val will refer to GRangesList level values fields
Marcin Imielinski
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.