scale_with_subset: Scale data using a subset of the data

View source: R/tidyMS_R6_TransitionCorrelations.R

scale_with_subsetR Documentation

Scale data using a subset of the data

Description

this should reduce the overall variance.

Usage

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

See Also

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

Examples




bb <- prolfqua_data('data_ionstar')$filtered()
bb$config <- old2new(bb$config)
stopifnot(nrow(bb$data) == 25780)
conf <- bb$config$clone(deep=TRUE)
sample_analysis <- bb$data
conf$table$workIntensity <- "peptide.intensity"

res <- transform_work_intensity(sample_analysis, conf, log2)
s1 <- get_robscales(res, conf)
res <- scale_with_subset(res, res, conf)
s2 <- get_robscales(res$data, conf)
stopifnot(abs(mean(s1$mads) - mean(s2$mads)) < 1e-6)

wolski/prolfqua documentation built on May 12, 2024, 10:16 p.m.