Calculate threshold and model based LOD and LOQ for qPCR eDNA assays based on one or more standard curves. This code has been modified and functionalised from the original by Merkes et al. (see references).
calib_lod( data, threshold = 0.35, lod.fit = "best", loq.fit = "best", robust = FALSE, ... )
data | A |
---|---|
threshold | Threshold value for LOQ calculation using coefficient of variation (CV) of Cq (Ct) values. Default value = 0.35. |
lod.fit | Character string to specify method to estimate LOD. Default: |
loq.fit | Character string to specify method to estimate LOQ based on CV curves. Default: |
robust | A logical value indicating whether the fitted model should exclude standards with less than 50%
detections. Default = |
... | Placeholder for further arguments that might be needed by future implementations. |
A lod
class object containing the following objects:
dataSum
: A summary data.frame
of the original qPCR calibration data including copy number estimate (Copy.Estimate
).
standardsSum
: A summary data.frame
of the standards containing the following variables: number of replicates (Rep
), number of detections (Detects
)
and detection rate (Rate
) for each standard (Standards
) and Target (Target
) combination.
The mean (Cq.mean
), standard deviation (Cq.sd
) and coefficient of variation (Cq.CV
) of
Cq values and also the coefficient of variation of copy number (Copy.CV
) is given.
assaySum
: A summary data.frame
of the qPCR assay containing the following variables:
The R-squared value of linear regression of all standards Cq-values vs log10 of the starting quantities
The slope of the linear regression
The intercept of the linear regression
The lowest standard with at least 95 percent positive detection
The 95 percent limit of detection as determined by dose-response modelling
The limit of quantification as determined by decay modelling, using the user-selected CV threshold
The effective limit of detection if analysing in 2 replicates
The effective limit of detection if analysing in 3 replicates
The effective limit of detection if analysing in 4 replicates
The effective limit of detection if analysing in 5 replicates
The effective limit of detection if analysing in 8 replicates
The optimal model when using lod.fit = "best"
model selection, or the user specified model
LOQlist
: A list
object containing LOQ model components for each Target.
LODlist
: A list
object containing LOD model components for each Target.
The data
object contains data for at least one qPCR calibration curve
usually presented as Cq (Ct) value and corresponding copy number from from a series of serial dilutions.
The data.frame
must contain the headers Target
, Cq
and SQ
. The Target
column must contain unique identifiers for each calibration curve. The Cq
column contains the
Cq (Ct) values and SQ
contains the copy number data. Additional columns will be ignored. Non-detections
in data
should be represented as NA
.
The lod.fit
argument is used to select the method to estimate LOD. Selecting "best" will automatically
fit all models available from the package drc
and perform model selection based on log
likelihood values, Akaike's information criterion and residual variance using the mselect
function. Information on possible models can be displayed with the getMeanFunctions
function. For example, to fit a 4 parameter Weibull type II model use lod.fit = "W2.4"
.
The loq.fit
argument is used to select the method to estimate LOQ. Selecting "best" will automatically
select the model with lowest residual standard error. 'decay' uses the exponential decay model, 'linear'
uses a linear model and 'Pn' fits an nth-order polynomial model where n is numerical. For example,
loq.fit = "P2"
will fit a 2nd-order polynomial model and loq.fit = "P3"
will use a 3rd-order.
Selecting "best" will test polynomial models up to 6th-order.
Merkes CM, Klymus KE, Allison MJ, Goldberg C, Helbing CC, Hunter ME, Jackson CA, Lance RF, Mangan AM, Monroe EM, Piaggio AJ, Stokdyk JP, Wilson CC, Richter C. (2019) Generic qPCR Limit of Detection (LOD) / Limit of Quantification (LOQ) calculator. R Script. Available at: https://github.com/cmerkes/qPCR_LOD_Calc. DOI: https://doi.org/10.5066/P9GT00GB.
Klymus, Katy E., Christopher M. Merkes, Michael J. Allison, Caren S. Goldberg, Caren C. Helbing, Margaret E. Hunter, Craig A. Jackson, et al. ‘Reporting the Limits of Detection and Quantification for Environmental DNA Assays’. Environmental DNA 2, no. 3 (July 2020): 271–82. https://doi.org/10.1002/edn3.29.
if (FALSE) { # qpcr_lod <- calib_lod(data = calib_data, threshold = 0.35, lod.fit = "best", loq.fit = "best") qpcr_lod # decay modelling estimate for LOQ qpcr_lod_decay <- calib_lod(data = calib_data, threshold = 0.35, lod.fit = "best", loq.fit = "decay") qpcr_lod_decay # 4 parameter Weibull type II model fitted to estimate LOD qpcr_lod_W2 <- calib_lod(data = calib_data, threshold = 0.35, lod.fit = "W2.4", loq.fit = "best") qpcr_lod_W2 }