Given a set of peaks (GRanges object) and a vector of one or more file paths of .bed files with some score, import these and summarize using a FUN over them. Also can specify which column the score should be read from in the file and the default value per peak if nothing is determined.
importBedScore(ranges, files, colidx = 5, FUN = sum, default.val = 0) # S4 method for GRanges,character importBedScore(ranges, files, colidx = 5, FUN = sum, default.val = 0)
ranges | A GRanges object corresponding to the peaks used to aggregrate a score over |
---|---|
files | A character vector of files that will be imported and digested for analysis |
colidx | The column index of the score. This assumes that the first three columns specific genomic coordinates. Default is 5 for the fifth column in the .bed files |
FUN | Function to summarize multiple hits in the .bed file over the peak. |
default.val | Default value to populate the matrices ahead of time. By default, 0. |
ranges = GRanges,files = character
:
files <- list.files(system.file('extdata',package='gchromVAR'), pattern = "*.bed$", full.names = TRUE) data(mini_counts, package = "chromVAR") w_se <- importBedScore(SummarizedExperiment::rowRanges(mini_counts), files)