# get library
library(bPeaks)
# STEP 1: get PDR1 data
data(dataPDR1)
# STEP 2 : bPeaks analysis (only 10 kb of chrIV are analyzed here, 
#          as an illustration)
bPeaksAnalysis(IPdata = dataPDR1$IPdata[40000:50000,], 
               controlData = dataPDR1$controlData[40000:50000,], 
               windowSize = 150, windowOverlap = 50, 
               IPcoeff = 4, controlCoeff = 2, log2FC = 1, 
               averageQuantiles = 0.5,
               resultName = "bPeaks_example", 
               peakDrawing = TRUE, promSize = 800)
## Not run: 
# # STEP 2 : bPeaks analysis (all chromosome)
# bPeaksAnalysis(IPdata = dataPDR1$IPdata, controlData = dataPDR1$controlData, 
#                 cdsPositions = dataPDR1$cdsPositions, 
#                 smoothingValue = c(20), 
#                 windowSize = c(150), windowOverlap = 50, 
#                 IPcoeff = c(2), controlCoeff = c(2), log2FC = c(2), 
#                 averageQuantiles = c(0.9),
#                 resultName = "bPeaks_PDR1_chr4", 
#                 peakDrawing = TRUE, promSize = 800)
# 
# # To repeat the bPeaks analysis with different parameters
# bPeaksAnalysis(IPdata = dataPDR1$IPdata, controlData = dataPDR1$controlData, 
#                 cdsPositions = dataPDR1$cdsPositions, 
#                 smoothingValue = c(20), 
#                 windowSize = c(150), windowOverlap = 50, 
#                 IPcoeff = c(2, 4, 6), controlCoeff = c(2, 4, 6), log2FC = c(2, 3), 
#                 averageQuantiles = c(0.7, 0.9),
#                 resultName = "bPeaks_PDR1_chr4_paremeterEval", 
#                 peakDrawing = FALSE, promSize = 800)
# 
# # -> Summary table is created and saved as "peakStats.Robject" in the working directory
# # as well as a text file named "_bPeaks_parameterSummary.txt"...
# load("peakStats.Robject")
# # This table comprises different information regarding peak detection (number of peaks,
# # mean size of peaks, mean IP signal, mean control signal, etc.)
# peakStats[1:2,]
# 
# #     smoothingValue windowSize windowOverlap IPcoeff controlCoeff log2FC
# # [1,]             20        150            50       1            1      1
# # [2,]             20        150            50       1            1      1
# #     averageQuantiles bPeakNumber meanSize meanIPsignal meanControlSignal
# # [1,]              0.5         308  209.091      276.047            71.534
# # [2,]              0.7         294  205.782      287.808            74.002
# #     meanLog2FC bPeakNumber_beforeFeatures bPeakNumber_afterFeatures
# # [1,]      1.571                         99                        80
# # [2,]      1.589                         94                        77
# #     bPeakNumber_inFeatures
# # [1,]                     52
# # [2,]                     53
# 
# ## End(Not run)
Run the code above in your browser using DataLab