alex.prep.lsn.expr: Prepare Lesion and Expression Data for Kruskal-Wallis Test

View source: R/alex.prep.lsn.expr.R

alex.prep.lsn.exprR Documentation

Prepare Lesion and Expression Data for Kruskal-Wallis Test

Description

Prepares matched gene-level lesion and expression data matrices for use with KW.hit.express, which performs Kruskal-Wallis tests to assess associations between genomic lesion groups and gene expression levels.

Usage

alex.prep.lsn.expr(
  expr.mtx,
  lsn.data,
  gene.annotation,
  min.expr = NULL,
  min.pts.lsn = NULL
)

Arguments

expr.mtx

A data frame containing normalized gene expression data with genes in rows and subjects in columns. The first column must be named "gene" and contain unique, unversioned Ensembl gene IDs (e.g., "ENSG00000148400"). Ensembl version suffixes such as ".5" in "ENSG00000148400.5" are not supported and should be removed before analysis. Gene symbols should be converted to Ensembl gene IDs before using this function. All remaining columns must correspond to subjects and contain numeric expression measurements; missing values (NA) are allowed.

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; e.g., mutation, gain, deletion, or structural rearrangement).

gene.annotation

A gene annotation data frame, either supplied by the user or retrieved using get.ensembl.annotation. It must contain the columns "gene" (Ensembl gene ID), "chrom" (chromosome), "loc.start" (gene start position), and "loc.end" (gene end position).

min.expr

Optional numeric value specifying the minimum total expression required for a gene to be retained. Total expression is calculated as the sum of expression values across the matched subjects. If NULL, genes are not filtered according to total expression.

min.pts.lsn

Optional numeric value specifying the minimum number of subjects with at least one genomic lesion affecting a gene for that gene to be retained. If NULL, genes are not filtered according to lesion frequency.

Details

Genomic lesions are first mapped to genes using prep.gene.lsn.data and find.gene.lsn.overlaps. The resulting gene-lesion overlaps are then converted to a gene-by-subject lesion-type matrix using prep.lsn.type.matrix.

Only subjects represented in both the lesion and expression datasets are retained. Genes may additionally be filtered according to min.expr and min.pts.lsn. The lesion and expression matrices are subsequently restricted to their shared set of genes and ordered identically by Ensembl gene ID and subject ID.

The resulting matched matrices can be supplied directly to KW.hit.express for lesion-expression association analysis.

Value

A list with the following components:

alex.expr

A numeric matrix of gene expression data with Ensembl gene IDs as row names and subject IDs as column names.

alex.lsn

A data frame containing lesion groups for the same genes and subjects and in the same order as alex.expr.

alex.row.mtch

A data frame containing the matched Ensembl gene IDs from the expression and lesion matrices.

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

KW.hit.express, prep.gene.lsn.data, find.gene.lsn.overlaps, prep.lsn.type.matrix, get.ensembl.annotation

Examples

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

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

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