Skip to main content

Read prolfquapp DEA results into prolfqua objects

Description

Rebuilds the standard prolfqua structures from a DEA result artifact written by [DEAReportGenerator]: the raw, transformed and (for lm_impute) imputed prolfqua::LFQData, the feature and sample annotation, the per-feature imputation summary, the contrast table with the column names the modelling backend produced, and a prolfqua::ContrastsTable carrying the backend’s prolfqua::ContrastConfiguration. Every table is keyed by the artifact’s feature_keys. Accepts a SummarizedExperiment, an anndataR AnnData, or a path to an .rds or .h5ad file.

Because the column roles travel with the artifact, consumers filter, rank and plot through the configuration instead of hard-coding column names.

Public fields

se
the SummarizedExperiment the results were read from
metadata
the artifact metadata (S4Vectors::metadata)
contrast_config
prolfqua::ContrastConfiguration of the backend that produced the results
lfq_raw
prolfqua::LFQData with the raw abundances
lfq_transformed
prolfqua::LFQData with the transformed abundances
lfq_imputed
prolfqua::LFQData with the transformed abundances and every missing value filled by the feature’s model, or NULL when the artifact has no imputedData
annotation
feature annotation, one row per feature
samples
sample annotation, one row per sample
imputation
per feature, how many values were observed and imputed and by which route, or NULL when the artifact has no imputation block
contrast_table
all contrasts stacked into one tibble
contrasts
prolfqua::ContrastsTable over contrast_table, or NULL when the artifact holds no usable contrast results
subject_id
the feature-key columns identifying a contrast subject
formula
the model formula the DEA fitted, one string, or NULL when the artifact records none
contrast_definitions
the contrasts the DEA evaluated, their expressions named by contrast

Methods

Public methods


DEAResultReader$new()

Read a DEA result artifact.

Usage
DEAResultReader\$new(source)
Arguments
source
a SummarizedExperiment, an AnnData, or a path to an .rds, .h5ad or .h5mu file; an .h5mu file is read through its dea modality

DEAResultReader$has_roles()

Does the contrast table carry these columns?

Usage
DEAResultReader\$has_roles(...)
Arguments
…
column names, or vectors of column names

DEAResultReader$significant()

Contrast rows passing both thresholds. One-sided on the effect column for backends whose negative effects are not interpretable (SAINT).

Usage
DEAResultReader\$significant(FDR_threshold = 0.05, diff_threshold = 1)
Arguments
FDR_threshold
false discovery rate threshold
diff_threshold
effect-size threshold

DEAResultReader$get_Plotter()

prolfqua::ContrastsPlotter over the contrast table, with every score panel resolved through the column roles. Returns NULL when the artifact holds no usable contrast results.

Usage
DEAResultReader\$get_Plotter(fc_threshold = 1, fdr_threshold = 0.1)
Arguments
fc_threshold
fold-change threshold
fdr_threshold
false discovery rate threshold

DEAResultReader$clone()

The objects of this class are cloneable with this method.

Usage
DEAResultReader\$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.

Examples

library("prolfquapp")

dea <- prolfquapp::example_deanalyse(Nprot = 12)
se <- prolfquapp::DEAReportGenerator$new(dea, dea$prolfq_app_config)$make_SummarizedExperiment()
reader <- prolfquapp::DEAResultReader$new(se)
reader$contrast_config$effect_col
[1] "diff"
nrow(reader$contrast_table)
[1] 24
nrow(reader$significant(FDR_threshold = 0.25, diff_threshold = 0.5))
[1] 0