Apply function requiring a matrix to tidy table
Source:R/LFQDataTransformer.R
apply_to_response_matrix.RdApply function requiring a matrix to tidy table
See also
Other preprocessing:
INTERNAL_FUNCTIONS_BY_FAMILY,
filter_proteins_by_peptide_count(),
get_robscales(),
robust_scale(),
scale_with_subset()
Examples
bb <- sim_lfq_data_peptide_config(Nprot = 100)
#> creating sampleName from file_name column
#> completing cases
#> completing cases done
#> setup done
lfqdata <- LFQData$new(bb$data, bb$config)
res <- apply_to_response_matrix(lfqdata, .func = base::scale)
#> Joining with `by = join_by(sampleName, isotopeLabel, protein_Id, peptide_Id)`
stopifnot("abundance_base..scale" %in% colnames(res$data))
res <- apply_to_response_matrix(lfqdata, .func = robust_scale)
#> Joining with `by = join_by(sampleName, isotopeLabel, protein_Id, peptide_Id)`
if (require("vsn")) {
res <- apply_to_response_matrix(lfqdata, .func = vsn::justvsn)
}
#> Joining with `by = join_by(sampleName, isotopeLabel, protein_Id, peptide_Id)`