Home Expertise Blog

Main Subsections

Intersting papers
  • Reading highlights
  • All posts
Computional biology
  • Modeling and analysis notes
  • All posts
R tutorials
  • R workflow tutorials
  • All posts
Applied biostats
  • Applied statistics notes
  • All posts
Methods
  • Method development updates
  • All posts

Post Navigation

  • Previous: Biostatistics Foundations for Omics Studies

Recent Posts

  • Cox Regression for Genomic and Transcriptomic Biomarker Discovery in Clinical Trials
  • Biostatistics Foundations for Omics Studies

Cox Regression for Genomic and Transcriptomic Biomarker Discovery in Clinical Trials

May 20, 2026 ~18 min read Difficulty: Intermediate

Prerequisites: Survival analysis basics, Regression modelling, RNA-seq or genomic data terminology

Category: tutorial, biostatistics

Tags: survival-analysis, cox-regression, biomarkers, genomics, transcriptomics, clinical-trials, glmnet, r-tutorials, applied-biostats, computational-biology

A practical guide to using Cox regression for prognostic and predictive biomarker discovery in clinical trials, with emphasis on transcriptomic and genomic features, penalised models, and reproducible R workflows.

Table of Contents

  • Learning Objectives
  • 1) Problem Statement
  • 2) Background: Cox Regression in Survival Analysis
  • 3) Prognostic and Predictive Biomarkers
    • 3.1 Prognostic Cox Model
    • 3.2 Predictive Cox Model
  • 4) How Cox Regression Is Used in Biomarker Discovery
    • 4.1 Testing a Pre-Specified Single Biomarker
    • 4.2 Testing a Pre-Specified Predictive Biomarker
    • 4.3 Screening Many Genes One at a Time
    • 4.4 Building a Multigene Risk Score
  • 5) High-Dimensional Genomic and Transcriptomic Data
    • 5.1 Biological Pre-Selection
    • 5.2 Dimension Reduction
    • 5.3 Penalised Cox Regression
  • 6) Practical R Workflow with glmnet
    • 6.1 Lasso-Penalised Cox Model
    • 6.2 Elastic Net Cox Model
    • 6.3 Training and Validation Workflow
    • 6.4 Exploratory Penalised Interaction Model
  • 7) Key Facets and Trends
    • 7.1 Avoid Casual Dichotomisation
    • 7.2 Adjust for Clinically Relevant Covariates
    • 7.3 Check Proportional Hazards
    • 7.4 Separate Discovery from Validation
    • 7.5 Report the Analysis Transparently
  • 8) Open Questions and Evidence-Based Speculations
    • Could some prognostic gene signatures mainly reflect tumour composition?
    • Can predictive discovery be reliable with limited event numbers?
    • Will pathway-level models generalise better than individual-gene models?
    • Can transcriptomic biomarkers transfer across platforms?
    • How should genomic and transcriptomic biomarkers be integrated?
  • 9) Future Research Directions
  • 10) Interpretation Checklist
  • Closing Note
  • References and Further Reading

Learning Objectives

This tutorial explains how Cox regression can be used for biomarker discovery in clinical trials, with emphasis on genes, transcriptomic measurements, and genomic features.

By the end, you should be able to:

  • Distinguish prognostic from predictive biomarker discovery.
  • Specify Cox models for time-to-event endpoints in clinical trials.
  • Interpret treatment-by-biomarker interaction terms.
  • Recognize why high-dimensional genomic data require penalisation or careful dimension reduction.
  • Build practical R workflows using survival and glmnet.
  • Identify common validation, reporting, and interpretation pitfalls.

1) Problem Statement

Clinical trials increasingly collect molecular data alongside clinical outcomes. In oncology and other disease areas, these data may include bulk RNA-seq, targeted expression panels, whole-exome sequencing, targeted DNA panels, copy-number profiles, methylation assays, or derived molecular scores.

These measurements create an opportunity to discover biomarkers that help explain patient outcomes or treatment benefit. For time-to-event endpoints such as overall survival, progression-free survival, disease-free survival, time to recurrence, or time to treatment failure, Cox proportional hazards regression is one of the most widely used modelling frameworks.

The challenge is that biomarker discovery in clinical trials is rarely a simple regression problem. Transcriptomic and genomic datasets may contain thousands of genes or variants, while the number of trial participants with both molecular data and events may be modest. Molecular data can also be affected by batch effects, tumour purity, sample handling, sequencing platform, missingness, and clinical selection into the molecular substudy.

