Skip to content

Ahsansayz/AI-Driven-Multi-Omics-Gastric-Cancer-Subtyping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧬 AI-Driven Multi-Omics Gastric Cancer Subtyping

A Biological Hybrid AI pipeline for molecular subtyping of gastric cancer integrating WES mutational signatures, DNA methylation, and clinical data

Results β€’ Architecture β€’ Install β€’ Quick Start β€’ Methodology

Python 3.8+ MIT License TCGA-STAD COSMIC v3.4 Multi-Omics 281 Features


πŸ“‹ Overview

An end-to-end multi-omics pipeline for classifying TCGA-STAD gastric cancer into 5 molecular subtypes β€” CIN, EBV, GS, MSI, and POLE.

Standard ML classifiers suffer from the accuracy paradox β€” a model can hit ~89% accuracy by favoring the majority CIN class while catastrophically failing on rare but clinically critical subtypes like POLE (1.9% of samples) and GS (12.3%). This pipeline solves that with the Biological Hybrid AI (BHAI) framework β€” deterministic biological rules for POLE and GS that supplement SMOTE-XGBoost where synthetic data alone isn't enough.

Data Layer Source Samples
Somatic Mutations GDC Masked MAF files (WES) 431
DNA Methylation Illumina 450K Ξ²-values 457
Clinical Labels GDC + cBioPortal 375 labelled

Improved version of Machine-Learning-Mutational-Signatures
Original used MAF only β†’ this adds DNA methylation, 20 driver gene features, and the Hybrid AI framework.


πŸ† Key Results

Stepwise Performance

Strategy Accuracy Macro F1 MSI Recall GS Recall POLE Recall
SMOTE + XGBoost Baseline 89.3% 0.812 100% 41.3% 28.6%
+ Hybrid Biological Rules 90.5% 0.847 100% 58.7% 57.1%
+ Threshold Optimisation 91.2% 0.860 100% 63.0% 57.1%

Per-Class Breakdown (Final Model)

Subtype Precision Recall F1-Score Support
CIN 0.94 0.96 0.95 219
EBV 0.90 0.83 0.86 30
GS 0.72 0.63 0.67 46
MSI 0.99 1.00 0.99 73
POLE 0.80 0.57 0.67 7

Highlights

  • POLE recall: 28.6% β†’ 57.1% via single biological rule (SBS10 + TMB)
  • GS recall: 41.3% β†’ 63.0% via CDH1/RHOA mutation logic + threshold tuning
  • MSI recall: 100% maintained across all strategies
  • COSMIC reconstruction: 0.933 avg cosine similarity across 431 samples

Figures

t-SNE/UMAP Signature Heatmap

SHAP Importance Survival Curves


πŸ—οΈ Pipeline Architecture

 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚                      INPUT DATA SOURCES                       β”‚
 β”‚  MAF Files (431)   β”‚  Methylation (457)  β”‚  Clinical (GDC)    β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                     β”‚
         β–Ό                       β”‚                     β”‚
 β”Œβ”€ Step 1 ─────────────┐       β”‚                     β”‚
 β”‚ Process MAF Files     β”‚       β”‚                     β”‚
 β”‚ β€’ 96-ch SBS Matrix    β”‚       β”‚                     β”‚
 β”‚ β€’ 20 Driver Genes     β”‚       β”‚                     β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚                     β”‚
         β–Ό                       β”‚                     β”‚
 β”Œβ”€ Step 2 ─────────────┐       β”‚                     β”‚
 β”‚ NMF Extraction (k=9)  β”‚       β”‚                     β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚                     β”‚
         β–Ό                       β”‚                     β”‚
 β”Œβ”€ Step 3 ─────────────┐       β”‚                     β”‚
 β”‚ COSMIC v3.4 NNLS      β”‚       β”‚                     β”‚
 β”‚ 83 active signatures  β”‚       β”‚                     β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚                     β”‚
         β”‚                       β”‚                     β”‚
         β–Ό                       β–Ό                     β–Ό
 β”Œβ”€ Step 4 ─────────────────────────────────────────────────────┐
 β”‚ Multi-Omics Feature Matrix β†’ 281 features                    β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
 β”Œβ”€ Step 5 ─────────────┐
 β”‚ Methylation Processingβ”‚
 β”‚ Two-pass, RAM-optimizedβ”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β–Ό
 β”Œβ”€ Step 6 ─────────────────────────────────────────────────────┐
 β”‚ Biological Hybrid AI Classification                          β”‚
 β”‚  POLE Rule (SBS10+TMB) β”‚ GS Rule (CDH1/RHOA) β”‚ SMOTE-XGB   β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β–Ό
 β”Œβ”€ Step 7 ─────────────┐
 β”‚ Visualization (SHAP,  β”‚
 β”‚ t-SNE, UMAP, Survival)β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Repository Structure

β”œβ”€β”€ 02_methylation_data/          # Processed methylation features
β”‚   β”œβ”€β”€ methylation_features.csv
β”‚   β”œβ”€β”€ methylation_pca.csv          (30 PCA components)
β”‚   β”œβ”€β”€ methylation_targeted.csv     (MLH1, CDH1, CDKN2A, MGMT, BRCA1, RUNX3)
β”‚   └── methylation_summary.csv      (CIMP score, global stats)
β”‚
β”œβ”€β”€ 03_pipeline_scripts/          # Core pipeline
β”‚   β”œβ”€β”€ step1_process_maf.py         β†’ SBS96 + gene features
β”‚   β”œβ”€β”€ step2_extract_signatures.py  β†’ NMF (k=9)
β”‚   β”œβ”€β”€ step3_cosmic_assignment.py   β†’ COSMIC v3.4 NNLS
β”‚   β”œβ”€β”€ step4_build_features.py      β†’ 281-feature matrix
β”‚   β”œβ”€β”€ step5_process_methylation.py β†’ Two-pass methylation
β”‚   β”œβ”€β”€ step6_classify.py            β†’ Hybrid AI classifier
β”‚   β”œβ”€β”€ step7_visualize.py           β†’ Publication figures
β”‚   └── run_pipeline.sh              β†’ Master runner
β”‚
β”œβ”€β”€ 07_figures/                   # Publication-ready figures
β”œβ”€β”€ 08_clinical_data/             # Clinical + subtype labels
β”œβ”€β”€ 09_documentation/             # Detailed docs
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ LICENSE
└── README.md

βš™οΈ Installation

git clone https://github.com/Ahsansayz/AI-Driven-Multi-Omics-Gastric-Cancer-Subtyping.git
cd AI-Driven-Multi-Omics-Gastric-Cancer-Subtyping

python -m venv venv
source venv/bin/activate

pip install -r requirements.txt

Data Setup

  1. MAF Files β€” Download TCGA-STAD masked somatic MAFs from GDC β†’ 01_raw_data/maf_files/
  2. COSMIC Reference β€” Download COSMIC v3.4 SBS signatures β†’ 01_raw_data/cosmic_reference/
  3. Methylation (optional) β€” Pre-processed features already included in 02_methylation_data/

πŸš€ Quick Start

# Full pipeline
bash 03_pipeline_scripts/run_pipeline.sh

# Individual steps
python 03_pipeline_scripts/step1_process_maf.py      # MAF β†’ SBS96 + genes
python 03_pipeline_scripts/step2_extract_signatures.py # NMF extraction
python 03_pipeline_scripts/step3_cosmic_assignment.py  # COSMIC mapping
python 03_pipeline_scripts/step4_build_features.py     # Feature matrix
python 03_pipeline_scripts/step5_process_methylation.py # Methylation
python 03_pipeline_scripts/step6_classify.py           # Classification
python 03_pipeline_scripts/step7_visualize.py          # Figures

# Run specific steps only
bash 03_pipeline_scripts/run_pipeline.sh 6 7

🧠 Methodology

Biological Hybrid AI

Three strategies combined:

1. POLE Override β€” SBS10 total > threshold + TMB > 7.0 mut/Mb + MSI safeguard (SBS15 check)
2. GS Rescue β€” Evidence scoring: CDH1 truncating (3pt) + RHOA (2pt) + CDH1 missense (1pt) + TP53 wt (1pt). Override at score β‰₯ 3 when ML confidence < 0.50
3. SMOTE-XGBoost β€” 500 trees, stratified 5-fold CV, per-class threshold optimization

281 Feature Matrix

Block Count Source
COSMIC activities (abs + proportional) 166 NNLS fitting
Engineered + Clinical 15 TMB, MSI burden, age, etc.
Methylation (targeted + PCA + summary) 47 Two-pass processing
Gene mutations (20 genes Γ— binary + count + CDH1 detail + variant stats) 53 MAF parsing
Total 281

Comparison with Original Pipeline

Original This Version
Data MAF only MAF + Methylation + Clinical
Features ~179 281
Gene Mutations ❌ βœ… 20 driver genes
Methylation ❌ βœ… CpGs + CIMP + PCA
Classification XGBoost Hybrid Biological AI
POLE Recall ~28% 57.1%
GS Recall ~41% 63.0%
Accuracy ~85% 91.2%

πŸ“„ License

MIT License β€” see LICENSE


Built for precision oncology research

About

Biological Hybrid AI pipeline for molecular subtyping of gastric cancer using multi-omics data (WES + DNA methylation + clinical). 91.2% accuracy, 100% MSI recall, 57.1% POLE recall.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors