Limit-of-detection fallback imputation for qPCR non-detects
Source:R/singlesample-nondetects.R
qpcr_nondetect_lod_fallback.RdReplaces every NA in expr_mat with the supplied lod_ct
value (default 40). Used by the single-sample pipeline when Bayesian
hierarchical imputation via nondetects is unavailable or fails.
Sets nondetect_method = "lod_fallback" and n_imputed
attributes.
Value
Matrix of the same shape as expr_mat, with NAs filled by
lod_ct. Carries attributes nondetect_method and
n_imputed.
Examples
m <- matrix(c(20, NA, 25, 30, NA, NA), nrow = 2,
dimnames = list(c("miR-1", "miR-2"), c("S1", "S2", "S3")))
qpcr_nondetect_lod_fallback(m, log_handler = function(...) invisible())
#> S1 S2 S3
#> miR-1 20 25 40
#> miR-2 40 30 40
#> attr(,"nondetect_method")
#> [1] "lod_fallback"
#> attr(,"n_imputed")
#> [1] 3