ROPECA contrast analysis facade
ROPECA contrast analysis facade
Details
Encapsulates the pipeline: strategy_lm ->
build_model -> Contrasts ->
ContrastsROPECA.
ROPECA operates on peptide-level data and aggregates peptide-level
p-values to the protein level. The lfqdata object must contain
peptide-level data (i.e. hierarchyDepth >= 2).
See also
Other modelling:
Contrasts,
ContrastsDEqMSFacade,
ContrastsFirth,
ContrastsLMFacade,
ContrastsLMMissingFacade,
ContrastsLimma,
ContrastsLimmaFacade,
ContrastsLmerFacade,
ContrastsMissing,
ContrastsModerated,
ContrastsModeratedDEqMS,
ContrastsPlotter,
ContrastsProDA,
ContrastsROPECA,
ContrastsTable,
INTERNAL_FUNCTIONS_BY_FAMILY,
LR_test(),
Model,
ModelFirth,
ModelLimma,
build_contrast_analysis(),
build_model(),
build_model_limma(),
build_model_logistf(),
contrasts_fisher_exact(),
get_anova_df(),
get_complete_model_fit(),
get_p_values_pbeta(),
group_label(),
isSingular_lm(),
linfct_all_possible_contrasts(),
linfct_factors_contrasts(),
linfct_from_model(),
linfct_matrix_contrasts(),
merge_contrasts_results(),
model_analyse(),
model_summary(),
moderated_p_deqms(),
moderated_p_deqms_long(),
moderated_p_limma(),
moderated_p_limma_long(),
my_contest(),
my_contrast(),
my_contrast_V1(),
my_contrast_V2(),
my_glht(),
pivot_model_contrasts_2_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_logistf(),
summary_ROPECA_median_p.scaled()
Methods
Method new()
initialize
Usage
ContrastsROPECAFacade$new(lfqdata, modelstr, contrasts, ...)Arguments
lfqdataLFQData object with peptide-level data (hierarchyDepth >= 2)
modelstrmodel formula string (e.g. "~ group_")
contrastsnamed character vector of contrasts
...passed to
strategy_lm
Method get_contrasts()
Get contrast results with standardized column names.
ROPECA's beta.based.significance is mapped to p.value and
FDR.beta.based.significance to FDR.
Columns not directly produced by ROPECA are derived heuristically:
std.error = diff / statistic(algebraic: t = estimate / SE)sigma = mad.estimate(MAD of peptide fold changes)df = n_not_na(number of contributing peptides)conf.low/conf.highviadiff ± qt(0.975, df) * |std.error|
Method to_wide()
convert results to wide format
Usage
ContrastsROPECAFacade$to_wide(columns = c("p.value", "FDR", "statistic"))Examples
istar <- sim_lfq_data_peptide_config()
#> creating sampleName from fileName column
#> completing cases
#> completing cases done
#> setup done
istar$config <- old2new(istar$config)
lfqdata <- LFQData$new(istar$data, istar$config)
lfqdata <- lfqdata$get_Transformer()$log2()$lfq
#> Column added : log2_abundance
contrasts <- c("A_vs_Ctrl" = "group_A - group_Ctrl")
fa <- ContrastsROPECAFacade$new(lfqdata, "~ group_", contrasts)
#> Joining with `by = join_by(protein_Id, peptide_Id)`
head(fa$get_contrasts())
#> determine linear functions:
#> get_contrasts -> contrasts_linfct
#> contrasts_linfct
#> Joining with `by = join_by(protein_Id, peptide_Id, contrast)`
#> # A tibble: 6 × 14
#> # Groups: contrast [1]
#> facade protein_Id modelName contrast avgAbd diff FDR statistic
#> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 ropeca 0EfVhX~0087 ROPECA A_vs_Ctrl 4.27 -0.0742 0.0528 -1.75
#> 2 ropeca 7cbcrd~5725 ROPECA A_vs_Ctrl 4.51 0.741 0.0000991 8.79
#> 3 ropeca 9VUkAq~4703 ROPECA A_vs_Ctrl 4.47 -0.598 0.00000691 -12.7
#> 4 ropeca BEJI92~5282 ROPECA A_vs_Ctrl 4.23 0.277 0.00187 3.94
#> 5 ropeca CGzoYe~2147 ROPECA A_vs_Ctrl 4.76 -0.310 0.0000374 -9.26
#> 6 ropeca DoWup2~5896 ROPECA A_vs_Ctrl 4.43 0.295 0.00000138 14.7
#> # ℹ 6 more variables: std.error <dbl>, df <int>, p.value <dbl>, conf.low <dbl>,
#> # conf.high <dbl>, sigma <dbl>
fa$to_wide()
#> # A tibble: 10 × 5
#> protein_Id diff.A_vs_Ctrl p.value.A_vs_Ctrl FDR.A_vs_Ctrl statistic.A_vs_Ctrl
#> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 0EfVhX~00… -0.0742 0.0423 0.0528 -1.75
#> 2 7cbcrd~57… 0.741 0.0000496 0.0000991 8.79
#> 3 9VUkAq~47… -0.598 0.00000138 0.00000691 -12.7
#> 4 BEJI92~52… 0.277 0.00112 0.00187 3.94
#> 5 CGzoYe~21… -0.310 0.0000150 0.0000374 -9.26
#> 6 DoWup2~58… 0.295 0.000000138 0.00000138 14.7
#> 7 Fl4JiV~86… 0.0700 0.740 0.823 2.08
#> 8 HvIpHG~90… -0.384 0.00000389 0.0000130 -7.28
#> 9 JcKVfU~96… -0.0634 0.00218 0.00312 -1.87
#> 10 SGIVBl~57… -0.122 0.993 0.993 -3.88