perform_wilcox_test: Wilcoxon-Mann-Whitney U-Test for Differential Gene Expression

View source: R/U-Test.R

perform_wilcox_testR Documentation

Wilcoxon-Mann-Whitney U-Test for Differential Gene Expression

Description

Performs the Wilcoxon rank-sum (Mann-Whitney U) test for every gene (row) in the expression matrix, applies BH correction, and returns a results table together with the list of significant DEGs.

Usage

perform_wilcox_test(
  dataframe,
  con1,
  con2,
  exp1,
  exp2,
  alpha = 0.05,
  annot_df = NULL
)

Arguments

dataframe

A numeric matrix or data.frame of gene expression values (rows = genes, columns = samples). Values are automatically log2- transformed when they appear to be on a linear / intensity scale.

con1

Integer. Index of the first control column.

con2

Integer. Index of the last control column.

exp1

Integer. Index of the first experiment column.

exp2

Integer. Index of the last experiment column.

alpha

Numeric significance threshold for BH-adjusted p-values (default 0.05).

annot_df

Optional annotation data.frame with columns ID and Gene.Symbol (or Gene.symbol). When NULL (default) row names of dataframe are used as gene identifiers.

Value

A named list:

Table

Data.frame with columns G_Symbol, log2FC, statistic.W, p.value, BH, fdr.

DEGs

Data.frame of significant gene identifiers.

Examples

library(DGEAR)
data("gene_exp_data")
result <- perform_wilcox_test(dataframe = gene_exp_data,
                              con1 = 1, con2 = 10,
                              exp1 = 11, exp2 = 20)
head(result$Table)
result$DEGs

DGEAR documentation built on July 3, 2026, 9:07 a.m.