| name | bulkrna-survival |
| description | Survival analysis for bulk RNA-seq — Kaplan-Meier curves, Cox proportional hazards, expression-based patient stratification. |
| version | 0.3.0 |
| author | OmicsClaw |
| license | MIT |
| tags | ["bulkrna","survival","Kaplan-Meier","Cox","hazard-ratio","clinical"] |
| requires | ["numpy","pandas","matplotlib","scipy"] |
| metadata | {"omicsclaw":{"domain":"bulkrna","emoji":"📈","trigger_keywords":["survival","Kaplan-Meier","Cox","prognosis","hazard ratio","overall survival","clinical outcome"],"allowed_extra_flags":["--clinical","--cutoff-method","--genes"],"legacy_aliases":["bulk-survival"],"saves_h5ad":false}} |
Bulk RNA-seq Survival Analysis
Expression-based survival analysis for clinical bulk RNA-seq datasets. Stratifies patients by gene expression (median split or optimal cutoff), generates Kaplan-Meier plots, computes log-rank tests, and fits Cox proportional hazards models.
Core Capabilities
- Median-split or optimal-cutoff patient stratification by gene expression
- Kaplan-Meier survival curves with confidence intervals
- Log-rank test for comparing survival between expression groups
- Cox proportional hazards regression (univariate and multivariate)
- Multi-gene signature scoring and survival association
- Forest plot of hazard ratios for multiple genes
Why This Exists
- Without it: Researchers must combine expression data with clinical metadata in R, use the
survival/survminer packages, manually iterate over genes, and create separate plots — often requiring significant R expertise.
- With it: A single Python command performs expression-stratified survival analysis with Kaplan-Meier curves, log-rank tests, and Cox regression from a count matrix and clinical metadata file.
- Why OmicsClaw: Pure Python implementation using
lifelines (optional) with built-in fallback to scipy-based log-rank, integrated into the OmicsClaw reporting framework.
Algorithm / Methodology
Kaplan-Meier Estimation
- Sort patients by event time
- Compute survival probability at each time point: S(t) = ∏(1 - d_i/n_i)
- Greenwood's formula for confidence intervals
Log-Rank Test
- Compare survival distributions between high/low expression groups
- Chi-square test statistic with 1 degree of freedom
Cox Proportional Hazards
- Model: h(t|x) = h₀(t) × exp(β₁x₁ + β₂x₂ + ...)
- Estimates hazard ratios and 95% confidence intervals
- Concordance index (C-index) for model assessment
Patient Stratification
- Median split: Divide at median expression value
- Optimal cutoff: Maximize log-rank statistic across all possible cutpoints
Landmark Survival
When median survival is not reached (KM curve never crosses 50%), landmark survival rates are more robust. The system automatically computes S(t) with 95% CI at fixed time points (e.g., 1yr, 3yr, 5yr).
Clinical Validity Checks