Learn R Programming

qpcR (version 1.3-7.1)

calib: Calculation of qPCR efficiency by dilution curve analysis

Description

This function calculates the PCR efficiency from a classical qPCR dilution experiment. The threshold cycles are plotted against the logarithmized concentration (or dilution) values, a linear regression line is fit and the efficiency calculated by $E = 10^{\frac{-1}{slope}}$. A graph is displayed with the raw values plotted with the threshold cycle and the linear regression curve. The threshold cycles are calculated either by some arbitrary fluorescence value (i.e. as given by the qPCR software) or calculated from the second derivative maximum of the first (highest concentration) curve. If values to be predicted are given, they are calculated from the curve and also displayed within. An iterative search of the optimal threshold border can be conducted, thereby going through all slopes and intercepts and selecting the combination that minimizes the AIC of the acquired linear regression curves. See 'Details' for more information on this (maybe controversial) procedure.

Usage

calib(refcurve, predcurve = NULL, thresh = "cpD2", term = NULL, 
      dil = NULL, plot = TRUE, plot.map = TRUE,
      conf = 0.95, opt = c("none", "inter", "slope"),       
      opt.step = c(50, 50), stop.crit = c("outlier", "midpoint"), 
      quan = 0.5, slope = NULL, count = 1)

Arguments

refcurve
a 'modlist' containing the curves for calibration.
predcurve
an (optional) 'modlist' containing the curves for prediction.
thresh
the fluorescence value from which the threshold cycles are defined. Either "cpD2" or a numeric value.
term
an (optional) numeric value for the terminating intercept. See 'Details'.
dil
a vector with the concentration (or dilution) values corresponding to the calibration curves.
plot
logical. Should the optimization process be displayed? If FALSE, only values are returned.
plot.map
logical. Should a final heatmap display from the goodness-of-fit of all iterations be displayed?
conf
the confidence interval. Defaults to 95%, can be omitted with NULL.
opt
type of optimization. See 'Details'.
opt.step
a two-element vector. Number of iterations for the intercept as first item, number of slope iterations as second.
stop.crit
the stopping criterium for the iterations. Default is the first outlier cycle of the highest dilution curve.
quan
the top quantile of iterations to be shown in the heatmap.
slope
a slope to be defined for the threshold line. Mostly used internally by the iteration process.
count
internal counter for recursive purposes. Not to be altered.

Value

  • A list with the following components:
  • refcycthe calculated threshold cycles for the calibration curves.
  • refcyc.confthe confidence intervals for refcyc.
  • predcycthe calculated threshold cycles for the prediction curves.
  • predconcthe predicted concentrations.
  • predconc.confthe confidence intervals for predconc.
  • effthe efficiency as calculated from the calibration curve.
  • aicthe AIC value of the linear fit.
  • aiccthe corrected AIC value of the linear fit.
  • rsqThe $R^2$ of the linear fit.
  • rsq.adThe adjusted $R^2_{adj}$ of the linear fit.
  • aicMata matrix with the calibration curve AIC of each iteration.
  • ATTENTION: If iterations were used, the values reflect the analysis of the best fit!

Details

The iterative function conducts a search through all combinations of slope and intercept. For each iteration, either $R^2$ or AIC of the resulting calibration curves are collected, and finally the combination is selected that minimized the AIC. The function goes through all combinations as to avoid local maxima that are likely to happen in this approach. The different settings for opt are: "none" only second derivative maximum or single threshold value. "inter" iterate along the y-axis intercept. "slope" iterate along y-axis intercept and slope values. The paradigm is such that the iterations will start at the second derivative of the first (lowest dilution; highest copy number) curve and terminate at the outlier cycle of the last (highest dilution; lowest copy number) curve. Alternatively a y-value can be given with term for the termination threshold. The number of iterations can be defined by opt.step but the default values usually give reasonable results. Not to forget, an iterative search only throughout all intercepts can be chosen, as well as a classical approach using the second derivative maximum of the first curve or a defined threshold value from the qPCR software, to be defined in thresh. See 'Examples'.

References

A new mathematical model for relative quantification in real-time RT-PCR. Pfaffl MW. Nucleic Acids Res (2001), 29:e45.

Examples

Run this code
## Define calibration curves,
## dilutions (or copy numbers) 
## and curves to be predicted.
## Do background subtraction using
## average of first 8 cycles
CAL <- modlist(reps, fluo = c(2, 6, 10, 14, 18, 22), baseline = 1:8)
COPIES <- c(100000, 10000, 1000, 100, 10, 1)
PRED <- modlist(reps, fluo = c(3, 7, 11), baseline = 1:8)

## conduct normal quantification using
## the second derivative maximum of 
## first curve
res1 <- calib(refcurve = CAL, predcurve = PRED, thresh = "cpD2", dil = COPIES) 

## using a defined treshold value
res2 <- calib(refcurve = CAL, predcurve = PRED, thresh = 0.5, dil = COPIES) 

## using replicates for reference curve
ml1 <- modlist(reps, model = l4)
DIL <- rep(10^(6:0), each = 4)
res1 <- calib(refcurve = ml1, dil = DIL)

## iterating the intercept with 50 steps
par(ask = FALSE)
res2 <- calib(refcurve = CAL, predcurve = PRED, dil = COPIES, opt = "inter",
              opt.step = c(50, 0))

## iterating the intercept/slope with 20 steps
par(ask = FALSE)
res3 <- calib(refcurve = CAL, predcurve = PRED, dil = COPIES, opt = "slope", 
              opt.step = c(20, 20))

Run the code above in your browser using DataLab