maximizeCcf: Find the delay at the maximal CCF

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/maximizeCcf.R

Description

Estimate the average fragment length by maximizing the cross-correlations.

Usage

1
maximizeCcf(profile, ignore=100)

Arguments

profile

a numeric vector containing a coverage profile, as produced by correlateReads

ignore

an integer scalar specifying the distances to ignore

Details

This function identifies the delay distance at which the cross-correlations are maximized. This distance can then be used as an estimate of the average fragment length, for use in directional extension during read counting.

In some datasets, identification of the maxima is confounded by a phantom peak at the read length. This can be overcome by ignoring the first ignore delay distances, such that the distance corresponding to the true peak is used.

Obviously, this only works in TF experiments with moderate to strong enrichment, where a strong peak in the CCF profile is present. The function may not perform sensibly in the presence of noisy profiles containing multiple local maxima.

Value

The average fragment length is returned as an integer scalar.

Author(s)

Aaron Lun

References

Landt SG, Marinov GK, Kundaje A, et al. (2012). ChIP-seq guidelines and practices of the ENCODE and modENCODE consortia. Genome Res. 22, 1813-31.

See Also

correlateReads

Examples

1
2
3
4
5
6
x <- dnorm(-200:200/100) # Mocking up a profile.
maximizeCcf(x)

x2 <- x + dnorm(-50:250/10) # Adding a phantom peak
maximizeCcf(x2)
maximizeCcf(x2, ignore=0)

csaw documentation built on Nov. 12, 2020, 2:03 a.m.