dataSmoothing: Function to smooth sequencing coverage along a chromosome

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/dataSmoothing.R

Description

This function allows to obtain a smoothed signal of the genome-wide read depth. Simple moving average (SMA) procedure is used. At each genomic position, the sequencing coverage is replaced by the unweighted mean of the n surrounding positions (n/2 before and n/2 after).

Usage

1
dataSmoothing(vecData, widthValue = 20)

Arguments

vecData

A vector with the numbers of sequences aligned at each genomic position to be considered in the analysis

widthValue

The number (n/2) of surrounding positions to use for mean calculation

Details

Detailed information and tutorials can be found online http://bpeaks.gene-networks.net/.

Value

A vector with the smoothed signal. Note that the SMA procedure creates missing values at the beginning and at the end of the vector with the smoothed signal.

Note

Detailed information and tutorials can be found online http://bpeaks.gene-networks.net/.

Author(s)

Gaelle LELANDAIS

References

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

See Also

bPeaksAnalysis baseLineCalc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# get data
data(dataPDR1)

# inital IP signal
iniIPsignal = dataPDR1$IPdata[,3]

par(mfrow = c(2,2))

# plot initial IP signal
plot(iniIPsignal[416900:417400], type = "h", 
    xlab = "genomic position", ylab = "sequencing coverage",
    main = "IP sample (PDR1 data)\nno smoothing", 
    col = "red")

# calculate and plot smoothed signal (widthValue = 5)
smoothedIPsignal = dataSmoothing(vecData = iniIPsignal, widthValue = 5)
plot(smoothedIPsignal[416900:417400], type = "h", 
    xlab = "genomic position", ylab = "sequencing coverage",
    main = "IP sample (PDR1 data)\nsmoothing (widthValue = 5)", 
    col = "pink")

# calculate and plot smoothed signal (widthValue = 10)
smoothedIPsignal = dataSmoothing(vecData = iniIPsignal, widthValue = 10)
plot(smoothedIPsignal[416900:417400], type = "h", 
    xlab = "genomic position", ylab = "sequencing coverage",
    main = "IP sample (PDR1 data)\nsmoothing (widthValue = 10)", 
    col = "pink")

# calculate and plot smoothed signal (widthValue = 20)
smoothedIPsignal = dataSmoothing(vecData = iniIPsignal, widthValue = 20)
plot(smoothedIPsignal[416900:417400], type = "h", 
    xlab = "genomic position", ylab = "sequencing coverage",
    main = "IP sample (PDR1 data)\nsmoothing (widthValue = 20)", 
    col = "pink")

Example output



bPeaks documentation built on May 1, 2019, 10:14 p.m.