A second challenge is conceptual. A gene associated with survival is not automatically a marker of treatment benefit. A biomarker can be prognostic, predictive, both, or neither. Confusing these categories can lead to over-interpretation of exploratory findings.

2) Background: Cox Regression in Survival Analysis

Survival analysis is used when the outcome is time from a defined origin to an event. In clinical trials, the time origin is often randomisation or start of treatment. The event may be death, progression, relapse, or another clinically meaningful endpoint. Patients who have not experienced the event by the end of follow-up are censored.

The Cox proportional hazards model relates covariates to the hazard of an event:

h(t | X) = h0(t) exp(β1X1 + β2X2 + ... + βpXp)

Here, h(t | X) is the hazard at time t for a patient with covariates X, h0(t) is the baseline hazard, and the regression coefficients describe associations between covariates and the hazard.

For a gene expression biomarker, a Cox model may estimate whether higher expression of a gene is associated with shorter or longer survival. The exponentiated coefficient, exp(β), is interpreted as a hazard ratio. A hazard ratio above 1 indicates higher hazard per unit increase in the covariate, while a hazard ratio below 1 indicates lower hazard, assuming the proportional hazards assumption is reasonable.

Cox regression is attractive because it handles right-censored outcomes, gives interpretable hazard ratios, and can include clinical covariates such as age, stage, performance status, treatment arm, tumour subtype, and known molecular alterations.

However, the model depends on assumptions and design choices. Important issues include proportional hazards, adequate event numbers, covariate specification, missing data handling, feature scaling, multiple testing, and validation.

3) Prognostic and Predictive Biomarkers

The distinction between prognostic and predictive biomarker discovery is central.

A prognostic biomarker provides information about the likely clinical outcome independent of treatment. For example, a gene expression signature that identifies patients with high recurrence risk in both trial arms may be prognostic.

A predictive biomarker provides information about the likely benefit or harm from a specific treatment. For example, a mutation may be predictive if patients with the mutation benefit more from an experimental therapy than from control, while patients without the mutation do not.

The FDA-NIH BEST resource distinguishes these biomarker categories and notes that prognostic and predictive biomarkers cannot generally be separated when only one treatment group is studied. A randomised comparison is usually needed for a credible predictive biomarker claim.

3.1 Prognostic Cox Model

A prognostic Cox model asks whether the biomarker is associated with outcome after adjustment for relevant covariates:

Surv(time, event) ~ biomarker + age + stage + treatment

This model may show that a gene is associated with progression-free survival. It does not show that the gene identifies patients who benefit more from a particular treatment.

3.2 Predictive Cox Model

A predictive Cox model asks whether the treatment effect differs according to biomarker status. This requires a treatment-by-biomarker interaction:

Surv(time, event) ~ treatment + biomarker + treatment:biomarker + covariates

The interaction term is the key predictive component. It estimates whether the treatment hazard ratio differs by biomarker level or biomarker-defined subgroup.

This distinction is practical, not semantic. A proliferation-related expression signature may be strongly prognostic because it identifies aggressive tumours. That does not necessarily mean patients with high proliferation benefit more from a specific drug. Conversely, a predictive biomarker may have little overall prognostic value but still modify treatment effect.

4) How Cox Regression Is Used in Biomarker Discovery

4.1 Testing a Pre-Specified Single Biomarker

The most defensible setting is a pre-specified biomarker with a clear biological or clinical rationale.

library(survival)

fit_prognostic <- coxph(
  Surv(pfs_time, pfs_event) ~ gene_expression + age + stage + treatment_arm,
  data = trial_data
)

summary(fit_prognostic)
cox.zph(fit_prognostic)

This model estimates whether gene expression is associated with progression-free survival after adjustment for clinical covariates.

4.2 Testing a Pre-Specified Predictive Biomarker

For predictive discovery or validation, the model should include the treatment-by-biomarker interaction.

library(survival)

fit_predictive <- coxph(
  Surv(pfs_time, pfs_event) ~ treatment_arm * gene_expression + age + stage,
  data = trial_data
)

summary(fit_predictive)
cox.zph(fit_predictive)

The coefficient for treatment_arm:gene_expression is the interaction term. If the biomarker is binary, the interaction estimates whether the treatment hazard ratio differs between biomarker-positive and biomarker-negative groups. If the biomarker is continuous, the interaction estimates how treatment effect changes across biomarker values.

4.3 Screening Many Genes One at a Time

A common transcriptomic workflow fits one Cox model per gene:

Surv(time, event) ~ gene_i + covariates

This can generate a ranked list of genes associated with survival. It is useful for exploratory discovery, but it requires multiple-testing correction and independent validation.

