Read in peaks from a bed file.

getPeaks(filename, extra_cols = c(), sort_peaks = FALSE)

Arguments

filename

filename of bed file

extra_cols

extra columns to read in beyond first three

sort_peaks

sort the peaks?

Value

GenomicRanges containing peaks from file

Details

As in standard definition of bed file, first column is assumed to be chromosome, second is assumed to be start of peak (0-based), and third is assumed to be end of peak (1-based). Note that in output GenomicRanges output, start and end indices are both 1-based. Extra columns can be added as metadata or strand information if provided, but the user must indicate column index and name using named vector for extra_cols.

See also

getCounts, filterPeaks, readNarrowpeaks

Examples

# NOT RUN {
peaks_file <- system.file("extdata", "test_bed.txt", package = "chromVAR")
peaks <- getPeaks(peaks_file, sort = TRUE)
# }