R/tidyMS_missigness.R
interaction_missing_stats.Rd
compute missingness statistics per hierarchy and factor level
interaction_missing_stats(
pdata,
config,
factors = config$table$factor_keys_depth(),
hierarchy = config$table$hierarchy_keys(),
workIntensity = config$table$get_response()
)
data.frame
AnalysisConfiguration
factor to include (default up to factor depth)
hierarchy to include (default up to hierarchy depth)
work intensity column
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
config$parameter$qVal_individual_threshold <- 0.01
xx <- prolfqua::remove_large_QValues(analysis,
config)
xx <- complete_cases(xx, config)
#> completing cases
x <- interaction_missing_stats(xx, config)$data |> dplyr::arrange(desc(nrNAs))
#> Warning: >>>> deprecated! <<<<
#>
#> use summarize_stats_factors instead.
#> completing cases
nrow(x)
#> [1] 84
tmp <- interaction_missing_stats(xx, config,
factors= character(),
hierarchy = config$table$hierarchy_keys()[1])$data
#> Warning: >>>> deprecated! <<<<
#>
#> use summarize_stats_factors instead.
#> completing cases
stopifnot(nrow(tmp) == 10)
tmp <- interaction_missing_stats(xx, config,
hierarchy = config$table$hierarchy_keys()[1])$data
#> Warning: >>>> deprecated! <<<<
#>
#> use summarize_stats_factors instead.
#> completing cases
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)
#> Warning: >>>> deprecated! <<<<
#>
#> use summarize_stats_factors instead.
#> completing cases