Count distinct elements for each level of hierarchy per sample
Source:R/tidyMS_summarize_hierarchy.R
HierarchyCountsSample.RdProvides wide, long, and plot views of hierarchy counts. Counts per sample,
observed values only (non-missing response and at least
nr_children children).
See also
Other summary:
INTERNAL_FUNCTIONS_BY_FAMILY
Other hierarchy counting:
nr_children_experiment(),
nr_features_experiment(),
nr_obs_sample()
Methods
HierarchyCountsSample$new()
Create a new HierarchyCountsSample
Usage
HierarchyCountsSample$new(pdata, configuration, nr_children = 1)Examples
bb <- sim_lfq_data_protein_config()
#> `protein_Id`: columns `proteinID`, `idtype2` united with separator '~'.
#> creating sampleName from file_name column
#> setup_analysis: dropped 5 unconfigured columns: average_prot_abundance, sd, mean, N, Replicate.
#> setup_analysis: added 16 rows with NA response for feature and sample combinations absent from the input.
counts <- HierarchyCountsSample$new(bb$data, bb$config)
head(counts$wide())
#> # A tibble: 6 × 2
#> sampleName protein_Id
#> <chr> <int>
#> 1 A_V1 9
#> 2 A_V2 9
#> 3 A_V3 7
#> 4 A_V4 10
#> 5 B_V1 9
#> 6 B_V2 9