A minimal univariate screening workflow might look like this:

library(survival)
library(dplyr)
library(purrr)
library(broom)

genes <- colnames(expr_matrix)

screen_results <- map_dfr(genes, function(gene) {
  dat <- trial_data
  dat$gene_value <- expr_matrix[, gene]

  fit <- coxph(
    Surv(os_time, os_event) ~ gene_value + age + stage + treatment_arm,
    data = dat
  )

  tidy(fit) |>
    filter(term == "gene_value") |>
    mutate(gene = gene)
})

screen_results <- screen_results |>
  mutate(fdr = p.adjust(p.value, method = "BH")) |>
  arrange(fdr)

This is a discovery workflow. It should not be presented as a validated clinical biomarker model unless the complete analysis is validated in independent data.

4.4 Building a Multigene Risk Score

A multigene signature combines several genes into a risk score:

risk score = β1 × gene1 + β2 × gene2 + ... + βk × genek

The risk score can be evaluated in a validation cohort:

fit_valid <- coxph(
  Surv(os_time, os_event) ~ risk_score + age + stage,
  data = validation_data
)

summary(fit_valid)
cox.zph(fit_valid)

The key principle is that feature selection, coefficient estimation, scaling, and cut-off selection must be completed in the training data before evaluation in the validation data.

5) High-Dimensional Genomic and Transcriptomic Data

Standard Cox regression is not designed for situations where the number of molecular features greatly exceeds the number of patients or events. This is common in transcriptomic and genomic studies.

Several strategies are commonly used.

5.1 Biological Pre-Selection

Restrict the analysis to genes or features with prior biological relevance. Examples include drug targets, DNA repair genes, immune checkpoint genes, homologous recombination genes, pathway scores, or published expression modules.

This reduces the multiplicity burden and improves interpretability, but it does not remove the need for validation.

5.2 Dimension Reduction

Instead of modelling thousands of genes directly, investigators may use lower-dimensional summaries such as:

  • pathway activity scores;
  • gene set enrichment scores;
  • immune infiltration estimates;
  • principal components;
  • tumour mutational burden;
  • copy-number burden;
  • homologous recombination deficiency scores;
  • predefined expression signatures.

Dimension reduction can improve stability, but the derived features still require transparent construction and independent evaluation.

5.3 Penalised Cox Regression

Penalised Cox regression adds a regularisation penalty to reduce overfitting. Common penalties include:

  • Lasso, which can shrink some coefficients exactly to zero and therefore performs variable selection.
  • Ridge, which shrinks coefficients but usually retains all variables.
  • Elastic net, which combines lasso and ridge penalties and is often useful for correlated transcriptomic features.

The glmnet package supports regularised Cox regression using family = "cox". The package can fit lasso and elastic net Cox models across a grid of penalty values, and cv.glmnet() can be used for cross-validation.

6) Practical R Workflow with glmnet

6.1 Lasso-Penalised Cox Model

library(glmnet)
library(survival)

# x: numeric matrix, rows = patients, columns = genes or genomic features
x <- as.matrix(expr_matrix)

# y: survival outcome
y <- Surv(trial_data$os_time, trial_data$os_event)

set.seed(1)

cv_fit <- cv.glmnet(
  x = x,
  y = y,
  family = "cox",
  alpha = 1,
  nfolds = 10
)

plot(cv_fit)

coef_min <- coef(cv_fit, s = "lambda.min")
selected_genes <- rownames(coef_min)[as.vector(coef_min != 0)]

selected_genes

Here, alpha = 1 specifies the lasso penalty. The selected genes are those with non-zero coefficients at the chosen penalty value.

6.2 Elastic Net Cox Model

Gene expression features are often correlated. Elastic net can be preferable when groups of correlated genes carry related signal.

set.seed(1)

cv_fit_enet <- cv.glmnet(
  x = x,
  y = y,
  family = "cox",
  alpha = 0.5,
  nfolds = 10
)

The value of alpha controls the mixture between ridge and lasso penalties. Values closer to 1 behave more like lasso; values closer to 0 behave more like ridge.

6.3 Training and Validation Workflow

library(glmnet)
library(survival)

x_train <- as.matrix(expr_train)
y_train <- Surv(train$os_time, train$os_event)

x_valid <- as.matrix(expr_valid)

set.seed(1)

cv_fit <- cv.glmnet(
  x = x_train,
  y = y_train,
  family = "cox",
  alpha = 0.5,
  nfolds = 10
)

risk_score_valid <- predict(
  cv_fit,
  newx = x_valid,
  s = "lambda.min",
  type = "link"
)

