getAnnotations

getAnnotations(annotations, ...)

# S4 method for GRangesList
getAnnotations(annotations, rowRanges, ...)

# S4 method for MatrixOrmatrix
getAnnotations(annotations, ...)

# S4 method for data.frame
getAnnotations(annotations, ...)

# S4 method for list
getAnnotations(annotations, npeaks = NULL, ...)

# S4 method for character
getAnnotations(annotations, rowRanges, column = NULL,
  ...)

Arguments

annotations

matrix, Matrix, or data.frame of fragment counts, or SummarizedExperiment with counts assays, see details

...

additional arguments to pass to SummarizedExperiment

rowRanges

GenomicRanges or GenomicRangesList or RangedSummarizedExperiment

npeaks

number of peaks

column

column of bed file with annotation names, see details

Value

SummarizedExperiment object with 'matches' assay

Methods (by class)

  • GRangesList: get annotation matrix from GRangesList

  • MatrixOrmatrix: get annotation matrix from Matrix or matrix

  • data.frame: get annotation matrix from data.frame

  • list: get annotation matrix from list

  • character: get annotations from bed files

Examples

# NOT RUN {
# First get example counts
data(mini_counts, package = "chromVAR")

# Get annotations from genomic ranges list
library(GenomicRanges)
library(SummarizedExperiment)
my_annotation_granges <- GRangesList(GRanges("chr1",
                                             ranges = IRanges(start =
                                             c(566763,805090), width = 8)),
                                     GRanges("chr1", ranges = IRanges(start =
                                               c(566792,895798), width = 8)))
anno_ix <- getAnnotations(my_annotation_granges,
                           rowRanges = rowRanges(mini_counts))
# }