Holds the column-role mapping and behaviour flags that describe how a
specific contrast backend (lm, limma, SAINT, ...) lays out its result
table. Mirrors AnalysisConfiguration for the modelling
side: it carries names, not data.
Consumers that need to operate on a contrast table generically
(filter, build ORA inputs, build rank lists, summarise per protein)
should read column names through the accessors on this object rather
than hard-coding them. This lets backends with different column
conventions (e.g. SAINT's BFDR/log2_EFCs) plug into the
same downstream code path as LM-style backends without renaming
columns.
Defaults match the standard prolfqua contrast schema produced by
Contrasts, ContrastsLimma,
ContrastsModerated etc.
Public fields
subject_idcolumns identifying the contrast subject (e.g. protein id)
model_name_colcolumn carrying the model name label
contrast_colcolumn carrying the contrast label
effect_colcolumn with the (signed) effect size; for LM this is
diff, for SAINTlog2_EFCsscore_colcolumn with the per-contrast test statistic
pvalue_colcolumn with the raw p-value, or
NA_character_for backends that do not produce one (e.g. SAINTexpress)fdr_colcolumn with the FDR / BFDR / adjusted p-value
avg_abundance_colcolumn with the per-feature mean abundance
supports_dea_qcwhether the backend supports the legacy differential-expression QC HTML report
needs_saint_annotationwhether the backend needs annotation reading in SAINT mode (bait / control columns)
significance_directionalif
TRUE, the backend only considers positive-effect features biologically meaningful (e.g. SAINTexpress, where negativelog2_EFCsare not interpreted as "down" hits). Affectsfilter_significant(): whenTRUEthe filter is one-sided on the effect column; whenFALSEit is symmetric (|effect| > threshold).
Methods
Method new()
Construct a ContrastConfiguration. All arguments map directly to fields of the same name.
Usage
ContrastConfiguration$new(
subject_id = character(),
model_name_col = "modelName",
contrast_col = "contrast",
effect_col = "diff",
score_col = "statistic",
pvalue_col = "p.value",
fdr_col = "FDR",
avg_abundance_col = "avgAbd",
supports_dea_qc = TRUE,
needs_saint_annotation = FALSE,
significance_directional = FALSE
)Arguments
subject_idcolumns identifying the contrast subject
model_name_colmodel-name column
contrast_colcontrast-label column
effect_colsigned effect column
score_coltest-statistic column
pvalue_colraw p-value column, or
NA_character_fdr_colFDR / adjusted-p column
avg_abundance_colmean-abundance column
supports_dea_qcsupports DEA QC HTML
needs_saint_annotationneeds SAINT-mode annotation
significance_directionalone-sided filter on effect column
Examples
cfg <- ContrastConfiguration$new(subject_id = "protein_Id")
cfg$effect_col
#> [1] "diff"
cfg$fdr_col
#> [1] "FDR"
cfg$has_pvalue()
#> [1] TRUE
cfg$supports_dea_qc
#> [1] TRUE
# SAINT-flavoured config
saint <- ContrastConfiguration$new(
subject_id = "protein_Id",
contrast_col = "Bait",
effect_col = "log2_EFCs",
score_col = "SaintScore",
pvalue_col = NA_character_,
fdr_col = "BFDR",
supports_dea_qc = FALSE,
needs_saint_annotation = TRUE
)
saint$has_pvalue()
#> [1] FALSE