Decorates LFQData with methods to impute missing values
Decorates LFQData with methods to impute missing values
Details
Use `lfqdata$get_Imputer()` to create an instance. The imputer works on a deep copy of the data, so the original LFQData is not modified.
Typical workflow:
imp <- lfqdata$get_Imputer()
imp$impute(method = "multRepl", lod = "global")
imp$lfq$get_Plotter()$pca()See also
Other LFQData:
LFQData,
LFQDataAggregator,
LFQDataPlotter,
LFQDataStats,
LFQDataSummariser,
LFQDataToSummarizedExperiment()
Methods
Method impute()
Impute missing values using zCompositions
Examples
dd <- prolfqua::sim_lfq_data_peptide_config()
#> creating sampleName from fileName column
#> completing cases
#> completing cases done
#> setup done
lfqdata <- LFQData$new(dd$data, dd$config)
imp <- LFQDataImp$new(lfqdata)
if (requireNamespace("zCompositions", quietly = TRUE)) {
imp$impute(method = "multRepl", lod = "global")
wide <- imp$lfq$to_wide(as.matrix = TRUE)
stopifnot(!any(is.na(wide$data)))
}
#> Warning: Expected 2 pieces. Missing pieces filled with `NA` in 336 rows [1, 2, 3, 4, 5,
#> 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...].
#> Joining with `by = join_by(sampleName, protein_Id, peptide_Id)`