top.alex.waterfall.plots: Generate Waterfall Plots for Significant Genes

View source: R/top.alex.waterfall.plots.R

top.alex.waterfall.plotsR Documentation

Generate Waterfall Plots for Significant Genes

Description

Generates waterfall plots for genes showing significant associations between lesion status and gene expression based on Kruskal-Wallis (KW) test results. Genes with KW q-values below a user-specified threshold are selected for plotting.

Usage

top.alex.waterfall.plots(out.dir,
                         alex.data,
                         alex.kw.results,
                         q,
                         lsn.data)

Arguments

out.dir

Character string specifying the directory where the waterfall plot PDF files will be saved. The directory must already exist.

alex.data

A list returned by alex.prep.lsn.expr containing the matched expression and lesion data used for lesion-expression association analyses.

alex.kw.results

Kruskal-Wallis lesion-expression association results returned by KW.hit.express.

q

Numeric; KW q-value threshold used to select genes for plotting. Genes with q.KW < q are included.

lsn.data

Lesion data in GRIN-compatible format, as used in alex.prep.lsn.expr.

Details

The function selects genes from alex.kw.results with non-missing q.KW values below the specified q threshold and with available gene symbols. Duplicate gene symbols are represented once.

For each selected gene, alex.waterfall.prep prepares the corresponding lesion and expression data and alex.waterfall.plot generates a waterfall plot showing gene expression across patients according to lesion status.

Each gene is saved as a separate PDF file named ⁠<gene>_waterfall_plot.pdf⁠ in out.dir.

Value

Invisibly returns NULL. The function creates one PDF waterfall plot for each selected gene in the specified output directory. If no genes meet the specified q-value threshold, no PDF files are created.

Author(s)

Abdelrahman Elsayed abdelrahman.elsayed@stjude.org and 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, alex.waterfall.prep, alex.waterfall.plot

Examples

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

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

# 2) Run Kruskal-Wallis lesion-expression association analysis
alex.kw.results <- KW.hit.express(alex.data,
                                  hg38_gene_annotation,
                                  min.grp.size = 5)

# 3) Create a temporary output directory and generate waterfall plots
resultsFolder <- file.path(tempdir(), "temp.out")
dir.create(resultsFolder, showWarnings = FALSE, recursive = TRUE)

top.alex.waterfall.plots(out.dir = resultsFolder,
                         alex.data = alex.data,
                         alex.kw.results = alex.kw.results,
                         q = 1e-15,
                         lsn.data = lesion_data)

# Clean up
unlink(resultsFolder, recursive = TRUE)


GRIN2 documentation built on Aug. 22, 2026, 5:09 p.m.