grlToSE-methods: Set columns from a GRangesList as Assays in a...

grlToSER Documentation

Set columns from a GRangesList as Assays in a SummarizedExperiment

Description

Move one or more columns from a GRangesList elements into assays in a RangesSummarizedEperiment

Usage

grlToSE(x, ...)

## S4 method for signature 'GRangesList'
grlToSE(
  x,
  assayCols = c(),
  metaCols = c(),
  keyvals = c(),
  by = c("min", "max"),
  ...,
  ignore.strand = FALSE
)

Arguments

x

A GrangesList

...

Passed to reduce

assayCols

Columns to move to separate assays

metaCols

Columns to move to mcols within the rowRanges element

keyvals

The value to use when choosing representative values

by

How to choose by keyvals

ignore.strand

logical(1). Whether the strand of the input ranges should be ignored or not.

Details

Given a GRangesList which would commonly represent multiple samples, reduce any overlapping ranges into a consensus range, setting any metadata columns to be retained as separate assays. These columns may contain values such as coverage, p-values etc.

Additional columns can also be placed as rowData columns where the original values are better suited to information about the consensus range rather than the sample (or GRangesList element).

Only one value for each range will be retained, and these are chosen using the value provided as the keyvals, taking either the min or max value in this column as the representative range.

Value

A RangedSummarizedExperiment

Examples

a <- GRanges("chr1:1-10")
a$feature <- "Gene"
a$p <- 0.1
b <- GRanges(c("chr1:6-15", "chr1:15"))
b$feature <- c("Gene", "Promoter")
b$p <- c(0.5, 0.01)
grl <- GRangesList(a = a, b = b)
grl
se <- grlToSE(
  grl, assayCols = "p", metaCols = "feature", keyvals = "p", by = "min"
)
assay(se, "p")
rowRanges(se)


steveped/extraChIPs documentation built on Aug. 1, 2024, 12:36 a.m.