generateRef_limma: Generate Reference Signature Matrix Using Limma

View source: R/generateRef_limma.R

generateRef_limmaR Documentation

Generate Reference Signature Matrix Using Limma

Description

Performs differential expression analysis using the limma package to identify significantly expressed genes across different cell types. Computes median expression levels of these significant genes to create a reference signature matrix.

Usage

generateRef_limma(dat, pheno, FDR = 0.05)

Arguments

dat

Matrix or data frame. Gene probes in rows and samples in columns.

pheno

Character vector. Cell type class of the samples.

FDR

Numeric. Genes with BH adjusted p-value < FDR are considered significant. Default is 0.05.

Value

List containing: - 'reference_matrix': Data frame of median expression values for significantly expressed genes. - 'G': Number of probes used that resulted in the lowest condition number. - 'condition_number': Minimum condition number obtained. - 'whole_matrix': Matrix of median values across all samples.

Examples

dat <- matrix(rnorm(2000), nrow = 100)
rownames(dat) <- paste("Gene", 1:100, sep = "_")
colnames(dat) <- paste("Sample", 1:20, sep = "_")
pheno <- sample(c("Type1", "Type2", "Type3"), 20, replace = TRUE)
results <- generateRef_limma(dat, pheno)
print(results)

IOBR documentation built on May 30, 2026, 5:07 p.m.