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 to be used 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 of three data tables: "row.mtch" (gene matching info), "alex.expr" (expression matrix), and "alex.lsn" (lesion matrix). Rows are ordered by Ensembl gene IDs, and columns are ordered by patient IDs.

alex.kw.results

Kruskal Wallis test results for gene expression by lesion group, as returned by KW.hit.express.

gene

Gene of interest, specified by either its gene symbol or Ensembl ID.

lsn.data

Lesion data in GRIN-compatible format. A data frame with five required columns: "ID" (patient ID), "chrom" (chromosome), "loc.start" (lesion start), "loc.end" (lesion end), and "lsn.type" (lesion type; e.g., gain, loss, mutation, fusion, etc...).

Details

This function extracts and combines lesion and expression data for a specified gene across patients. It returns a data table showing each patient's lesion status and expression level for the gene. It also extracts the corresponding Kruskal Wallis test result and all lesions that affect the gene from the lesion data.

Value

A list with the following components:

gene.lsn.exp

A data table with three columns: "ID" (patient ID), "<gene_name>_lsn" (lesion status: e.g., none, gain, mutation, multiple), and "<gene_name>_expr" (expression level of the gene in that patient).

lsns

A data table of all lesions affecting the gene of interest, extracted from the input lesion data (GRIN-compatible format).

stats

A one-row data frame containing the Kruskal Wallis test result for the gene, from KW.hit.express.

gene.ID

The gene name (symbol or Ensembl ID) provided as input.

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 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 June 17, 2025, 9:11 a.m.