Title: | Probability of Detection for Qualitative PCR Methods |
---|---|
Description: | This tool computes the probability of detection (POD) curve and the limit of detection (LOD), i.e. the number of copies of the target DNA sequence required to ensure a 95 % probability of detection (LOD95). Other quantiles of the LOD can be specified. This is a reimplementation of the mathematical-statistical modelling of the validation of qualitative polymerase chain reaction (PCR) methods within a single laboratory as provided by the commercial tool 'PROLab' <http://quodata.de/>. The modelling itself has been described by Uhlig et al. (2015) <doi:10.1007/s00769-015-1112-9>. |
Authors: | Markus Boenn (State Office for Consumer Protection Saxony-Anhalt, Germany) |
Maintainer: | Markus Boenn <[email protected]> |
License: | GPL-3 |
Version: | 1.2.0 |
Built: | 2024-11-05 05:42:38 UTC |
Source: | https://github.com/markusboenn/pod |
Compute the POD curve and the LOD value to validate a qualitative PCR method of a single laboratory.
analyzeSingleLab(x = NULL, X = NULL, S = NULL, N = NULL, qLOD = 95, b = 1)
analyzeSingleLab(x = NULL, X = NULL, S = NULL, N = NULL, qLOD = 95, b = 1)
x |
A matrix or dataframe with columns 'X', 'S' and 'N'. |
X |
Nominal DNA concentration. |
S |
Number of successfull PCR outcomes. |
N |
Total number of PCR experiments. |
qLOD |
The quantile(s) for the Limit Of Detection (LOD). Divided by |
b |
Fixed value for the corrective parameter |
According to the suggestion of Uhlig et al. (2015), the corrective parameter is set to
if it is close to
(simplified fit). However, if sensitivity is better than achievable according to the theoretical POD curve or average amplification probability is higher at higher dilution levels than at lower dilution levels, the
is estimated from the data (full fit).
The value of
can be changed by the user. However, it is not recommended to do so.
In particular unexperienced users struggle with decimal commas and decimal dots, transforming digits from strings into numeric values etc. To lower the burden, beginning with package version 1.2.0 this function automatically and only where necessary
adds column names (with warning)
transforms values in all columns from factor or character into numeric values
thereby substituting decimal commas by decimal dots
transforms columns 'S' and 'N' to integer (link{as.integer}
)
A list with following items
Input data plus extra columns
The parameter , as provided by the user
Results for the simplified GLM
Results for the full GLM
where "fit.glm.simple" and "fit.glm.full" are lists with the following parameters
The parameter (estimated from the model)
The parameter (estimated from the model)
The generalized linear model (GLM) fit to the data
A named vector of LOD values
The 95% confidence interval of the LOD
A character vector containing warnings that appeared during GLM fit
Uhlig et al. Accred Qual Assur (2015) 20: 75. https://doi.org/10.1007/s00769-015-1112-9
x <- cbind( X=c(0.1,1,2,5,10,20), S=c( 0,5,6,6,6,6 ), N=c( 6,6,6,6,6,6 ) ) obj <- analyzeSingleLab(x=x)
x <- cbind( X=c(0.1,1,2,5,10,20), S=c( 0,5,6,6,6,6 ), N=c( 6,6,6,6,6,6 ) ) obj <- analyzeSingleLab(x=x)
Compute the Probability Of Detection (POD) in qualitative PCR experiments carried out by a single laboratory.
computePOD(x, lambda = 1, b = 1)
computePOD(x, lambda = 1, b = 1)
x |
Nominal DNA concentrations (numeric vector) |
lambda |
The fraction of detected DNA fragments (numeric scalar) |
b |
correction parameter (numeric scalar) |
The POD function as described in Uhlig et al., 2015
Uhlig et al. Accred Qual Assur (2015) 20: 75. https://doi.org/10.1007/s00769-015-1112-9
# the optimal POD computePOD(exp(seq(1, 10, 1)), 1, 1) # some other POD computePOD(exp(seq(1, 10, 1)), 0.5, 1.29)
# the optimal POD computePOD(exp(seq(1, 10, 1)), 1, 1) # some other POD computePOD(exp(seq(1, 10, 1)), 0.5, 1.29)
Export formatted data or code for use by other platforms
exportQuodata(obj) exportSAS(obj) exportExcelMacro(dest)
exportQuodata(obj) exportSAS(obj) exportExcelMacro(dest)
obj |
A list returned by |
dest |
The path to write the excel macro to. |
The output of exportQuodata can be used on the QuoData website (http://quodata.de/content/validation-qualitative-pcr-methods-single-laboratory).
Function exportExcelMacro()
creates an Excel macro in the specified directory. Existing files (older versions for instance) will not be overwritten! To create the macro in the current directory, set destination to ""
(Windows) or "."
(Linux), respectively.
Nothing is returned by exportQuodata()
and exportSAS()
. Function exportExcelMacro()
returns a boolean, FALSE
if a file with name 'pod.xlsm' already exists, TRUE
otherwise.
x <- cbind( X=c( 0.1,1,2,5,10,20 ), S=c( 0,5,6,6,6,6 ), N=c( 6,6,6,6,6,6 ) ) obj <- analyzeSingleLab(x=x) exportQuodata(obj)
x <- cbind( X=c( 0.1,1,2,5,10,20 ), S=c( 0,5,6,6,6,6 ), N=c( 6,6,6,6,6,6 ) ) obj <- analyzeSingleLab(x=x) exportQuodata(obj)
Show POD curve and LOD value to validate qualitative PCR methods of a single laboratory.
plotPOD(obj, model = c("auto", "simple", "full"), qLOD = 95, show.ci = TRUE, show.warnings = FALSE, wmark = TRUE, unit = "")
plotPOD(obj, model = c("auto", "simple", "full"), qLOD = 95, show.ci = TRUE, show.warnings = FALSE, wmark = TRUE, unit = "")
obj |
A list returned by |
model |
Simple or full model |
qLOD |
The quantile(s) for LOD to be shown in the plot. Multiplied by |
show.ci |
Show the confidence interval of the LOD in the plot. |
show.warnings |
Show the warning regarding significant deviation from |
wmark |
Logical. Show a watermark at the upper right corner of the plot. |
unit |
A string indicating the unit of the data. |
The graph generated by this function gives the laboratory-specific rates of detection (RODs) as blue diamonds. The blue curve denotes the mean POD curve along with the corresponding confidence range highlighted as the grey band. The POD curve under ideal conditions is displayed as the black dashed curve.
If model is set to "auto", a plausiblity test is applied to determine if the POD curve bases on the simplified or on full parameter estimation. If the corrective parameter determined from the full model significantly differs from , a message is shown in the plot. Testing for significant deviation is currently done by checking the condition
. The threshould
has been determined empirically to agree with the original webtool and might be changed in future versions of the package.
Three cases can be distinguished. First, the value for the slope parameter b is significantly less than . This means the average amplification probability is higher at higher dilution levels than at lower dilution levels. Such a situation can be related to: inhibitory matrix effects, a large variability in the amplification process from the one test to another under repeatability conditions, or accidental problems causing false positives if the number of copies of the target DNA sequence is less than
. Second, the calculated POD curve indicates sensitivity better than achievable according to the theoretical POD curve. Third, the number of positive test results is significantly higher than expected at nominal copies of nominal DNA concentrations in
. In this case check the correctness of the serial dilution.
Another warning appears if the LOD of interest exceeds the highest number of considered nominal copies.
The unit is add to the LOD value, in front of the confidence intervall.
The passed list 'obj' is returned invisibly.
x <- cbind( X=c(0.1,1,2,5,10,20), S=c( 0,5,6,6,6,6 ), N=c( 6,6,6,6,6,6 ) ) obj <- analyzeSingleLab(x=x) plotPOD(obj)
x <- cbind( X=c(0.1,1,2,5,10,20), S=c( 0,5,6,6,6,6 ), N=c( 6,6,6,6,6,6 ) ) obj <- analyzeSingleLab(x=x) plotPOD(obj)
Generate nicely formatted output of the POD object
## S3 method for class 'pod' print(x, ...)
## S3 method for class 'pod' print(x, ...)
x |
An object of class 'pod' |
... |
Other parameters, not supported yet. |
Nothing is returned.
x <- cbind( X=c( 0.1,1,2,5,10,20 ), S=c( 0,5,6,6,6,6 ), N=c( 6,6,6,6,6,6 ) ) obj <- analyzeSingleLab(x=x) print(obj) # or just obj obj <- analyzeSingleLab(x=x, qLOD=c(50, 70, 95)) obj
x <- cbind( X=c( 0.1,1,2,5,10,20 ), S=c( 0,5,6,6,6,6 ), N=c( 6,6,6,6,6,6 ) ) obj <- analyzeSingleLab(x=x) print(obj) # or just obj obj <- analyzeSingleLab(x=x, qLOD=c(50, 70, 95)) obj
Some data to test the functionality of the package
grohmann2015collaborative(lab = NULL) sas.logistic()
grohmann2015collaborative(lab = NULL) sas.logistic()
lab |
A numeric vector indicating from which laboratory the data should be taken. |
If a lab is not NULL, a data.frame with three columns ('X', 'S', 'N') is returned. If lab is NULL, these three columns are supplemented by a fourth column indicating the laboratory.
Data grohmann2015collaborative was generated by Grohmann et al. (2015) and has been used as exemplary data by Uhlig et al. (2015) to assess performance of their statistical approach to validate PCR results. Data sas.logistic was taken from the part of the SAS manual dealing with logistic regression (https://support.sas.com/documentation/onlinedoc/stat/ex_code/132/logiex14.html).
Grohmann et al. Accred Qual Assur (2015) 20: 85. https://doi.org/10.1007/s00769-015-1108-5 Uhlig et al. Accred Qual Assur (2015) 20: 75. https://doi.org/10.1007/s00769-015-1112-9
x.all <- grohmann2015collaborative() x.5 <- grohmann2015collaborative(5) sas <- sas.logistic()
x.all <- grohmann2015collaborative() x.5 <- grohmann2015collaborative(5) sas <- sas.logistic()