calib {qpcR} | R Documentation |
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.
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("midpoint", "outlier"), quan = 0.5, slope = NULL, count = 1)
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 'midpoint' 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. |
The iterative function conducts a search through all combinations of slope and intercept. For each iteration, either R-square 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'.
A list with the following components:
refcyc |
the calculated threshold cycles for the calibration curves. |
refcyc.conf |
the confidence intervals for refcyc . |
predcyc |
the calculated threshold cycles for the prediction curves. |
predconc |
the predicted concentrations. |
predconc.conf |
the confidence intervals for predconc . |
eff |
the efficiency as calculated from the calibration curve. |
aic |
the AIC value of the linear fit. |
aicc |
the corrected AIC value of the linear fit. |
rsq |
The R-square of the linear fit. |
rsq.ad |
The adjusted R-square of the linear fit. |
aicMat |
a matrix with the calibration curve AIC of each iteration. |
ATTENTION: If iterations were used, the values reflect the analysis of the best fit!
Andrej-Nikolai Spiess
## 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), backsub = 1:8) COPIES <- c(100000, 10000, 1000, 100, 10, 1) PRED <- modlist(reps, fluo = c(3, 7, 11), backsub = 1:8) ## conduct normal quantification using ## the second derivative maximum of ## first curve res <- calib(refcurve = CAL, predcurve = PRED, thresh = "cpD2", dil = COPIES) ## using a defined treshold value res <- calib(refcurve = CAL, predcurve = PRED, thresh = 0.5, dil = COPIES) ## iterating the intercept with 50 steps res <- calib(refcurve = CAL, predcurve = PRED, dil = COPIES, opt = "inter", opt.step = c(50, 0)) ## iterating the intercept/slope with 20 steps ## Not run: res <- calib(refcurve = CAL, predcurve = PRED, dil = COPIES, opt = "slope", opt.step = c(20, 20)) ## End(Not run) ## using replicates for reference curve ml <- modlist(reps, model = l4) DIL <- rep(10^(6:0), each = 4) res <- calib(refcurve = ml, dil = DIL)