valid$risk_score <- as.numeric(risk_score_valid)

fit_valid <- coxph(
  Surv(os_time, os_event) ~ risk_score + age + stage,
  data = valid
)

summary(fit_valid)
cox.zph(fit_valid)

This workflow keeps model development and model evaluation separate. The validation set should not influence feature filtering, penalty tuning, coefficient estimation, or cut-off selection.

6.4 Exploratory Penalised Interaction Model

Predictive discovery requires treatment-by-biomarker interaction terms. For high-dimensional transcriptomic data, one exploratory approach is to construct treatment-by-gene interaction features and use penalisation.

library(glmnet)
library(survival)

# Binary treatment variable: 0 = control, 1 = experimental
trt <- trial_data$treatment_binary

x_gene <- as.matrix(expr_matrix)

# Interaction features
x_interaction <- x_gene * trt

# Combine treatment main effect, gene main effects, and interaction effects
x_model <- cbind(
  treatment = trt,
  x_gene,
  x_interaction
)

y <- Surv(trial_data$pfs_time, trial_data$pfs_event)

set.seed(1)

cv_interaction <- cv.glmnet(
  x = x_model,
  y = y,
  family = "cox",
  alpha = 0.5,
  nfolds = 10
)

This can nominate genes whose association with outcome differs by treatment arm. It should be interpreted cautiously. Genome-wide interaction discovery is statistically demanding and usually requires larger sample sizes than main-effect prognostic modelling.

7) Key Facets and Trends

7.1 Avoid Casual Dichotomisation

Gene expression is usually continuous. Splitting expression into “high” and “low” groups can reduce power and create unstable thresholds. If a cut-off is clinically required, it should be pre-specified or learned in training data and validated independently.

Continuous modelling, restricted cubic splines, or pre-defined biological thresholds are often preferable.

7.2 Adjust for Clinically Relevant Covariates

A gene may appear prognostic because it is correlated with stage, tumour subtype, tumour purity, treatment exposure, immune infiltration, or sequencing batch. Cox models should include clinically justified covariates when available.

Common covariates in cancer genomic analyses include:

  • age;
  • sex;
  • stage or grade;
  • performance status;
  • treatment arm;
  • tumour subtype;
  • tumour purity;
  • sequencing centre or batch;
  • known driver mutations.

The correct set depends on the study design and estimand.

7.3 Check Proportional Hazards

The Cox model assumes that hazard ratios are proportional over time. This may fail when treatment effects are delayed, when biomarkers affect early but not late relapse, or when clinical management changes after progression.

In R:

cox.zph(fit_prognostic)

If the assumption is questionable, alternatives include stratified Cox models, time-varying coefficients, landmark analyses, flexible parametric survival models, or restricted mean survival time analyses.

7.4 Separate Discovery from Validation

Cross-validation is helpful for model tuning, but it is not equivalent to external validation. A biomarker model intended for clinical translation should ideally be tested in independent cohorts, using locked preprocessing and analysis code.

For genomic signatures, validation should cover the complete pipeline:

  1. specimen collection;
  2. assay protocol;
  3. normalisation and quality control;
  4. feature calculation;
  5. risk score generation;
  6. threshold application;
  7. clinical interpretation.

7.5 Report the Analysis Transparently

The REMARK guidelines were developed to improve reporting of tumour marker prognostic studies, including study design, specimen characteristics, assay methods, statistical analysis, and presentation of marker effects.

For multivariable prediction models, TRIPOD+AI provides updated reporting guidance for studies that develop or evaluate prediction models using regression or machine learning methods.

These reporting standards matter because many molecular survival models fail for preventable reasons: unclear endpoints, incomplete reporting, optimistic feature selection, insufficient validation, and overstatement of exploratory results.

8) Open Questions and Evidence-Based Speculations

Could some prognostic gene signatures mainly reflect tumour composition?

Bulk transcriptomic signatures can capture tumour, immune, stromal, and normal tissue signals. A survival-associated expression pattern may reflect immune infiltration, stromal content, necrosis, or tumour purity rather than tumour-intrinsic biology.

Can predictive discovery be reliable with limited event numbers?

Treatment-by-biomarker interactions require more information than biomarker main effects. Small molecular substudies may be underpowered for interaction testing, especially when thousands of genes are screened. Penalisation can reduce overfitting, but it cannot replace adequate sample size and event numbers.

Will pathway-level models generalise better than individual-gene models?

Pathway and module scores may be more robust across cohorts than single-gene models because they aggregate related biological signals. However, they may also obscure which cell type or molecular process drives the association.

