Skip to contents

Applies count-dependent empirical Bayes variance shrinkage to a contrast result table. Proteins quantified from many peptides get less shrinkage; proteins from few peptides get more.

Usage

moderated_p_deqms(
  mm,
  count_col,
  df = "df",
  estimate = "diff",
  loess_span = 0.75,
  confint = 0.95
)

Arguments

mm

data.frame from one contrast group with columns: sigma, df, statistic, std.error, and the estimate column

count_col

name of column with peptide/PSM count per protein

df

name of the degrees of freedom column

estimate

name of the fold change column

loess_span

span parameter for LOESS fit (default 0.75)

confint

confidence level for intervals (default 0.95)

Value

data.frame with added moderated.* columns

See also

Other modelling: AnovaExtractor, Contrasts, ContrastsDEqMSFacade, ContrastsDEqMSVoomFacade, ContrastsFirth, ContrastsFirthFacade, ContrastsLMFacade, ContrastsLMImputeFacade, ContrastsLMMissingFacade, ContrastsLimma, ContrastsLimmaFacade, ContrastsLimmaImputeFacade, ContrastsLimmaVoomFacade, ContrastsLimmaVoomImputeFacade, ContrastsLimpaFacade, ContrastsLmerFacade, ContrastsMissing, ContrastsModerated, ContrastsModeratedDEqMS, ContrastsPlotter, ContrastsRLMFacade, ContrastsROPECA, ContrastsROPECAFacade, ContrastsTable, INTERNAL_FUNCTIONS_BY_FAMILY, LR_test(), Model, ModelFirth, ModelLimma, StrategyLM, StrategyLimma, StrategyLimpa, StrategyLmer, StrategyLogistf, StrategyRLM, build_contrast_analysis(), build_model(), build_model_glm_peptide(), build_model_glm_protein(), build_model_impute(), build_model_limma(), build_model_limma_impute(), build_model_limma_voom(), build_model_limma_voom_impute(), build_model_limpa(), build_model_logistf(), compute_borrowed_variance(), compute_borrowed_variance_limma(), compute_contrast(), compute_lmer_contrast(), contrasts_fisher_exact(), get_anova_df(), get_complete_model_fit(), get_p_values_pbeta(), group_label(), impute_refit_singular(), is_singular_lm(), linfct_all_possible_contrasts(), linfct_factors_contrasts(), linfct_from_model(), linfct_matrix_contrasts(), merge_contrasts_results(), model_analyse(), model_summary(), moderated_p_deqms_long(), moderated_p_limma(), moderated_p_limma_long(), new_lm_imputed(), pivot_model_contrasts_to_wide(), plot_lmer_peptide_predictions(), sim_build_models_lm(), sim_build_models_lmer(), sim_build_models_logistf(), sim_make_model_lm(), sim_make_model_lmer(), strategy_limma(), strategy_limpa(), strategy_logistf(), summary_ROPECA_median_p.scaled()

Examples

mm <- data.frame(
  sigma = c(0.25, 0.32, 0.28, 0.40, 0.35),
  df = rep(6, 5),
  statistic = c(2.1, -1.8, 0.5, 3.0, -2.2),
  diff = c(0.8, -0.6, 0.2, 1.2, -0.9),
  count = c(2, 3, 4, 6, 8)
)
res <- moderated_p_deqms(mm, count_col = "count")
#> Warning: span too small.   fewer data values than degrees of freedom.
#> Warning: pseudoinverse used at 0.99
#> Warning: neighborhood radius 1.01
#> Warning: reciprocal condition number  0
#> Warning: There are other near singularities as well. 1.0201
"moderated.p.value" %in% colnames(res)
#> [1] TRUE