Learn R Programming

diffHic (version 1.4.2)

filterPeaks: Filter bin pairs for likely peaks

Description

Identify bin pairs that are likely to represent punctate peaks in the interaction space.

Usage

filterPeaks(data, enrichment, min.enrich=log2(1.5), min.count=5, min.diag=2L, ...)

Arguments

data
an InteractionSet object produced by squareCounts or neighborCounts
enrichment
a numeric vector of enrichment values, produced by enrichedPairs or neighborCounts
min.enrich
a numeric scalar indicating the minimum enrichment score for a peak
min.count
a numeric scalar indicating the minimum average count for a peak
min.diag
an integer scalar specifying the minimum diagonal in the interaction space with which to consider a peak
...
other arguments to be passed to aveLogCPM for the average count filter

Value

A logical vector indicating whether or not each bin pair is to be considered as a peak.

Details

Filtering on the local enrichment scores identifies high-intensity islands in the interaction space. However, this alone is not sufficient to identify sensible peaks. Filtering on the absolute average counts prevents the calling of low-abundance bin pairs with high enrichment scores due to empty neighborhoods. Filtering on the diagonals prevents calling of high-abundance short-range interactions that are usually uninteresting. If either min.count or min.diag are NULL, no filtering will be performed on the average counts and diagonals, respectively.

See Also

squareCounts, enrichedPairs, neighborCounts

Examples

Run this code
# Setting up the object.
a <- 10
b <- 20
regions <- GRanges(rep(c("chrA", "chrB"), c(a, b)), IRanges(c(1:a, 1:b), c(1:a, 1:b)))

set.seed(23943)
all.anchor1 <- sample(length(regions), 50, replace=TRUE)
all.anchor2 <- as.integer(runif(50, 1, all.anchor1+1))
data <- InteractionSet(matrix(rnbinom(200, mu=10, size=10), 50, 4), 
    GInteractions(anchor1=all.anchor1, anchor2=all.anchor2, regions=regions, mode="reverse"), 
    colData=DataFrame(totals=runif(4, 1e6, 2e6)), metadata=List(width=1))

# Getting peaks.
enrichment <- enrichedPairs(data)
summary(filterPeaks(data, enrichment, min.enrich=0.5))
summary(filterPeaks(data, enrichment, min.enrich=0.5, min.count=10))
summary(filterPeaks(data, enrichment, min.enrich=0.5, min.diag=NULL))

Run the code above in your browser using DataLab