hierarchy_counts_sample: Count distinct elements for each level of hierarchy per...

View source: R/AnalysisConfiguration.R

hierarchy_counts_sampleR Documentation

Count distinct elements for each level of hierarchy per sample

Description

Count distinct elements for each level of hierarchy per sample

Usage

hierarchy_counts_sample(pdata, configuration, nr_children = 1)

Arguments

pdata

data.frame

config

AnalysisConfiguration

See Also

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

Examples


bb <- prolfqua::sim_lfq_data_peptide_config()

config <- bb$config
data <- bb$data
res <- hierarchy_counts_sample(data, config, nr_children = 1)
x <- res("long")
# filters on peptide level
res <- hierarchy_counts_sample(data, config, nr_children = 2)
x2 <- res("long")
# filters on protein level based on peptide count
bb <- prolfqua::sim_lfq_data_protein_config()
res <- hierarchy_counts_sample(bb$data, bb$config, nr_children = 2)
x1 <- res()
res <- hierarchy_counts_sample(bb$data, bb$config, nr_children = 1)
x2 <- res()
x1$nr_children <- 2
x2$nr_children <- 1
xl <- dplyr::bind_rows(x1, x2)

xl$nr_children |> table()
nudgeval <-  -mean(xl$protein_Id) * 0.05
ggplot2::ggplot(xl, ggplot2::aes(x = sampleName, y = protein_Id, fill = as.character(nr_children)) ) +
 ggplot2::geom_bar(stat = "identity", position = ggplot2::position_dodge())


wolski/prolfqua documentation built on Oct. 31, 2024, 9:22 a.m.