| load_peaks {chipenrich} | R Documentation |
Given a data.frame in BEDX+Y format, use the built-in function
GenomicRanges::makeGRangesFromDataFrame() to convert to GRanges.
load_peaks(dframe, keep.extra.columns = TRUE)
dframe |
A BEDX+Y style |
keep.extra.columns |
Keep extra columns parameter from |
Typically, this function will not be used alone, but inside chipenrich().
A GRanges that may or may not keep.extra.columns, and
that may or may not be stranded, depending on whether there is strand column
in the dframe.
# Example with just chr, start, end
peaks_df = data.frame(
chr = c('chr1','chr2','chr3'),
start = c(35,74,235),
end = c(46,83,421),
stringsAsFactors = FALSE)
peaks = load_peaks(peaks_df)
# Example with extra columns
peaks_df = data.frame(
chr = c('chr1','chr2','chr3'),
start = c(35,74,235),
end = c(46,83,421),
strand = c('+','-','+'),
score = c(36, 747, 13),
stringsAsFactors = FALSE)
peaks = load_peaks(peaks_df, keep.extra.columns = TRUE)