interaction_missing_stats: compute missingness statistics per hierarchy and factor level

View source: R/tidyMS_missigness.R

interaction_missing_statsR Documentation

compute missingness statistics per hierarchy and factor level

Description

compute missingness statistics per hierarchy and factor level

Usage

interaction_missing_stats(
  pdata,
  config,
  factors = config$table$factor_keys_depth(),
  hierarchy = config$table$hierarchy_keys(),
  workIntensity = config$table$get_response()
)

Arguments

pdata

data.frame

config

AnalysisConfiguration

factors

factor to include (default up to factor depth)

hierarchy

hierarchy to include (default up to hierarchy depth)

workIntensity

work intensity column

Examples



istar <- sim_lfq_data_peptide_config()
config <- istar$config
analysis <- istar$data

config$parameter$qVal_individual_threshold <- 0.01
xx <- prolfqua::remove_large_QValues(analysis,
   config)
xx <- complete_cases(xx, config)
x <- interaction_missing_stats(xx, config)$data |> dplyr::arrange(desc(nrNAs))
nrow(x)
tmp <- interaction_missing_stats(xx, config,
 factors= character(),
  hierarchy = config$table$hierarchy_keys()[1])$data
stopifnot(nrow(tmp) == 10)
tmp <- interaction_missing_stats(xx, config,
  hierarchy = config$table$hierarchy_keys()[1])$data
stopifnot(nrow(tmp) == length(unique(xx$protein_Id))* length(unique(xx$group_)))
stopifnot(sum(is.na(tmp$nrMeasured))==0)

tmp <- interaction_missing_stats(xx, config, factors = NULL)

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