assign_peaks {chipenrich} | R Documentation |
Determine the midpoints of a set of input regions peaks
and the overlap of the midpoints with a given locus definition locusdef
. Also report the TSS that is nearest each region (peak) overlapping a defined locus and its distance.
assign_peaks(peaks, locusdef, tss, weighting = NULL)
peaks |
A |
locusdef |
A locus definition object from |
tss |
A |
weighting |
A string defining what weighting option they want. Current options are 'multiAssign', 'signalValue', and 'logSignal Value'. Default is NULL. |
Typically, this function will not be used alone, but inside chipenrich()
.
A data.frame
with columns for peak_id, chr, peak_start, peak_end, gene_locus_start, gene_locus_end, gene_id, nearest_tss, nearest_tss_gene, dist_to_tss, nearest_tss_gene_strand
. The result is used in num_peaks_per_gene()
.
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)