Type: | Package |
Title: | Probability of Detection for Qualitative PCR Methods |
Version: | 1.2.0 |
Date: | 2020-06-30 |
Author: | Markus Boenn (State Office for Consumer Protection Saxony-Anhalt, Germany) |
Maintainer: | Markus Boenn <markus.boenn.sf@gmail.com> |
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>. |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
Depends: | R (≥ 3.4.0) |
VignetteBuilder: | knitr |
RoxygenNote: | 6.1.1 |
NeedsCompilation: | no |
Packaged: | 2020-06-30 08:35:01 UTC; boenn |
Repository: | CRAN |
Date/Publication: | 2020-06-30 08:40:07 UTC |
Analyze Single Lab Qualitative PCR Outcomes
Description
Compute the POD curve and the LOD value to validate a qualitative PCR method of a single laboratory.
Usage
analyzeSingleLab(x = NULL, X = NULL, S = NULL, N = NULL,
qLOD = 95, b = 1)
Arguments
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 |
Details
According to the suggestion of Uhlig et al. (2015), the corrective parameter b
is set to 1
if it is close to 1
(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 b
is estimated from the data (full fit).
The value of b
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}
)
Value
A list with following items
- x
Input data plus extra columns
- b
The parameter
b
, as provided by the user- fit.glm.simple
Results for the simplified GLM
- fit.glm.full
Results for the full GLM
where "fit.glm.simple" and "fit.glm.full" are lists with the following parameters
- b
The parameter
b
(estimated from the model)- lambda
The parameter
\lambda
(estimated from the model)- model
The generalized linear model (GLM) fit to the data
- lod
A named vector of LOD values
- lodci
The 95% confidence interval of the LOD
- warn
A character vector containing warnings that appeared during GLM fit
References
Uhlig et al. Accred Qual Assur (2015) 20: 75. https://doi.org/10.1007/s00769-015-1112-9
Examples
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)
Description
Compute the Probability Of Detection (POD) in qualitative PCR experiments carried out by a single laboratory.
Usage
computePOD(x, lambda = 1, b = 1)
Arguments
x |
Nominal DNA concentrations (numeric vector) |
lambda |
The fraction of detected DNA fragments (numeric scalar) |
b |
correction parameter (numeric scalar) |
Value
The POD function as described in Uhlig et al., 2015
References
Uhlig et al. Accred Qual Assur (2015) 20: 75. https://doi.org/10.1007/s00769-015-1112-9
Examples
# the optimal POD
computePOD(exp(seq(1, 10, 1)), 1, 1)
# some other POD
computePOD(exp(seq(1, 10, 1)), 0.5, 1.29)
Support Other Platforms
Description
Export formatted data or code for use by other platforms
Usage
exportQuodata(obj)
exportSAS(obj)
exportExcelMacro(dest)
Arguments
obj |
A list returned by |
dest |
The path to write the excel macro to. |
Details
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.
Value
Nothing is returned by exportQuodata()
and exportSAS()
. Function exportExcelMacro()
returns a boolean, FALSE
if a file with name 'pod.xlsm' already exists, TRUE
otherwise.
See Also
Examples
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)
Generate Plot to Analyze Single Lab PCR Outcomes
Description
Show POD curve and LOD value to validate qualitative PCR methods of a single laboratory.
Usage
plotPOD(obj, model = c("auto", "simple", "full"), qLOD = 95,
show.ci = TRUE, show.warnings = FALSE, wmark = TRUE, unit = "",
xlim = NULL, .title = list(main = "", xlab = "Number of DNA copies",
ylab = "POD and ROD"))
Arguments
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. |
xlim |
A numeric vector indicating the limits of the x-axis. |
.title |
A list with same arguments as function |
Details
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 95 \%
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 1
, a message is shown in the plot. Testing for significant deviation is currently done by checking the condition 1-b>0.2
. The threshould 0.2
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 1
. 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 1
. 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 [0.5,1.5]
. 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.
Value
The passed list 'obj' is returned invisibly.
Examples
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)
Summary of POD objects
Description
Generate nicely formatted output of the POD object
Usage
## S3 method for class 'pod'
print(x, ...)
Arguments
x |
An object of class 'pod' |
... |
Other parameters, not supported yet. |
Value
Nothing is returned.
Examples
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
Get Test Data
Description
Some data to test the functionality of the package
Usage
grohmann2015collaborative(lab = NULL)
sas.logistic()
Arguments
lab |
A numeric vector indicating from which laboratory the data should be taken. |
Value
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).
References
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
Examples
x.all <- grohmann2015collaborative()
x.5 <- grohmann2015collaborative(5)
sas <- sas.logistic()