Compute fold changes given Contrasts

get_contrast(data, hierarchy_keys, contrasts)

Arguments

data

hierarchy_keys of Analysis Configuration

contrasts

list of contrasts to compute

Examples



istar <- sim_lfq_data_peptide_config()
#> creating sampleName from fileName column
#> Warning: no nr_children column specified in the data, adding column nr_children and setting to 1.
#> completing cases
config <- istar$config
analysis <- istar$data
data <- complete_cases(analysis, config)
#> completing cases

Contrasts <- c("dilution.b-a" = "group_A - group_B", "dilution.c-e" = "group_A - group_Ctrl")

var = summarize_stats(data, config)
#> [1] "group_"
#> completing cases
var <- prolfqua::make_interaction_column(var, columns = config$table$factor_keys_depth())

imp <- var |> tidyr::pivot_wider(id_cols = config$table$hierarchy_keys(),
                        names_from = interaction,
                        values_from = !!rlang::sym("meanAbundance"))

imputed <- get_contrast(imp, config$table$hierarchy_keys(), Contrasts)
#> dilution.b-a=group_A - group_B
#> dilution.c-e=group_A - group_Ctrl