This repository contains an end-to-end Python pipeline for survival analysis and exploratory biomarker discovery in lung adenocarcinoma using a real public cancer cohort.
The workflow uses the LUAD TCGA PanCancer Atlas study from cBioPortal, combines clinical survival data with RNA-seq expression data, screens candidate biomarkers for association with overall survival, constructs a simple expression-based risk score, and generates figures, summary tables, and a report automatically.
The analysis uses the public Lung Adenocarcinoma PanCancer Atlas study from cBioPortal:
- Study identifier:
luad_tcga_pan_can_atlas_2018 - Sources:
https://datahub.assets.cbioportal.org/luad_tcga_pan_can_atlas_2018.tar.gzhttps://download.cbioportal.org/luad_tcga_pan_can_atlas_2018.tar.gz
This study provides both patient survival data and RNA-seq expression data, making it suitable for an end-to-end biomarker discovery workflow.
The pipeline performs the following steps:
- downloads and extracts the LUAD study archive
- loads patient-level clinical data, sample-level clinical data, and RNA-seq expression data
- filters to primary tumor samples with valid overall survival information
- tests candidate biomarkers for survival association using a log-rank framework
- ranks biomarkers by statistical signal
- builds a simple multi-gene risk score from the top biomarkers
- stratifies patients into high-risk and low-risk groups
- generates Kaplan-Meier curves, biomarker plots, and summary tables
- writes a markdown summary report
After a successful run, the pipeline writes:
output/processed/top_biomarkers.tsvoutput/processed/risk_scored_patients.tsvoutput/reports/analysis_summary.mdoutput/figures/kaplan_meier_risk_groups.pngoutput/figures/top_biomarkers.pngoutput/figures/risk_score_distribution.pngoutput/figures/best_biomarker_expression.png
.
├── run_pipeline.py
├── requirements.txt
├── pyproject.toml
├── src/survival_pipeline/
│ ├── analysis.py
│ ├── data.py
│ └── pipeline.py
└── tests/
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python3 run_pipeline.pyThis project is intended to demonstrate practical survival analysis and biomarker discovery using real public clinical and molecular data. The biomarker screen and risk model are exploratory rather than clinical-grade, but they show how clinical endpoints and RNA-seq measurements can be integrated into a reproducible computational biology workflow.
python3 -m unittest discover -s tests -vMIT License. See LICENSE.