bg.max: Simple function to detect and correct the background range

Description Usage Arguments Details Value Author(s) References Examples

View source: R/bg.max.R

Description

bg.max detects and corrects background noise. The detection is made without any assumptions regarding the model of this function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S4 method for signature 'numeric,numeric'
bg.max(x, y, bg.corr = 1.3, bg.start = 2, 
		  inder.approx = TRUE)

## S4 method for signature 'matrix,missing'
bg.max(x, y, bg.corr = 1.3, bg.start = 2, 
		  inder.approx = TRUE)

## S4 method for signature 'data.frame,missing'
bg.max(x, y, bg.corr = 1.3, bg.start = 2, 
		  inder.approx = TRUE)

Arguments

x

is a vector containing the time or cycle values or data frame/matrix containing cycle in the first column and fluorescence values in the second column.

y

is a vector containing the fluorescence values. Used only if x is also a vector.

bg.corr

a value which helps to tweak on the suggested background value of bg.max.

bg.start

a user defined value for the start of the background range.

inder.approx

a logical value defining if data should be numerically derived by inder function. If FALSE, derivatives are calculated by the predict.smooth.spline.

Details

Background range herein refers to a level of fluorescence measured before any specific amplification is detectable. The raw data (e.g., fluorescence intensity) measured after each step (cycle or time point) follow a non-linear progress. The background is assumed to be constant for the entire measurement. The algorithm of bg.max is based on the assumption that during the linear ground phase the signal difference of successive cycles is approximately constant. After transition to the early exponential phase the signal changes drastically. First data are smoothed by Friedman's 'super smoother' (as found in supsmu. Thereof the approximate first and second derivative are calculated by a five-point stencil inder.

The difference of cycles at the maxima of the first and second approximate derivative as well as a correction factor are used to estimate the range before the exponential phase. This function finds the background range without modeling the relationship between signal and cycle number. The start of the background range is defined be a fixed value. Since many signals tend to overshot in the first cycles a default value of 3 is chosen. bg.max tries also to estimate the end of an amplification reaction.

Value

An object of bg class containing predicted background range as well as other parameters.

Author(s)

Stefan Roediger, Michal Burdukiewicz

References

D. N. Frank. BARCRAWL and BARTAB: software tools for the design and implementation of barcoded primers for highly multiplexed DNA sequencing. BMC Bioinformatics, 10:362, 2009. ISSN 1471-2105. doi: 10.1186/1471-2105-10-362. PMID: 19874596 PMCID: PMC2777893.

S. N. Peirson, J. N. Butler, and R. G. Foster. Experimental validation of novel and conventional approaches to quantitative real-time PCR data analysis. Nucleic Acids Research, 31(14):e73, July 2003. ISSN 1362-4962. PMID: 12853650 PMCID: PMC167648.

X. Rao, D. Lai, and X. Huang. A new method for quantitative real-time polymerase chain reaction data analysis. Journal of computational biology: a journal of computational molecular cell biology, 20(9):703–711, Sept. 2013. ISSN 1557-8666. doi: 10.1089/cmb.2012.0279. PMID: 23841653 PMCID: PMC3762066.

A. Tichopad, M. Dilger, G. Schwarz, and M. W. Pfaffl. Standardized determination of real-time PCR efficiency from a single reaction set-up. Nucleic Acids Research, 31(20):e122, Oct. 2003. ISSN 1362-4962. PMID: 14530455 PMCID: PMC219490.

J. Wilhelm, A. Pingoud, and M. Hahn. Real-time PCR-based method for the estimation of genome sizes. Nucleic Acids Research, 31(10):e56, May 2003. ISSN 0305-1048. PMID: 12736322 PMCID: PMC156059.

S. Zhao and R. D. Fernald. Comprehensive algorithm for quantitative real-time polymerase chain reaction. Journal of computational biology: a journal of computational molecular cell biology, 12(8): 1047–1064, Oct. 2005. ISSN 1066-5277. doi:10.1089/cmb.2005.12.1047. PMID: 16241897 PMCID: PMC2716216.

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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# First example: Test for the background of an amplification reaction.
default.par <- par(no.readonly = TRUE)
par(mfrow = c(2,1))
res <- AmpSim(cyc = 1:40, Cq = 25)
background <- bg.max(res)
plot(background, main = "Estimation of the Background Range\n
in Absence of Noise")
res.noise <- AmpSim(cyc = 1:40, Cq = 25, noise = TRUE)
background.noise <- bg.max(res.noise)
plot(background.noise, main = "Estimation of the Background Range\n
in Presence of Noise")
par(mfrow = c(1,1))


# Second example: A simple function to test for a background range.
# Data were taken form the chipPCR C17 data set.
# Note that the not the time but the "cycle number" was
# used to calculate the background range.
data(C17)
plot(C17[, 2], C17[,  3], xlab = "Cycle", ylab = "RFU", 
     main = "Estimate the begin of the Amplification\n of a HDA", 
     pch = 20)
res <- bg.max(C17[, 2:3], bg.corr = 1.4, bg.start = 1)
abline(v = c(slot(res, "bg.start"), slot(res, "bg.stop")), 
       col = c(1,2))
abline(h = slot(res, "fluo"), col = "blue")

# Third example: Test for the background of an amplification reaction.
# Simulate amplification curves with different quantification points
# within 40 cycles.
cyc <- seq(1, 40, 1)

# Use a five parameter model to simulate amplification curves
b <- -15; c <- 0.02; d <- 1
# Define the different quantification points with a difference of
# circa 3.32 cycles
e <- seq(21, 35, 3.32)

# Plot the amplification curves and the estimated background ranges.
plot(NA, NA, xlim = c(1, 40), ylim = c(0, 1), xlab = "Cycles", 
     ylab = "Fluorescence")
     
for (i in 1:length(e)) {
  fluo <- c + (d - c)/(1 + exp(b * (log(cyc) - log(e[i]))))
  points(cyc, fluo, type = "b", col = i, pch = 20)
  res <- bg.max(cyc, fluo, bg.corr = 1.4, bg.start = 1)
  abline(v = slot(res, "bg.stop"), col = i)
  abline(h = slot(res, "fluo"), col = i)
}
par(default.par)

chipPCR documentation built on March 5, 2021, 9:06 a.m.