grin.assoc.expr.outcome: Association Between Gene Expression and Clinical Outcomes

View source: R/grin.assoc.expr.outcome.R

grin.assoc.expr.outcomeR Documentation

Association Between Gene Expression and Clinical Outcomes

Description

Performs gene-level association analyses between gene expression and clinical outcomes. Time-to-event outcomes stored as Surv objects are analyzed using Cox proportional hazards regression, while binary outcomes coded as 0 and 1 are analyzed using logistic regression.

For each clinical outcome, a separate regression model is fitted for every gene to evaluate the association between that gene's expression and the outcome. Models can optionally be adjusted for one or more clinical covariates.

Usage

grin.assoc.expr.outcome(expr.mtx,
                        clin.data,
                        annotation.data,
                        clinvars,
                        covariate = NULL)

Arguments

expr.mtx

A data frame containing 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 values.

clin.data

A data frame containing clinical information. The data frame must contain a column named ID with subject identifiers that correspond to the subject identifiers in expr.mtx.

annotation.data

A gene annotation data frame containing a column named gene with unversioned Ensembl gene IDs matching those in the gene column of expr.mtx. Annotation information is merged with the association results using these gene IDs.

clinvars

A character vector specifying the clinical outcome variables to analyze. Time-to-event outcomes must be stored in clin.data as Surv objects created using survival::Surv(). Binary outcomes must be numeric and coded as 0 and 1.

covariate

Optional character vector specifying one or more clinical covariates to include in the regression models. Covariates may be categorical or numeric. If NULL, models are fitted without covariate adjustment.

Details

Subject identifiers in the expression data and clinical data are matched and reordered before analysis.

For time-to-event outcomes stored as Surv objects, a separate Cox proportional hazards model is fitted for each gene using coxph. The reported hazard ratio represents the relative change in hazard associated with a one-unit increase in the expression value used as input to the model.

Cox models that generate convergence warnings are excluded from downstream inference. The hazard ratio, confidence interval, p value, and q value for these genes are returned as NA, and a warning reports the number of models that did not converge. When categorical covariates are included, sparse categories or categories with few or no outcome events may lead to model convergence problems. Users should review the distribution of covariates and outcome events when a large number of adjusted models fail to converge.

For binary outcomes coded numerically as 0 and 1, a separate logistic regression model is fitted for each gene using glm with family = "binomial". The reported odds ratio represents the change in the odds of the outcome coded as 1 associated with a one-unit increase in expression.

Numeric outcomes containing values other than 0 and 1 are not analyzed and generate a warning. Continuous outcomes should be analyzed using an appropriate regression model outside this function.

When covariate is provided, the specified covariates are included together with gene expression in each Cox proportional hazards or logistic regression model.

P values are adjusted for multiple testing using the Benjamini-Hochberg false discovery rate procedure together with the Pounds and Cheng estimator of the proportion of tests having a true null hypothesis: pi.hat = min(1, 2 * mean(p)).

Cox proportional hazards models assume proportional hazards. Users should evaluate this assumption when interpreting genes of particular interest.

Value

A data frame containing gene annotation information together with outcome-specific association results.

For time-to-event outcomes, results include:

  • Hazard ratio (HR).

  • Lower bound of the 95 percent confidence interval.

  • Upper bound of the 95 percent confidence interval.

  • Cox proportional hazards model p value.

  • Multiple-testing-adjusted q value.

For binary outcomes, results include:

  • Odds ratio (OR).

  • Lower bound of the 95 percent confidence interval.

  • Upper bound of the 95 percent confidence interval.

  • Logistic regression p value.

  • Multiple-testing-adjusted q value.

Cox models that do not converge are retained in the output with NA values for their model statistics.

Author(s)

Abdelrahman Elsayed abdelrahman.elsayed@stjude.org and Stanley Pounds stanley.pounds@stjude.org

References

Cox, D. R. (1972). Regression Models and Life-Tables. Journal of the Royal Statistical Society: Series B (Methodological), 34(2), 187-202.

Nelder, J. A., & Wedderburn, R. W. M. (1972). Generalized Linear Models. Journal of the Royal Statistical Society: Series A (General), 135(3), 370-384.

Pounds, S., & Cheng, C. (2006). Robust estimation of the false discovery rate. Bioinformatics, 22(16), 1979-1987.

Examples

# Load the example datasets
data(expr_data)
data(clin_data)
data(hg38_gene_annotation)

# Create the event-free survival object
clin_data$EFS <- survival::Surv(clin_data$efs.time,
                                clin_data$efs.censor)

# Specify the survival endpoint
clinvars <- c("EFS")

# Run Cox proportional hazards models
coxph.efs <- grin.assoc.expr.outcome(
  expr.mtx = expr_data,
  clin.data = clin_data,
  annotation.data = hg38_gene_annotation,
  clinvars = clinvars
)

# Run Cox proportional hazards models with covariate adjustment
coxph.efs.adj <- grin.assoc.expr.outcome(
  expr.mtx = expr_data,
  clin.data = clin_data,
  annotation.data = hg38_gene_annotation,
  clinvars = clinvars,
  covariate = "WBC"
)

# A binary outcome coded as 0 and 1 can also be analyzed
clinvars <- c("MRD.binary")

logistic.mrd <- grin.assoc.expr.outcome(
  expr.mtx = expr_data,
  clin.data = clin_data,
  annotation.data = hg38_gene_annotation,
  clinvars = clinvars
)


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