wwhm | R Documentation |
Get the width of the window from the half-maximum of the coverage profile.
wwhm(profile, regions, ext=100, proportion=0.5, rlen=NULL)
profile |
a numeric vector containing a coverage profile, as produced by |
regions |
the |
ext |
an integer scalar specifying the average fragment length for single-end data |
proportion |
a numeric scalar specifying the proportion of the maximum coverage at which to compute the window width |
rlen |
a numeric scalar or vector containing read lengths, if any |
This function computes the ideal window size, based on the width of the peak in the coverage profile at the specified proportion
of the maximum.
Obviously, the values of regions
and ext
should be the same as those used in profileSites
(set ext
to the median fragment length for paired-end data).
The regions
should contain windows of a constant size.
Some subtleties are involved in obtaining the window width.
First, twice the average fragment length must be subtracted from the peak width, as the profile is constructed from (inferred) fragments.
The size of the viewpoints in regions
must also be subtracted, to account for the inflated peak width when spatial resolution is lost after aggregation across many windows.
An integer scalar is returned, specifying the ideal window width.
Aaron Lun
profileSites
,
getWidths
x <- dnorm(-200:200/100) # Mocking up a profile.
windows <- GRanges("chrA", IRanges(1, 50)) # Making up some windows.
wwhm(x, windows)
wwhm(x, windows, ext=50)
wwhm(x, windows, proportion=0.2)
# Need to set 'rlen' if ext=NA.
wwhm(x, windows, ext=NA, rlen=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.