num_peaks_per_gene {chipenrich}R Documentation

Aggregate peak assignments over the gene_id column

Description

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

Usage

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


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)


[Package chipenrich version 2.14.0 Index]