load_peaks: Convert a BEDX+Y data.frame and into GRanges

Description Usage Arguments Details Value Examples

View source: R/read.R

Description

Given a data.frame in BEDX+Y format, use the built-in function GenomicRanges::makeGRangesFromDataFrame() to convert to GRanges.

Usage

1
load_peaks(dframe, keep.extra.columns = TRUE)

Arguments

dframe

A BEDX+Y style data.frame. See GenomicRanges::makeGRangesFromDataFrame for acceptable column names for appropriate conversion to GRanges.

keep.extra.columns

Keep extra columns parameter from GenomicRanges::makeGRangesFromDataFrame().

Details

Typically, this function will not be used alone, but inside chipenrich().

Value

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# 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)

chipenrich documentation built on Nov. 8, 2020, 8:11 p.m.