tidy_to_wide_config: transform long to wide

View source: R/tidyMS_R6_TransitionCorrelations.R

tidy_to_wide_configR Documentation

transform long to wide

Description

transform long to wide

Usage

tidy_to_wide_config(
  data,
  config,
  as.matrix = FALSE,
  fileName = FALSE,
  sep = "~lfq~",
  value = config$table$get_response()
)

Value

list with data, rowdata, and annotation (colData)

Examples


dd <- prolfqua::sim_lfq_data_peptide_config()
config <- dd$config
data <- dd$data
res <- tidy_to_wide_config(data, config)
testthat::expect_equal(nrow(res$rowdata), nrow(res$data))
testthat::expect_equal(ncol(res$data) - ncol(res$rowdata) , nrow(res$annotation))
res <- tidy_to_wide_config(data, config, as.matrix = TRUE)
stopifnot(all(dim(res$data) == c(28,  12)))
stopifnot(all(dim(res$annotation) == c(12,  4)))
stopifnot(all(dim(res$rowdata) == c(28, 3)))

res <- scale(res$data)
tidy_to_wide_config(data, config,  value = config$table$nr_children)


xt <- prolfqua::LFQData$new(dd$data, dd$config)
xt$data$nr_children
#xt$config$table$is_response_transformed <- TRUE
res <- xt$get_Aggregator()
x <- res$medpolish()
towide <- tidy_to_wide_config(x$data, x$config,  value = x$config$table$nr_children)

dd <- prolfqua::sim_lfq_data_protein_config()
dd$config$table$nr_children
dd$data
xt <- tidy_to_wide_config(dd$data, dd$config,  value = dd$config$table$nr_children)
xt$data


wolski/prolfqua documentation built on Dec. 4, 2024, 11:18 p.m.