Prepare data for an UpSet plot of observations per group
Source:R/tidyMS_missingness_summary.R
upset_interaction_missing_stats.RdMarks, for each protein and factor level, whether it has at least tr observations, in the input format of
UpSetR::upset(), to show which proteins are observed in which groups.
Arguments
- lfqdata
LFQData object with the data and its configuration
- tr
if less than tr observations in condition then missing
Value
a list with data, a data.frame with one row per hierarchy element and one 0/1 column per factor
level (1 when at least tr observations), and nsets, the number of factor-level columns.
See also
Other plotting:
ContrastsPlotter,
INTERNAL_FUNCTIONS_BY_FAMILY,
theme_prolfqua()
Examples
istar <- sim_lfq_data_peptide_config()
#> `protein_Id`: columns `proteinID`, `idtype2` united with separator '~'.
#> creating sampleName from file_name column
#> setup_analysis: dropped 6 unconfigured columns: average_prot_abundance, sd, mean, N, avg_peptide_abd, Replicate.
#> setup_analysis: added 36 rows with NA response for feature and sample combinations absent from the input.
lfq <- LFQData$new(istar$data, istar$config)
pups <- upset_interaction_missing_stats(lfq)
stopifnot(ncol(pups$data) == 5)
UpSetR::upset(pups$data, order.by = "freq", nsets = pups$nsets)