Performs pairwise and paired non-parametric tests. The default is Mann-
Whitney U test, use is_paired
for Wilcoxon signed rank tests.
Usage
perform_non_parametric(
object,
formula_char,
is_paired = FALSE,
id = NULL,
all_features = FALSE,
assay.type = NULL,
...
)
Arguments
- object
a
SummarizedExperiment
orMetaboSet
object- formula_char
character, the formula to be used in the tests
- is_paired
logical, use paired test
- id
character, name of the subject identification column for paired version
- all_features
should all features be included in FDR correction?
- assay.type
character, assay to be used in case of multiple assays
- ...
other parameters passed to test
wilcox.test
Details
P-values of each comparison are corrected separately from each other. The 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 features during model fitting. For example, if testing for equality of means in study groups, use "Feature ~ Group".
Examples
data(example_set)
# Including QCs as a study group for example for pairwise tests
mann_whitney_results <- perform_non_parametric(example_set,
formula_char = "Feature ~ Group")
#> INFO [2025-06-23 22:37:32] Starting tests for A & B
#> INFO [2025-06-23 22:37:32] Tests performed
#> INFO [2025-06-23 22:37:33] Starting tests for A & QC
#> INFO [2025-06-23 22:37:33] Tests performed
#> Joining with `by = join_by(Feature_ID)`
#> INFO [2025-06-23 22:37:33] Starting tests for B & QC
#> INFO [2025-06-23 22:37:34] Tests performed
#> Joining with `by = join_by(Feature_ID)`
# Using paired mode (pairs with QC are skipped as there are no common IDs in
# 'example_set')
wilcoxon_signed_results <- perform_non_parametric(example_set,
formula_char = "Feature ~ Time",
is_paired = TRUE,
id = "Subject_ID")
#> INFO [2025-06-23 22:37:34] Starting paired tests for 1 & 2
#> INFO [2025-06-23 22:37:34] Found 20 complete pairs.
#> INFO [2025-06-23 22:37:34] Paired tests performed.
#> INFO [2025-06-23 22:37:34] Starting paired tests for 1 & QC
#> INFO [2025-06-23 22:37:34] Found 0 complete pairs.
#> Warning: Skipped 1 & QC: no common IDs.
#> Joining with `by = join_by(Feature_ID)`
#> INFO [2025-06-23 22:37:34] Starting paired tests for 2 & QC
#> INFO [2025-06-23 22:37:34] Found 0 complete pairs.
#> Warning: Skipped 2 & QC: no common IDs.
#> Joining with `by = join_by(Feature_ID)`
# Only two groups
mann_whitney_results <- perform_non_parametric(drop_qcs(example_set),
formula_char = "Feature ~ Group")
#> INFO [2025-06-23 22:37:34] Starting tests for A & B
#> INFO [2025-06-23 22:37:35] Tests performed