#Generate a random peaks profile
reads = syntheticNucMap(nuc.len=40, lin.len=130)$syn.reads
cover = coverage(reads)
#Filter them
cover_fft = filterFFT(cover)
#Detect and plot peaks (up a bit the threshold for accounting synthetic data)
peaks = peakDetection(cover_fft, threshold="40%", score=TRUE)
plotPeaks(peaks, cover_fft, threshold="40%", start=10000, end=15000)
#Now use ranges version, which accounts for fuzziness when scoring
peaks = peakDetection(cover_fft, threshold="40%", score=TRUE, width=147)
plotPeaks(peaks, cover_fft, threshold="40%", start=10000, end=15000)
Run the code above in your browser using DataLab