hierarchy_counts: Count distinct elements for each level of hierarchy and...

View source: R/AnalysisConfiguration.R

hierarchy_countsR Documentation

Count distinct elements for each level of hierarchy and istope

Description

E.g. number of proteins, peptides, precursors in the dataset

Usage

hierarchy_counts(pdata, config)

Arguments

pdata

data.frame

config

AnalysisConfiguration

See Also

Other summary: INTERNAL_FUNCTIONS_BY_FAMILY, hierarchy_counts_sample(), nr_B_in_A_per_sample(), summarize_hierarchy()

Examples


bb <- prolfqua::sim_lfq_data_peptide_config()

config <- bb$config$clone(deep=TRUE)
data <- bb$data

x <- hierarchy_counts(data, config)
x$protein_Id
stopifnot(ncol(x) == length(config$table$hierarchy_keys()) + 1)
# select non existing protein
data0 <- data |> dplyr::filter( protein_Id == "XYZ")
tmp <- hierarchy_counts(data0, config)
stopifnot(nrow(tmp) == 0)

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