reducePeaks: reducePeaks

Description Usage Arguments Value Examples

View source: R/local_processing.R

Description

Given a LocalPeaks object, merge peaks which are in the same sample and are separated by no more than gap base pairs. When two non-overlapping peaks are merged, a new peak is created which starts at the starting position of the first peak and ends at the ending position of the second peak, spanning the range of both peaks and the gap between them.

Usage

1
reducePeaks(localpeaks, gap)

Arguments

localpeaks

LocalPeaks object

gap

Numeric value, specifying the threshold distance for merging. Peaks in the same sample which are within this many bp of each other will be merged.

Value

The LocalPeaks object that was provided as input, with nearby peaks merged

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
samples <- c("E068", "E071", "E074", "E101", "E102", "E110")
bedfiles <- system.file("extdata", paste0(samples, ".H3K4me3.bed"),
package = "chromswitch")

metadata <- data.frame(Sample = samples,
    H3K4me3 = bedfiles,
    stringsAsFactors = FALSE)

lpk <- retrievePeaks(H3K4me3,
    metadata = metadata,
    region = GRanges(seqnames = "chr19",
    ranges = IRanges(start = 54924104, end = 54929104)))

reducePeaks(lpk, gap = 300)

chromswitch documentation built on Nov. 8, 2020, 5:24 p.m.