summarize_stats: Compute mean, sd, and CV for all Peptides, or proteins, for...

View source: R/tidyMS_stats.R

summarize_statsR Documentation

Compute mean, sd, and CV for all Peptides, or proteins, for all interactions and all samples.

Description

Compute mean, sd, and CV for all Peptides, or proteins, for all interactions and all samples.

Compute mean, sd, and CV for e.g. Peptides, or proteins, for all samples.

summarize stats output (compute quantiles)

Usage

summarize_stats(pdata, config, factor_key = config$table$factor_keys_depth())

summarize_stats_all(pdata, config)

summarize_stats_quantiles(
  stats_res,
  config,
  stats = c("sd", "CV"),
  probs = c(0.1, 0.25, 0.5, 0.75, 0.9)
)

Arguments

pdata

data.frame

config

AnalysisConfiguration

stats_res

result of running 'summarize_stats'

stats

summarize either sd or CV

probs

for which quantiles 10, 20 etc.

all

also compute for all samples (default), or only of conditions (set to FALSE)

See Also

Other stats: INTERNAL_FUNCTIONS_BY_FAMILY, lfq_power_t_test_proteins(), lfq_power_t_test_quantiles(), lfq_power_t_test_quantiles_V2(), plot_stat_density(), plot_stat_density_median(), plot_stat_violin(), plot_stat_violin_median(), plot_stdv_vs_mean(), pooled_V2()

Other stats: INTERNAL_FUNCTIONS_BY_FAMILY, lfq_power_t_test_proteins(), lfq_power_t_test_quantiles(), lfq_power_t_test_quantiles_V2(), plot_stat_density(), plot_stat_density_median(), plot_stat_violin(), plot_stat_violin_median(), plot_stdv_vs_mean(), pooled_V2()

Other stats: INTERNAL_FUNCTIONS_BY_FAMILY, lfq_power_t_test_proteins(), lfq_power_t_test_quantiles(), lfq_power_t_test_quantiles_V2(), plot_stat_density(), plot_stat_density_median(), plot_stat_violin(), plot_stat_violin_median(), plot_stdv_vs_mean(), pooled_V2()

Examples



bb <- prolfqua::sim_lfq_data_protein_config()
config <- bb$config
data <- bb$data

res1 <- summarize_stats(data, config)

res2 <- prolfqua::sim_lfq_data_2Factor_config()
res2$config$table$factorDepth <- 2
stats <- summarize_stats(res2$data, res2$config)
stopifnot(nrow(stats) == 40)

stats <- summarize_stats(res2$data, res2$config, factor_key = res2$config$table$factor_keys()[1])
stopifnot(nrow(stats) == 20)
stats <- summarize_stats(res2$data, res2$config, factor_key = res2$config$table$factor_keys()[2])
stopifnot(nrow(stats) == 20)
stats <- summarize_stats(res2$data, res2$config, factor_key = NULL)
stopifnot(nrow(stats) == 10)



bb <- prolfqua::sim_lfq_data_protein_config()

res1 <- summarize_stats_all(bb$data, bb$config)

stopifnot((res1 |> dplyr::filter(group_ == "All") |> nrow()) == (res1 |> nrow()))
res2 <- prolfqua::sim_lfq_data_2Factor_config()
resSt <- summarize_stats_all(res2$data, res2$config)
library(ggplot2)
bb1 <- prolfqua::sim_lfq_data_peptide_config()
config <- bb1$config
data <- bb1$data
stats_res <- summarize_stats(data, config)
sq <- summarize_stats_quantiles(stats_res, config)
sq <- summarize_stats_quantiles(stats_res, config, stats = "CV")
bb <- prolfqua::sim_lfq_data_peptide_config()
config <- bb$config
data <- bb$data
config$table$get_response()
stats_res <- summarize_stats(data, config)
sq <- summarize_stats_quantiles(stats_res, config)
sq <- summarize_stats_quantiles(stats_res, config, stats = "sd")
stats_res <- summarize_stats(data, config)
xx <- summarize_stats_quantiles(stats_res, config, probs = seq(0,1,by = 0.1))
ggplot2::ggplot(xx$long, aes(x = probs, y = quantiles, color = group_)) + geom_line() + geom_point()



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