Zahin Peerzade
Unsupervised and supervised ML pipeline applied to bulk RNA-seq data from the GTEx project to classify tissue types from gene expression profiles.
Using gene expression data from 4 tissue types — Liver, Brain (Cerebellum), Skin (Suprapubic), and Muscle (Skeletal) — this notebook builds a full ML pipeline from raw counts to tissue classification:
- PCA — Reduces 15,000-gene expression matrix to a compact representation via manual eigen-decomposition (no sklearn PCA for the unsupervised steps)
- K-Means Clustering — Custom implementation clusters samples in PCA space; elbow method selects k=4
- Cluster Validation — Manual NumPy-only implementations of Silhouette Score and Adjusted Rand Index
- Logistic Regression — sklearn LR with L2 regularization trained on PCA-reduced features; regularization strength tuned across C ∈ {0.01, 0.1, 1, 10}
- Cross-Validation — 5-fold CV on training set across accuracy, precision, recall, and F1
- Gene Annotation — Top contributing genes identified from PCA loadings and annotated via MyGene.info API
GTEx v8 (Genotype-Tissue Expression project)
- Expression matrix:
GTEx_Analysis_2017-06-05_v8_RNASeQCv1.1.9_gene_tpm.gct - Sample metadata:
GTEx_Analysis.txt - Top 15,000 genes by expression used for computational tractability
Data is not included in this repo due to size. Download from gtexportal.org.
pip install pandas numpy matplotlib scikit-learn requests- Download GTEx expression matrix and metadata (links above)
- Place both files in the same directory as the notebook
- Open
gtex_tissue_classification.ipynband run all cells
| Method | Metric | Score |
|---|---|---|
| K-Means (k=4) | Adjusted Rand Index | ~0.9+ |
| K-Means (k=4) | Silhouette Score | ~0.4+ |
| Logistic Regression (C=0.1) | Test Accuracy | ~1.00 |
| Logistic Regression (C=0.1) | 5-fold CV F1 (macro) | ~1.00 ± 0.00 |
The four tissues are highly separable in PCA space — muscle and liver in particular show strong clustering driven by tissue-specific expression programs.
gtex-tissue-classification/
├── gtex_tissue_classification.ipynb # Full pipeline notebook
└── README.md
- GTEx Consortium. The GTEx Consortium atlas of genetic regulatory effects across human tissues. Science. 2020.
- Pedregosa et al. Scikit-learn: Machine Learning in Python. JMLR. 2011.
- MyGene.info: mygene.info