Skip to contents

Fits a linear model separately for each feature and compute an ANOVA table. Returns all relevant statistics.

Usage

perform_lm_anova(
  object,
  formula_char,
  all_features = FALSE,
  lm_args = NULL,
  anova_args = NULL,
  assay.type = NULL
)

Arguments

object

a SummarizedExperiment or MetaboSet object

formula_char

character, the formula to be used in the linear model (see Details)

all_features

should all features be included in FDR correction?

lm_args

list of arguments to lm, list names should be parameter names

anova_args

list of arguments to anova, list names should be parameter names

assay.type

character, assay to be used in case of multiple assays

Value

A data frame with one row per feature, with all the relevant statistics of the linear model as columns.

Details

The linear model is fit on combined_data(object). Thus, column names in pheno data can be specified. To make the formulas flexible, the word "Feature" must be used to signal the role of the features in the formula. "Feature" will be replaced by the actual Feature IDs during model fitting, see the example.

See also

Examples

data(example_set)
# A simple example without QC samples
# Features predicted by Group and Time
lm_anova_results <- perform_lm_anova(drop_qcs(example_set), 
  formula_char = "Feature ~ Group + Time")
#> INFO [2025-06-23 22:37:27] Starting ANOVA tests
#> INFO [2025-06-23 22:37:27] ANOVA tests performed