R/tidyMS_stats.R
summarize_stats.Rd
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)
data.frame
AnalysisConfiguration
result of running `summarize_stats`
summarize either sd or CV
for which quantiles 10, 20 etc.
also compute for all samples (default), or only of conditions (set to FALSE)
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()
bb <- prolfqua::sim_lfq_data_protein_config()
#> creating sampleName from fileName column
#> completing cases
config <- bb$config
data <- bb$data
res1 <- summarize_stats(data, config)
#> [1] "group_"
#> completing cases
res2 <- prolfqua::sim_lfq_data_2Factor_config()
#> creating sampleName from fileName column
#> completing cases
res2$config$table$factorDepth <- 2
stats <- summarize_stats(res2$data, res2$config)
#> [1] "Treatment" "Background"
#> completing cases
stopifnot(nrow(stats) == 40)
stats <- summarize_stats(res2$data, res2$config, factor_key = res2$config$table$factor_keys()[1])
#> [1] "Treatment"
#> completing cases
stopifnot(nrow(stats) == 20)
stats <- summarize_stats(res2$data, res2$config, factor_key = res2$config$table$factor_keys()[2])
#> [1] "Background"
#> completing cases
stopifnot(nrow(stats) == 20)
stats <- summarize_stats(res2$data, res2$config, factor_key = NULL)
#> NULL
#> completing cases
stopifnot(nrow(stats) == 10)
bb <- prolfqua::sim_lfq_data_protein_config()
#> creating sampleName from fileName column
#> completing cases
res1 <- summarize_stats_all(bb$data, bb$config)
#> NULL
#> completing cases
stopifnot((res1 |> dplyr::filter(group_ == "All") |> nrow()) == (res1 |> nrow()))
res2 <- prolfqua::sim_lfq_data_2Factor_config()
#> creating sampleName from fileName column
#> completing cases
resSt <- summarize_stats_all(res2$data, res2$config)
#> NULL
#> completing cases
library(ggplot2)
bb1 <- prolfqua::sim_lfq_data_peptide_config()
#> creating sampleName from fileName column
#> Warning: no nr_children column specified in the data, adding column nr_children and setting to 1.
#> completing cases
config <- bb1$config
data <- bb1$data
stats_res <- summarize_stats(data, config)
#> [1] "group_"
#> completing cases
sq <- summarize_stats_quantiles(stats_res, config)
sq <- summarize_stats_quantiles(stats_res, config, stats = "CV")
bb <- prolfqua::sim_lfq_data_peptide_config()
#> creating sampleName from fileName column
#> Warning: no nr_children column specified in the data, adding column nr_children and setting to 1.
#> completing cases
config <- bb$config
data <- bb$data
config$table$get_response()
#> [1] "abundance"
stats_res <- summarize_stats(data, config)
#> [1] "group_"
#> completing cases
sq <- summarize_stats_quantiles(stats_res, config)
sq <- summarize_stats_quantiles(stats_res, config, stats = "sd")
stats_res <- summarize_stats(data, config)
#> [1] "group_"
#> completing cases
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()