calc_peak_gene_overlap {chipenrich} | R Documentation |
num_peaks_per_gene()
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.
calc_peak_gene_overlap(assigned_peaks, ppg)
assigned_peaks |
A |
ppg |
The aggregated peak assignments over |
Typically, this function will not be used alone, but inside chipenrich()
with method = 'broadenrich'
.
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'
.
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)