Count distinct child features per hierarchy unit
Source:R/tidyMS_aggregation.R
nr_features_experiment.RdCounts the number of distinct entries of the hierarchy levels below
hierarchy_keys_depth (e.g. peptides per protein). Counts experiment-wide,
whether observed or not.
Usage
nr_features_experiment(
data,
hierarchy_keys,
hierarchy_keys_depth,
name_nr_child = "nr_features_exp"
)Value
a tibble with one row per hierarchy element: hierarchy_keys_depth and name_nr_child, the number
of distinct child features, observed or not.
See also
Other hierarchy counting:
HierarchyCountsSample,
nr_children_experiment(),
nr_obs_sample()
Examples
dd <- prolfqua::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(dd$data, dd$config)
xd <- nr_features_experiment(lfq$data_long(), lfq$hierarchy_keys(),
lfq$relevant_hierarchy_keys())
stopifnot(min(xd$nr_features_exp) == 1)