calc_peak_gene_overlap: Add peak overlap and ratio to result of...

Description Usage Arguments Details Value Examples

View source: R/peaks_per_gene.R

Description

In particular, for method = 'broadenrich' in chipenrich(), when using assign_peak_segments(). This function will add aggregated peak_overlap (in base pairs) and ratio (relative to length) columns to the result of num_peaks_per_gene() so the right data is present for the method = 'broadenrich' model.

Usage

1
calc_peak_gene_overlap(assigned_peaks, ppg)

Arguments

assigned_peaks

A data.frame resulting from assign_peak_segments().

ppg

The aggregated peak assignments over gene_id from num_peaks_per_gene().

Details

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

Value

A data.frame with columns gene_id, length, log10_length, num_peaks, peak, peak_overlap, ratio. The result is used directly in the gene set enrichment tests in chipenrich() when method = 'broadenrich'.

Examples

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

ppg = num_peaks_per_gene(
	assigned_peaks = assigned_peaks,
	locusdef = locusdef.hg19.nearest_tss,
	mappa = NULL)

ppg = calc_peak_gene_overlap(
	assigned_peaks = assigned_peaks,
	ppg = ppg)

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