perform_h_test: Half's Modified t-Test for Differential Gene Expression

View source: R/H-Test.R

perform_h_testR Documentation

Half's Modified t-Test for Differential Gene Expression

Description

Computes a modified t-statistic (sometimes called "Half's t-test") that uses only the control standard deviation in its denominator, applies BH correction, and returns a results table together with the list of significant DEGs.

Usage

perform_h_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, p.value, BH, fdr.

DEGs

Data.frame of significant gene identifiers.

Examples

library(DGEAR)
data("gene_exp_data")
result <- perform_h_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.