hookreg: A function to calculate the slope and intercept of an...

View source: R/hookreg.R

hookregR Documentation

A function to calculate the slope and intercept of an amplification curve data from a quantitative PCR experiment at the end of the data stream.

Description

hookreg is a function to calculate the slope and intercept of an amplification curve data from a quantitative PCR experiment. The idea is that a strong negative slope at the end of an amplification curve is indicative for a hook effect (see Barratt and Mackay 2002).

Usage

hookreg(
  x,
  y,
  normalize = TRUE,
  sig.level = 0.0025,
  CI.level = 0.9975,
  robust = FALSE
)

Arguments

x

is the cycle numbers (x-axis).

y

is the cycle dependent fluorescence amplitude (y-axis).

normalize

is a logical parameter indicating if the data should be normalized to the 0.999 quantile

sig.level

defines the significance level to test for a significant regression

CI.level

confidence level required for the slope

robust

is a logical parameter indicating if the data should be analyzed be a robust linear regression (lmrob).

Value

gives a numeric (S3 class, type of double) as output for the detection of a hook

Author(s)

Stefan Roediger, Michal Burdukiewcz

References

K. Barratt, J.F. Mackay, Improving Real-Time PCR Genotyping Assays by Asymmetric Amplification, J. Clin. Microbiol. 40 (2002) 1571–1572. doi:10.1128/JCM.40.4.1571-1572.2002.

Examples

default.par <- par(no.readonly = TRUE)
# Calculate slope and intercept on noise (negative) amplification curve data
# for the last eight cycles.

library(qpcR)

res_hook <- data.frame(sample=colnames(boggy)[-1], 
                       t(sapply(2:ncol(boggy), function(i) {
                       hookreg(x=boggy[, 1], y=boggy[, i])})))
res_hook

data_colors <- rainbow(ncol(boggy[, -1]), alpha=0.5)
cl <- kmeans(na.omit(res_hook[, 2:3]), 2)$cluster

par(mfrow=c(1,2))
matplot(x=boggy[, 1], y=boggy[, -1], xlab="Cycle", ylab="RFU",
 main="boggy Data Set", type="l", lty=1, lwd=2, col=data_colors)
 legend("topleft", as.character(res_hook$sample), pch=19,
         col=data_colors, bty="n")

plot(res_hook$intercept, res_hook$slope, pch=19, cex=2, col=data_colors,
 xlab="intercept", ylab="Slope",
 main="Clusters of Amplification Curves with an Hook Effect-like Curvature\nboggy Data Set")
 points(res_hook$intercept, res_hook$slope, col=cl, pch=cl, cex=cl)
 legend("topright", c("Strong Hook effect", " Weak Hook effect"), pch=c(1,2), col=c(1,2), bty="n")
 text(res_hook$intercept, res_hook$slope, res_hook$sample)

par(default.par)

devSJR/PCRedux documentation built on Aug. 3, 2022, 1:34 p.m.