Skip to contents

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

Usage

hierarchy_counts(pdata, hierarchy_keys, isotope_label = "isotopeLabel")

Arguments

pdata

data.frame

hierarchy_keys

character vector — all hierarchy column names

isotope_label

character — isotope label column name

Examples


bb <- prolfqua::sim_lfq_data_peptide_config()
#> creating sampleName from file_name column
#> completing cases
#> completing cases done
#> setup done
lfq <- LFQData$new(bb$data, bb$config)

x <- hierarchy_counts(lfq$data_long(), lfq$hierarchy_keys(), lfq$isotope_label())
x$protein_Id
#> [1] 10
stopifnot(ncol(x) == length(lfq$hierarchy_keys()) + 1)
# select non existing protein
data0 <- lfq$data_long() |> dplyr::filter(protein_Id == "XYZ")
tmp <- hierarchy_counts(data0, lfq$hierarchy_keys(), lfq$isotope_label())
stopifnot(nrow(tmp) == 0)