Learn R Programming

bPeaks (version 1.0)

bPeaksAnalysis: Function to run the entire bPeaks procedure

Description

This function allows to detect basic peaks (bPeaks) using the procedure described in the function peakDetection. Chromosomes are analyzed successively and several values(regarding thresholds T1, T2, T3 and T4 and other parameters) can be specified simultaneously in order to rapidly compare the obtained results and evaluate parameter relevance.

Usage

bPeaksAnalysis(IPdata, controlData, chromosomalFeatures = NULL, smoothingValue = 20,
               windowSize = 150, windowOverlap = 50, IPcoeff = 6, controlCoeff = 4,
               log2FC = 2, averageQuantiles = 0.9, resultName = "bPeaks", 
               peakDrawing = TRUE, promSize = 800)

Arguments

IPdata
A dataframe with sequencing results of the IP sample. This dataframe has three columns (chromosome, position, number of sequences) and should have been created with the dataReading function
controlData
A dataframe with sequencing results of the control sample. This dataframe has three columns (chromosome, position, number of sequences) and should have been created with the dataReading function
chromosomalFeatures
Not mandatory. A table with chromosomal features for peak location that has been created with the dataReading function
smoothingValue
The number (n/2) of surrounding positions to use for mean calculation in the dataSmoothing function
windowSize
Size of the sliding windows to scan chromosomes
windowOverlap
Size of the overlap between two successive windows
IPcoeff
Threshold T1. Value for the multiplicative parameter that will be combined with the value of the mean genome-wide read depth (see baseLineCalc). As an illustration, if the IPcoeff = 6, it means that to
controlCoeff
Threshold T2. Value for the multiplicative parameter that will be combined with the value of the mean genome-wide read depth (see baseLineCalc). As an illustration, if the controlCoeff = 2, it means th
log2FC
Threshold T3. Threshold to consider log2(IP/control) values as sufficiently important to be interesting. Note that a vector with different values can be specified, the bPeaks analysis will be therefore repeated using successively each value for peak detec
averageQuantiles
Threshold T4. Threshold to consider (log2(IP) + log2(control)) / 2 as sufficiently important to be interesting. This parameter ensures that the analyzed genomic region has enough sequencing coverage to be reliable. These threshold should be between [0, 1]
resultName
Name for output files created during bPeaks procedure
peakDrawing
TRUE or FLASE. If TRUE, the function peakDrawing is called and PDF files with graphical representations of detected peaks are created.
promSize
Size of the genomic regions to be considered as "next" (before or after) to the annotated genomic features (see documentation of the function peakLocation for more information).

Value

  • BED files for each chromosomes and a final BED file combining all the results with information regarding detected peaks (genomic positions, mean IP signal, etc.). These files are all saved in the R working directory. Summaries of parameter calculations and peak detection criteria are shown in PDF files (saved in the working directory).

Details

More information together with tutorials can be found online http://bpeaks.gene-networks.net/.

References

http://bpeaks.gene-networks.net/

See Also

peakDetection dataReading dataSmoothing baseLineCalc peakDrawing peakLocation

Examples

Run this code
# 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)

# STEP 2 : bPeaks analysis (all chromosome)
bPeaksAnalysis(IPdata = dataPDR1$IPdata, controlData = dataPDR1$controlData, 
                chromosomalFeatures = dataPDR1$chromosomalFeatures, 
                smoothingValue = c(20), 
                windowSize = c(150), windowOverlap = 50, 
                IPcoeff = c(6), controlCoeff = c(4), 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, 
                chromosomalFeatures = dataPDR1$chromosomalFeatures, 
                smoothingValue = c(10, 20), 
                windowSize = c(100, 150, 200), windowOverlap = 50, 
                IPcoeff = c(4, 6), controlCoeff = c(2, 4), log2FC = c(2, 4), 
                averageQuantiles = c(0.7, 0.9),
                resultName = "bPeaks_PDR1_chr4_paremeterEval", 
                peakDrawing = TRUE, promSize = 800)

Run the code above in your browser using DataLab