Gradient Biotech

Survival analysis

Survival analysis connects molecular features to clinical outcomes — Kaplan-Meier curves, log-rank testing, multivariate Cox regression, and longitudinal molecular trajectories.

Uses the lifelines library for Kaplan-Meier estimation, log-rank tests, and Cox proportional hazards regression.

Prerequisites

  • Clinical CSV with patient_id, time_to_event_days, and event_observed columns
  • Optional feature CSV with molecular variables for stratification and Cox covariates
  • Optional longitudinal CSV for treatment timepoint trajectories

Launching the pipeline

Open the study Survival page, select your clinical dataset (and optional feature/longitudinal datasets), set the stratification field and Cox covariates, and click Run survival analysis.

Key parameters

ParameterDefaultPurpose
clinical_pathPatient survival table
feature_pathMolecular features for stratification and Cox models
longitudinal_pathTimepoint feature trajectories
stratify_byColumn for Kaplan-Meier group stratification
cox_covariates[]Columns included in multivariate Cox regression

Outputs

OutputDescription
kaplan_meierSurvival curve data per stratification group
logrankLog-rank test statistic and p-value
cox_regressionHazard ratios, confidence intervals, and p-values per covariate
longitudinalFeature trajectory summaries across timepoints

The frontend Survival page renders patient/event/group counts, the log-rank test statistic and p-value, and the three visualizations described below.

Visualizations

Kaplan-Meier survival curves

An interactive step-function chart with one line per stratification group, sharing a common time axis. Hovering shows the day, survival probability, and current at-risk/event counts for each group at that point. Each group's median survival (or "not reached" if the curve never crosses 50%) is also listed below the chart.

Cox regression forest plot

One row per covariate from the multivariate Cox model, sorted by p-value (strongest association first). Each row plots the hazard ratio as a point with its 95% confidence interval as a whisker, on a shared log-scale axis with a reference line at HR = 1 (no effect) — the standard forest-plot layout. HR > 1 means higher hazard (worse survival); HR < 1 is protective. Rows with p < 0.05 are marked. With small cohorts, Cox regression can produce very wide confidence intervals for some covariates (quasi-complete separation). The chart's shared axis makes that instability visible rather than hiding it.

Longitudinal feature summary

When a longitudinal dataset is supplied, a table lists each tracked feature's cohort mean value and the average per-patient change from its first to last recorded timepoint, sorted by magnitude of change so the features that moved the most lead the list.

Typical use cases

  • Compare overall survival between treatment arms
  • Stratify survival by TMB, immune phenotype, or gene signature score
  • Test whether molecular features independently predict outcome in multivariate Cox models
  • Track CD8 score or other biomarkers across baseline and on-treatment timepoints

Next steps