calib2 {qpcR} | R Documentation |
calib2
is an advanced version of calib
! An iterative search of the optimal threshold border is conducted,
thereby going through all slopes and intercepts and selecting the combination that minmimizes the AIC of the acquired
linear regression curves. See 'Details' for more information on this (maybe controversial) procedure.
Also different to calib
, this function uses two 'modlist's, one for calibration and one for prediction.
calib2(refcurve, predcurve = NULL, thresh = "cpD2", term = NULL, dil = NULL, fct = l5(), plot = TRUE, plot.map = TRUE, conf = 0.95, opt = c("none", "inter", "slope"), opt.step = c(50, 50), 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. |
fct |
the model used for the threshold cycle estimation. Any sigmoidal model in the 'drc' package. Defaults to 'l5()'. |
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 p-value for the confidence interval. Defaults to 0.05, 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 for slope iterations as second. |
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. |
This function conducts an iterative 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 defined y-value can be
defined 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 only 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:
ref.cyc |
the calculated threshold cycles for the calibration curves. |
pred.cyc |
the calculated threshold cycles for the curves to be predicted. |
pred.logconc |
the predicted concentrations on a log scale. |
pred.conc |
the predicted concentrations on a linear scale. |
ref.conf |
the confidence values for the calibration curve points. In the same order as ref.cyc . |
pred.logconf |
the confidence values for the prediction curve points, in the same order as pred.cyc and on a log scale. |
pred.conf |
the confidence values for the prediction curve points, in the same order as pred.cyc and on a linear scale. |
eff |
the efficiency as calculated from the calibration curve. |
aic |
the AIC value of the linear fit. |
rsq |
The r-square of the linear fit. |
aicMat |
a matrix with the calibration AIC of each iteration. |
ATTENTION: If iterations were used, the values reflect the analysis of the best fit!
Andrej-Nikolai Spiess
A paper describing the benefits of this approach will follow...
## Define calibration curves, ## dilutions (or copy numbers) ## and curves to be predicted. ## Do background subtraction using ## average of first 8 cycles CAL <- modlist(reps, c(2, 6, 10, 14, 18, 22), backsub = 1:8) COPIES <- c(100000, 10000, 1000, 100, 10, 1) PRED <- modlist(reps, c(3, 7, 11), backsub = 1:8) ## conduct normal quantification using ## the second derivative maximum of ## first curve res <- calib2(refcurve = CAL, predcurve = PRED, thresh = "cpD2", dil = COPIES) ## using a defined treshold value res <- calib2(refcurve = CAL, predcurve = PRED, thresh = 0.5, dil = COPIES) ## iterating only the intercept with 20 steps res <- calib2(refcurve = CAL, predcurve = PRED, dil = COPIES, opt = "inter", opt.step = c(20, 0)) ## iterating only the intercept/slope with 10 steps res <- calib2(refcurve = CAL, predcurve = PRED, dil = COPIES, opt = "slope", opt.step = c(5, 10))