assign_peaks: Assign peak midpoints to defined gene loci.

Description Usage Arguments Details Value Examples

View source: R/assign_peaks.R

Description

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.

Usage

1
assign_peaks(peaks, locusdef, tss, weighting = NULL)

Arguments

peaks

A GRanges object representing regions to be used for enrichment.

locusdef

A locus definition object from chipenrich.data.

tss

A GRanges object representing the TSSs for the genome build. Includes mcols for Entrez Gene ID gene_id and gene symbol symbol.

weighting

A string defining what weighting option they want. Current options are 'multiAssign', 'signalValue', and 'logSignal Value'. Default is NULL.

Details

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

Value

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().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

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