Max nr_children across samples per hierarchy unit
Source:R/tidyMS_aggregation.R
nr_children_experiment.RdAggregates nr_children per sample (via nr_obs_sample), then takes the max per hierarchy unit. Counts experiment-wide, observed values only.
Usage
nr_children_experiment(
data,
response,
hierarchy_keys_depth,
file_name,
nr_children_col,
name_nr_child = "nr_child_exp"
)Value
a tibble with one row per hierarchy element: hierarchy_keys_depth and name_nr_child, the largest
per-sample count of observed children.
See also
Other hierarchy counting:
HierarchyCountsSample,
nr_features_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_children_experiment(lfq$data_long(), lfq$response(),
lfq$relevant_hierarchy_keys(), lfq$file_name(), lfq$nr_children_col())
stopifnot(min(xd$nr_child_exp) == 1)