motif_peaks {universalmotif} | R Documentation |
Using the motif position data from scan_sequences()
(or elsewhere),
test whether certain positions in the sequences have significantly higher
motif density.
motif_peaks(hits, seq.length, seq.count, bandwidth, max.p = 10^-6, peak.width = 3, nrand = 1000, plot = TRUE, BP = FALSE)
hits |
|
seq.length |
|
seq.count |
|
bandwidth |
|
max.p |
|
peak.width |
|
nrand |
|
plot |
|
BP |
|
Kernel smoothing is used to calculate motif position density. The implementation for this process is based on code from the KernSmooth R package. These density estimates are used to determine peak locations and heights. To calculate the P-values of these peaks, a null distribution is calculated from peak heights of randomly generated motif positions.
If the bandwidth
option is not supplied, then the following code is used
(from KernSmooth):
del0 <- (1 / (4 * pi))^(1 / 10)
bandwidth <- del0 * (243 / (35 * length(hits)))^(1 / 5) * sqrt(var(hits))
A data.frame
with peak positions and P-values. If plot = TRUE
,
then a list is returned with the data.frame
as the first item and
the ggplot2
object as the second item.
Benjamin Jean-Marie Tremblay, b2tremblay@uwaterloo.ca
data(ArabidopsisMotif) data(ArabidopsisPromoters) hits <- scan_sequences(ArabidopsisMotif, ArabidopsisPromoters, RC = FALSE, verbose = 0, progress = FALSE) res <- motif_peaks(hits$start, 1000, 50) # View plot: res$Plot # The raw plot data can be found in: res$Plot$data