To compare the pooling model against lateral flow results, see the following document:
Figure 2 provides a relationship between Cq value from PCR tests of known positive samples, and LFD sensitivity. Through visual inspection, can obtain the following approximate points:
library(dplyr)
## Warning: replacing previous import 'vctrs::data_frame' by 'tibble::data_frame'
## when loading 'dplyr'
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
d <- tribble(
~cq, ~sensitivity,
18.0, 1,
19.0, 0.98,
23.0, 0.96,
26.5, 0.89,
29.5, 0.65,
32.5, 0.32,
34.5, 0.22,
)
plot(d)
Fit a sigmoid model to this relationship, to be used to infer the probability of testing positive in LFD based on modelled Ct value
lfd_fit <- nls(sensitivity ~ SSlogis(cq, Asym, xmid, scal), data = d)
summary(lfd_fit)
##
## Formula: sensitivity ~ SSlogis(cq, Asym, xmid, scal)
##
## Parameters:
## Estimate Std. Error t value Pr(>|t|)
## Asym 0.99895 0.01683 59.35 4.83e-07 ***
## xmid 31.01328 0.19894 155.89 1.02e-08 ***
## scal -2.37948 0.18314 -12.99 0.000203 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.02523 on 4 degrees of freedom
##
## Number of iterations to convergence: 0
## Achieved convergence tolerance: 5.256e-06
plot(seq(10, 50, length.out = 100),
predict(lfd_fit, newdata = data.frame(cq = seq(10, 50, length.out = 100))),
xlab="RT-qPCR Cq value", ylab="LFD sensitivity", type="l")
points(d, col="red", pch=19)
This model is:
\[ sensitivity = Asym / (1 + exp((xmid - cq)/scal)) \]
Save model fit
lfd_fit <- summary(lfd_fit)
save(lfd_fit, file="../data/lfd_fit.rdata")