num_peaks_per_gene: Aggregate peak assignments over the 'gene_id' column

Description Usage Arguments Details Value Examples

View source: R/peaks_per_gene.R

Description

For each gene_id, determine the locus length and the number of peaks.

Usage

1
num_peaks_per_gene(assigned_peaks, locusdef, mappa = NULL)

Arguments

assigned_peaks

A data.frame resulting from assign_peaks() or assign_peak_segments().

locusdef

A locus definition object from chipenrich.data.

mappa

A mappability object from chipenrich.data.

Details

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

Value

A data.frame with columns gene_id, length, log10_length, num_peaks, peak. The result is used directly in the gene set enrichment tests in chipenrich().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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_peaks(
	peaks = peaks,
	locusdef = locusdef.hg19.nearest_tss,
	tss = tss.hg19)

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

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