Multi-cancer early detection from platelet RNA sequencing (RNA-seq). Platelets act like "molecular sponges," absorbing RNA released by tumors — effectively carrying the cancer's transcriptomic fingerprint throughout the bloodstream. This project builds a bioinformatics + machine learning pipeline that reads that fingerprint to distinguish cancer patients from healthy controls.
⚠️ Research and educational project. Not a medical device and not for clinical use.
- The Challenge
- The Approach
- Pipeline
- Step 1 — Data Preprocessing & Bioinformatics
- Step 2 — Machine Learning Pipeline
- Step 3 — Results
- Explainable AI (SHAP)
- Repository Structure
- Tech Stack
- Limitations
There is a need for non-invasive, early-stage cancer screening that works across multiple cancer types. This project explores platelet RNA-seq as that signal source.
- Key insight: platelets absorb tumor-released RNA, carrying a cancer transcriptomic fingerprint in the blood.
- Data overview: 2,351 RNA-seq samples (cancer patients vs. healthy controls).
A two-stage pipeline: a bioinformatics stage (R) that cleans and normalizes raw RNA-seq counts and finds differentially expressed genes, followed by a machine learning stage (Python) that trains and stacks multiple models into a final ensemble.
Raw RNA-seq counts
│
▼
Bioinformatics (ThromboSeq, R) → Normalization · Batch correction · DE analysis · Filtering
│
▼
Feature engineering (Python) → Top 300 differentially expressed genes + SMOTE
│
▼
Model training → XGBoost · LightGBM · SVM · NN · Decision Tree
│
▼
Stacking meta-model (Champion) → Prediction + SHAP explainability
Raw RNA-seq count matrices from multiple centers were inconsistent and noisy, so the project uses the specialized ThromboSeq bioinformatics pipeline:
- Normalization — DESeq2 / edgeR for RNA-seq count data.
- Batch correction — RUVSeq to eliminate technical variation between sequencing centers.
- Differential expression analysis — identifying genes (cancer vs. control).
- Filtering — multiple testing correction (FDR < 0.005).
Feature engineering
- Selection of 300 differentially expressed genes as model input features, based on correlation factor.
- SMOTE applied to handle class imbalance (original distribution: 80.6% cancer / 19.4% control → balanced to 50/50).
Models
| Group | Models | Role |
|---|---|---|
| 🌳 Tree Masters | XGBoost, LightGBM | Efficient, high-performance |
| 🔍 Pattern Hunters | SVM, Neural Network | Capture complex patterns |
| 📏 Interpretable Baseline | Decision Tree | For comparison |
| 🏆 The Champion | Ensemble Stacking Meta-Model | Combines all models' predictions |
Overall highlight — Stacking Meta-Model: 95.8% AUC
| Metric | Value |
|---|---|
| Accuracy | 0.9481 |
| Balanced accuracy | 0.9240 |
| Sensitivity | 0.9633 |
| Specificity | 0.8846 |
| Precision | 0.9722 |
| F1 | 0.9677 |
| AUC | 0.9575 |
| Average precision | 0.9854 |
Robustness across test settings
| Test | Setting | AUC |
|---|---|---|
| Test 1 | Asymptomatic controls (clean cancer signal) | 95.8% |
| Test 3 | Symptomatic patients (noise from inflammation, medication, other diseases) | 86.8% |
The real win — early-stage detection
| Stage | Detection accuracy | Sample size |
|---|---|---|
| Stage I | 100% | n = 19 |
| Stage II | 100% | n = 35 |
| Later stages | ~95% | — |
Detecting Stage I and II cancers is the clinically hardest and most valuable case — this is where early, non-invasive screening matters most.
- Goal — identify which transcripts drive the model's predictions.
- Biomarker gold — SHAP revealed genes such as
ENSG00000158578as key cancer signatures. - Biological insight — these genes can be fed into Gene Set Enrichment (GSE) analysis to reveal the biological pathways they affect.
.
├── count-matrix-preprocessing.r # Count matrix preprocessing (R)
├── thromboSeqTools_PreProcessing.R # ThromboSeq preprocessing utilities (R)
├── thromboSeqTools_ANOVA.R # ThromboSeq ANOVA / differential expression (R)
├── models-training.ipynb # ML pipeline: training, evaluation, SHAP (notebook)
├── models-training.py # ML pipeline (script version)
└── .Rhistory # R session history
Bioinformatics (R): ThromboSeq · DESeq2 · edgeR · RUVSeq Machine Learning (Python): scikit-learn · XGBoost · LightGBM · imbalanced-learn (SMOTE) · SHAP
- Symptomatic-patient performance drops (AUC 86.8%) — real-world noise from inflammation, medication, and comorbidities reduces the signal.
- Small early-stage samples — Stage I (n = 19) and Stage II (n = 35) accuracies are promising but based on limited data; larger cohorts are needed to confirm.
- Results reflect this dataset and may not transfer directly to unseen populations or sequencing centers without re-validation.
Reading the cancer's fingerprint — from a single blood drop. 🩸