Skip to content

khaled-ghanem/early-cancer-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🩸 Early Cancer Detection: A Transcriptomic Fingerprint in a Single Blood Drop

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.

Python R XGBoost LightGBM SHAP Jupyter

⚠️ Research and educational project. Not a medical device and not for clinical use.


📋 Table of Contents


🎯 The Challenge

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).

🧠 The Approach

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.


🔗 Pipeline

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

🧬 Step 1 — Data Preprocessing & Bioinformatics

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).

🤖 Step 2 — Machine Learning Pipeline

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

📊 Step 3 — Results

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.


🔬 Explainable AI (SHAP)

  • Goal — identify which transcripts drive the model's predictions.
  • Biomarker gold — SHAP revealed genes such as ENSG00000158578 as key cancer signatures.
  • Biological insight — these genes can be fed into Gene Set Enrichment (GSE) analysis to reveal the biological pathways they affect.

📁 Repository Structure

.
├── 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

🛠️ Tech Stack

Bioinformatics (R): ThromboSeq · DESeq2 · edgeR · RUVSeq Machine Learning (Python): scikit-learn · XGBoost · LightGBM · imbalanced-learn (SMOTE) · SHAP


⚠️ Limitations

  • 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. 🩸

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors