assign_peak_segments: Assign whole peaks to all overlapping defined gene loci.

Description Usage Arguments Details Value Examples

View source: R/assign_peaks.R

Description

Determine all overlaps between the set of input regions peaks and the given locus definition locusdef. In addition, report where each overlap begins and ends, as well as the length of the overlap.

Usage

1
assign_peak_segments(peaks, locusdef)

Arguments

peaks

A GRanges object representing regions to be used for enrichment.

locusdef

A locus definition object from chipenrich.data.

Details

Typically, this function will not be used alone, but inside chipenrich() with method = 'broadenrich'.

Value

A data.frame with columns for peak_id, chr, peak_start, peak_end, gene_locus_start, gene_locus_end, gene_id, overlap_start, overlap_end, peak_overlap. The result is used in num_peaks_per_gene().

Examples

1
2
3
4
5
6
7
8
9
data('locusdef.hg19.nearest_tss', package = 'chipenrich.data')
data('tss.hg19', package = 'chipenrich.data')

file = system.file('extdata', 'test_assign.bed', package = 'chipenrich')
peaks = read_bed(file)

assigned_peaks = assign_peak_segments(
	peaks = peaks,
	locusdef = locusdef.hg19.nearest_tss)

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