this should reduce the overall variance.

scale_with_subset(
  data,
  subset,
  config,
  preserveMean = FALSE,
  get_scales = TRUE
)

Arguments

data

the whole dataset

subset

a subset of the dataset

config

configuration

get_scales

return a list of transformed data and the scaling parameters

perserveMean

default FASE - sets mean to zero

Examples




bb <-sim_lfq_data_peptide_config(Nprot = 100)
#> creating sampleName from fileName column
#> Warning: no nr_children column specified in the data, adding column nr_children and setting to 1.
#> completing cases
conf <- bb$config$clone(deep=TRUE)
sample_analysis <- bb$data

res <- transform_work_intensity(sample_analysis, conf, log2)
#> Column added : log2_abundance
s1 <- get_robscales(res, conf)
res <- scale_with_subset(res, res, conf)
#> Warning: Expected 2 pieces. Additional pieces discarded in 4200 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)`
s2 <- get_robscales(res$data, conf)
stopifnot(abs(mean(s1$mads) - mean(s2$mads)) < 1e-6)