View source: R/top.alex.waterfall.plots.R
| top.alex.waterfall.plots | R Documentation |
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.
top.alex.waterfall.plots(out.dir,
alex.data,
alex.kw.results,
q,
lsn.data)
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.kw.results |
Kruskal-Wallis lesion-expression association results
returned by |
q |
Numeric; KW q-value threshold used to select genes for plotting.
Genes with |
lsn.data |
Lesion data in GRIN-compatible format, as used in
|
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.
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.
Abdelrahman Elsayed abdelrahman.elsayed@stjude.org and Stanley Pounds stanley.pounds@stjude.org
Cao, X., Elsayed, A. H., & Pounds, S. B. (2023). Statistical Methods Inspired by Challenges in Pediatric Cancer Multi-omics.
alex.prep.lsn.expr,
KW.hit.express,
alex.waterfall.prep,
alex.waterfall.plot
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.