This function allows you to smooth wiggle data using a sliding window.
wiggle_smooth(wiggleData, chrNumber, bandwidth = 200, useKsmooth = FALSE)
Arguments
wiggleData |
Accepts input in one of the following formats:
An R list of the 16 chromosome wiggle data (output of readall_tab() ).
An element of an R list of the form described in the first item above.
Can be extracted with either '[]' or '[[]]'.
An R data frame in the same format as the individual chromosome data
frames composing the list described in the first item above.
No default. |
chrNumber |
An integer representing the chromosome to smooth. Will be ignored
in case the provided wiggleData is not a list of data for the 16 chromosomes.
No default. |
bandwidth |
An integer representing the length of the smoothing window in bp
(or the Gaussian kernel bandwith, if useKsmooth = TRUE ). Defaults to 200 . |
useKsmooth |
Boolean indicating choice of smoothing function:
useKsmooth = FALSE : use a simple sliding window smoother. Smoothing is performed by
sliding a window of the specified size (bandwidth argument) over all genomic positions in
the data and replacing the position values by the middle position and the signal values by
their mean.
useKsmooth = TRUE : use a Gaussian Kernel Regression Smoother. Smoothing is performed
using function ksmooth() from 'stats' package using the default normal kernel and the
specified bandwith.
Defaults to FALSE . |
Value
An R data frame with two columns: genome position and smoothed signal.
Examples
# NOT RUN {
wiggle_smooth(WT, 1, 200)
wiggle_smooth(rec8, 16, 100)
wiggle_smooth(WT[[5]], bandwidth = 1000)
wiggle_smooth(WT[[9]], bandwidth = 1000, useKsmooth = T)
# }