alex.boxplots: Generate Box Plots of Gene Expression by Lesion Groups

View source: R/alex.boxplots.R

alex.boxplotsR Documentation

Generate Box Plots of Gene Expression by Lesion Groups

Description

Generates box plots of gene expression levels stratified by lesion groups for a subset of genes selected based on a user-specified q-value threshold from Kruskal Wallis test results.

Usage

alex.boxplots(out.dir, alex.data, alex.kw.results, q, gene.annotation)

Arguments

out.dir

Path to the directory where the resulting PDF file containing the box plots will be saved.

alex.data

A list returned by the alex.prep.lsn.expr function, containing three components: "row.mtch", "alex.expr" (gene expression matrix), and "alex.lsn" (lesion matrix). Rows of alex.expr and alex.lsn is ordered by Ensembl gene IDs; columns represent patient IDs.

alex.kw.results

Output of the KW.hit.express function containing Kruskal Wallis test results.

q

Q-value threshold. Only genes with q-values below this threshold will be included in the output plots.

gene.annotation

A data.frame containing gene annotation data, either provided by the user or retrieved using get.ensembl.annotation. Must contain four columns: "gene" (Ensembl gene ID), "chrom" (chromosome), "loc.start" (start position), and "loc.end" (end position).

Value

A PDF file saved in out.dir, containing one box plot per page for each selected gene, showing gene expression distribution across lesion groups.

Author(s)

Abdelrahman Elsayed abdelrahman.elsayed@stjude.org, Stanley Pounds stanley.pounds@stjude.org

References

Cao, X., Elsayed, A. H., & Pounds, S. B. (2023). Statistical Methods Inspired by Challenges in Pediatric Cancer Multi-omics.

See Also

alex.prep.lsn.expr, KW.hit.express

Examples

data(expr_data)
data(lesion_data)
data(hg38_gene_annotation)

# Prepare expression and lesion data
alex.data <- alex.prep.lsn.expr(expr_data, lesion_data,
                                hg38_gene_annotation, min.expr = 5, min.pts.lsn = 5)

# Run Kruskal Wallis test
alex.kw.results <- KW.hit.express(alex.data, hg38_gene_annotation, min.grp.size = 5)

# Generate box plots for significant genes
dir.create(resultsFolder <- file.path(tempdir(), "temp.out"))
alex.boxplots(out.dir = resultsFolder,
              alex.data = alex.data,
              alex.kw.results = alex.kw.results,
              q = 1e-15,
              gene.annotation = hg38_gene_annotation)
unlink(resultsFolder, recursive = TRUE)

GRIN2 documentation built on June 17, 2025, 9:11 a.m.