Limma moderated contrasts
Limma moderated contrasts
Other modelling:
Contrasts
,
ContrastsMissing
,
ContrastsPlotter
,
ContrastsProDA
,
ContrastsROPECA
,
ContrastsTable
,
INTERNAL_FUNCTIONS_BY_FAMILY
,
LR_test()
,
Model
,
build_model()
,
contrasts_fisher_exact()
,
get_anova_df()
,
get_complete_model_fit()
,
get_p_values_pbeta()
,
isSingular_lm()
,
linfct_all_possible_contrasts()
,
linfct_factors_contrasts()
,
linfct_from_model()
,
linfct_matrix_contrasts()
,
merge_contrasts_results()
,
model_analyse()
,
model_summary()
,
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_make_model_lm()
,
sim_make_model_lmer()
,
strategy_lmer()
,
summary_ROPECA_median_p.scaled()
prolfqua::ContrastsInterface
-> ContrastsModerated
Contrast
Class implementing the Contrast interface
modelName
name of model
subject_Id
columns with subject_Id (proteinID)
p.adjust
function to adjust p-values
Inherited methods
new()
initialize
ContrastsModerated$new(
Contrast,
modelName = paste0(Contrast$modelName, "_moderated"),
p.adjust = prolfqua::adjust_p_values
)
get_Plotter()
get ContrastsPlotter
to_wide()
convert to wide format
ContrastsModerated$to_wide(columns = c("p.value", "FDR", "statistic"))
istar <- sim_lfq_data_protein_config(Nprot = 50)
#> creating sampleName from fileName column
#> completing cases
protIntensity <- istar$data
config <- istar$config
lProt <- LFQData$new(protIntensity, config)
lProt$rename_response("transformedIntensity")
modelFunction <-
strategy_lm("transformedIntensity ~ group_")
mod <- build_model(
lProt,
modelFunction)
#> Joining with `by = join_by(protein_Id)`
Contr <- c("dil.b_vs_a" = "group_A - group_Ctrl")
contrast <- prolfqua::Contrasts$new(mod,
Contr)
contrast <- ContrastsModerated$new(contrast)
bb <- contrast$get_contrasts()
#> determine linear functions:
#> Warning: Warn 'linfct_matrix_contrasts':In argument: `dil.b_vs_a = group_A - group_Ctrl`.
#> Warning: Warn 'linfct_matrix_contrasts':In argument: `avg_dil.b_vs_a = (group_A + group_Ctrl)/2`.
#> compute contrasts:
#> computing contrasts.
#> Joining with `by = join_by(protein_Id, contrast)`
csi <- ContrastsMissing$new(lProt, contrasts = Contr)
contrast$get_contrasts() |> dim()
#> [1] 49 13
(xx <- csi$get_contrasts()) |> dim()
#> [1] "group_"
#> completing cases
#> dil.b_vs_a=group_A - group_Ctrl
#> dil.b_vs_a=group_A - group_Ctrl
#> dil.b_vs_a=group_A - group_Ctrl
#> [1] 50 20
merged <- merge_contrasts_results(contrast, csi)
#> Joining with `by = join_by(protein_Id, contrast)`
#> Joining with `by = join_by(protein_Id, contrast)`
merged$more$get_contrasts() |> dim()
#> [1] 1 13
stopifnot(all(dim(merged$merged$get_contrasts() == c(50,13))))
stopifnot(all(dim(merged$same$get_contrasts()) == c(49,13)))
cs <- contrast$get_contrast_sides()
cslf <- contrast$get_linfct()
ctr <- contrast$get_contrasts()
ctrwide <- contrast$to_wide()
cp <- contrast$get_Plotter()
print(cp$histogram()$p.value, vp=NULL)
print(cp$histogram()$FDR, vp = NULL)
cp$volcano()
#> $FDR
#>
cp$ma_plot()