alex.waterfall.prep: Prepare Lesion and Expression Data for Waterfall Plots

View source: R/alex.waterfall.prep.R

alex.waterfall.prepR Documentation

Prepare Lesion and Expression Data for Waterfall Plots

Description

Prepares matched lesion and expression data for a selected gene for use with the alex.waterfall.plot function.

Usage

alex.waterfall.prep(
  alex.data,
  alex.kw.results,
  gene,
  lsn.data
)

Arguments

alex.data

Output from alex.prep.lsn.expr. A list containing "alex.expr" (expression data), "alex.lsn" (lesion-group data), and "alex.row.mtch" (matched Ensembl gene IDs). The expression and lesion data contain genes in rows and subjects in columns, with matching row and column order.

alex.kw.results

Kruskal-Wallis lesion-expression association results returned by KW.hit.express. The data frame must contain "gene" with Ensembl gene IDs and "gene.name" with gene symbols, together with gene coordinates and the Kruskal-Wallis results.

gene

Gene of interest specified by either its gene symbol or Ensembl gene ID. The value must match exactly one gene in alex.kw.results.

lsn.data

A data frame containing genomic lesion data in GRIN-compatible format. It must contain the columns "ID" (subject ID), "chrom" (chromosome), "loc.start" (lesion start position), "loc.end" (lesion end position), and "lsn.type" (lesion type).

Details

The function identifies the selected gene in the Kruskal-Wallis results and extracts its matched lesion-group and expression values across subjects from alex.data. It also identifies all lesions in lsn.data whose genomic coordinates overlap the selected gene.

The gene symbol is used to label the lesion and expression columns when available. If the gene symbol is missing, the Ensembl gene ID is used instead.

Value

A list with the following components:

gene.lsn.exp

A data frame containing subject ID, lesion-group status, and gene expression. The lesion and expression columns are named "<gene>.lsn" and "<gene>.RNA", respectively.

lsns

A data frame containing all lesions in lsn.data that overlap the genomic coordinates of the selected gene.

stats

A one-row data frame containing the Kruskal-Wallis lesion-expression association results for the selected gene.

gene.ID

The gene symbol used to label the output columns, or the Ensembl gene ID when a gene symbol is unavailable.

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, alex.waterfall.plot

Examples

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

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

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

# Prepare lesion and expression data for waterfall plot of WT1
WT1.waterfall.prep <- alex.waterfall.prep(alex.data,
                                          alex.kw.results,
                                          "WT1",
                                          lesion_data)

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