Can transcriptomic biomarkers transfer across platforms?

A signature developed using RNA-seq may not transfer directly to microarrays, targeted panels, or formalin-fixed paraffin-embedded samples. Platform-specific validation is essential before clinical use.

How should genomic and transcriptomic biomarkers be integrated?

A useful predictive model may need to combine mutation status, copy-number alterations, gene expression, clinical covariates, and treatment assignment. The open question is whether multi-omic models improve performance enough to justify their additional complexity, cost, and validation burden.

9) Future Research Directions

First, biomarker analyses should define the objective before modelling. Prognostic and predictive discovery require different models, different interpretation, and often different trial designs.

Second, molecular substudies should plan sample size and event requirements explicitly. The number of patients with usable molecular data may be substantially smaller than the trial population.

Third, high-dimensional Cox workflows should avoid information leakage. Feature filtering, scaling, imputation, and variable selection should be performed within the training or resampling process.

Fourth, predictive biomarker studies should prioritise randomised evidence and treatment-by-biomarker interaction testing. A single-arm study may identify associations with outcome, but it usually cannot distinguish prognostic from predictive value.

Fifth, candidate biomarkers should be validated across independent datasets and platforms. Validation should assess discrimination, calibration, clinical utility, assay robustness, and reproducibility.

Finally, statistical signals should be linked back to biology. A gene selected by penalised Cox regression is a candidate feature, not necessarily a causal driver. Functional studies, perturbation experiments, and prospective validation are needed before strong clinical claims are made.

10) Interpretation Checklist

Before presenting a Cox-based genomic biomarker result, ask:

  • Is the objective prognostic or predictive?
  • Is the endpoint clearly defined?
  • Was the biomarker pre-specified or discovered post hoc?
  • Were clinical covariates selected based on the trial design and clinical context?
  • Was multiple testing addressed?
  • Was the proportional hazards assumption checked?
  • Was feature selection separated from validation?
  • Was the full molecular preprocessing workflow locked before validation?
  • Are the effect size, confidence interval, and uncertainty reported?
  • Is the conclusion consistent with the strength of evidence?

Closing Note

Cox regression remains a central tool for analysing time-to-event outcomes in clinical trials. It is useful for estimating associations between molecular features and survival, adjusting for clinical covariates, and testing treatment-by-biomarker interactions.

The main risk is not the Cox model itself, but the interpretation placed on it. Prognostic discovery asks whether a biomarker is associated with outcome. Predictive discovery asks whether the biomarker modifies treatment effect. High-dimensional genomic and transcriptomic data make both tasks more complex.

A credible biomarker analysis should be biologically motivated, statistically transparent, clinically interpretable, and independently validated.

References and Further Reading

  • FDA-NIH Biomarker Working Group. BEST (Biomarkers, EndpointS, and other Tools) Resource. National Center for Biotechnology Information. https://www.ncbi.nlm.nih.gov/books/NBK326791/
  • FDA-NIH Biomarker Working Group. Understanding Prognostic versus Predictive Biomarkers. https://www.ncbi.nlm.nih.gov/books/NBK402284/
  • FDA. About Biomarkers and Qualification. https://www.fda.gov/drugs/biomarker-qualification-program/about-biomarkers-and-qualification
  • Tay K, Simon N, Friedman J, Hastie T, Tibshirani R, Narasimhan B. Regularized Cox Regression. glmnet vignette. https://cran.r-project.org/web/packages/glmnet/vignettes/Coxnet.pdf
  • glmnet documentation. An Introduction to glmnet. https://glmnet.stanford.edu/articles/glmnet.html
  • Tay JK, Narasimhan B, Hastie T. Elastic net regularization paths for all generalized linear models. Journal of Statistical Software. 2023. https://www.jstatsoft.org/article/view/v106i01
  • McShane LM, Altman DG, Sauerbrei W, Taube SE, Gion M, Clark GM. Reporting recommendations for tumour marker prognostic studies: REMARK. British Journal of Cancer. 2005. https://www.nature.com/articles/6602678
  • Altman DG, McShane LM, Sauerbrei W, Taube SE. Reporting recommendations for tumor marker prognostic studies: explanation and elaboration. PLOS Medicine. 2012. https://journals.plos.org/plosmedicine/article?id=10.1371/journal.pmed.1001216
  • Collins GS, Moons KGM, Dhiman P, et al. TRIPOD+AI statement: updated guidance for reporting clinical prediction models that use regression or machine learning methods. BMJ. 2024. https://www.bmj.com/content/385/bmj-2023-078378