apply_to_response_matrix: Apply function requiring a matrix to tidy table

View source: R/tidyMS_R6_TransitionCorrelations.R

apply_to_response_matrixR Documentation

Apply function requiring a matrix to tidy table

Description

Apply function requiring a matrix to tidy table

Usage

apply_to_response_matrix(data, config, .func, .funcname = NULL)

Arguments

data

data.frame

config

AnalysisConfiguration

.func

function

.funcname

name of function (used for creating new column)

See Also

Other preprocessing: INTERNAL_FUNCTIONS_BY_FAMILY, filter_proteins_by_peptide_count(), get_robscales(), normalize_log2_robscale(), robust_scale(), scale_with_subset(), scale_with_subset_by_factors()

Examples



bb <- sim_lfq_data_peptide_config(Nprot = 100)
data <- bb$data
conf <- bb$config
res <- apply_to_response_matrix(data, conf, .func = base::scale)

stopifnot("abundance_base..scale" %in% colnames(res))
stopifnot("abundance_base..scale" == conf$table$get_response())
conf <- bb$config$clone(deep=TRUE)
conf$table$workIntensity <- "abundance"
res <- apply_to_response_matrix(data, conf$clone(deep=TRUE), .func = robust_scale)

# Normalize data using the vsn method from bioconductor

if( require("vsn")){
 res <- apply_to_response_matrix(data, conf$clone(deep=TRUE), .func = vsn::justvsn)
}


wolski/prolfqua documentation built on Sept. 7, 2024, 3:06 a.m.