Neoantigen discovery
RNA-seq reads to ranked MHC-I neoantigen candidates for mouse cancer vaccine research.
Read the case studyProjects
Four projects from sequencing reads to survival curves: what each one set out to answer, how it was built, and what came out.
Overview
RNA-seq reads to ranked MHC-I neoantigen candidates for mouse cancer vaccine research.
Read the case studyKaplan-Meier, log-rank and Cox models linking tumour expression to outcome, with a live explorer.
Read the case studyQuality control to annotated cell types in scanpy, packaged as a reproducible pipeline.
Read the case studyA regression CNN that counts cell types in microscopy images without segmenting them.
Read the case study01Genomics
Personalised cancer vaccines need a shortlist of tumour mutations whose peptides the immune system can see. Finding them means going from raw sequencing reads to mutations, then to peptides, then to a prediction of which peptides bind MHC class I.
An end-to-end Nextflow DSL2 pipeline for mouse RNA-seq (GRCm39). Reads are trimmed and aligned with STAR (or GPU alignment with NVIDIA Parabricks), variants are called with Strelka2, hard-filtered with GATK and annotated with Ensembl VEP. Mutant peptides of 8 to 11 amino acids are scored with NetMHCpan-4.1 against H-2-Kb and H-2-Db and ranked by a priority score. Every step runs in Docker or Singularity containers, locally, on SLURM or on Google Cloud Batch.
In industry at Genevation, containerised FASTQ-to-VCF pipelines on the same toolchain (STAR, Strelka2, GATK and VEP) cut analysis turnaround from five days to two per sample batch. NetMHCpan predictions were combined with a cancer-specific XGBoost classifier to prioritise neoantigens for preclinical vaccine studies in mouse skin, colon and lung cancer.
02Statistics
Which tumour gene-expression features say something about a patient's outcome, and do they add anything beyond the clinical variables a doctor already has?
A modular Python pipeline using lifelines: Kaplan-Meier estimation, a univariate Cox screen with a hazard ratio per standard deviation of expression and Benjamini-Hochberg FDR, the log-rank test on a median split of the leading feature, and a multivariate Cox model adjusted for age, tumour size, grade and ER status. It is built to pull TCGA cohorts from the public cBioPortal API. When that is unreachable it falls back to a real breast cancer cohort bundled with the repository: Desmedt et al. (2007), GEO GSE7390, 198 patients with time to distant metastasis as the outcome.
Re-running the pipeline on the bundled cohort: 51 of the 198 patients developed distant metastases. Across 76 expression probes, the strongest univariate signal was probe 203306_s_at (hazard ratio 0.64 per SD, p = 0.0009), but no probe passed an FDR of 0.05, so the screen is exploratory. ER status separates the curves (log-rank p = 0.010), and the multivariate model reaches a C-index of 0.677. Explore the curves below.
Loading the cohort…
| Group | Patients | Metastases |
|---|---|---|
| All patients | ||
| All patients | 198 | 51 |
| ER status log-rank p = 0.010 | ||
| ER-positive | 134 | 28 |
| ER-negative | 64 | 23 |
| Tumour grade log-rank p = 0.276 | ||
| Grade 1 | 30 | 4 |
| Grade 2 | 83 | 23 |
| Grade 3 | 83 | 24 |
| Probe 203306_s_at, median split log-rank p = 0.006 | ||
| 203306_s_at high | 99 | 17 |
| 203306_s_at low | 99 | 34 |
| Probe 202240_at, median split log-rank p < 0.001 | ||
| 202240_at high | 99 | 38 |
| 202240_at low | 99 | 13 |
| Probe 204014_at, median split log-rank p = 0.060 | ||
| 204014_at high | 99 | 20 |
| 204014_at low | 99 | 31 |
| Probe 218883_s_at, median split log-rank p = 0.061 | ||
| 218883_s_at high | 99 | 30 |
| 218883_s_at low | 99 | 21 |
| Probe 208180_s_at, median split log-rank p = 0.009 | ||
| 208180_s_at high | 99 | 33 |
| 208180_s_at low | 99 | 18 |
03Single cell
A blood sample holds many immune cell types mixed together. Single-cell RNA-seq can separate them, but only after careful quality control, normalisation and clustering of thousands of noisy cells.
An end-to-end scanpy workflow on the 10x Genomics PBMC3k dataset (about 2,700 peripheral blood mononuclear cells). Cells are filtered by median absolute deviation (5 MADs on counts, genes and mitochondrial fraction, plus a 15% mitochondrial cap), normalised and log-transformed, reduced to the top 2,000 highly variable genes and 50 principal components, then embedded with UMAP, clustered with Leiden and annotated by scoring canonical PBMC marker signatures. It ships as a notebook and as a command-line pipeline with fixed seeds.
On the repository's synthetic validation dataset, which mimics PBMC3k with 2,700 cells, low-quality cells and doublets, the pipeline resolves 9 Leiden clusters and annotates them as 7 cell types: B cells, CD4 and CD8 T cells, NK cells, CD14 and FCGR3A monocytes, and platelets. With internet access the same code runs on the real PBMC3k data.
04Deep learning
Measuring the mix of cell types in a microscopy image usually means segmenting every cell first, which is slow and fragile. Could a network predict the composition directly?
R-Net, an MSc Biomedical Engineering project at Imperial College London (2023), is a custom convolutional network in TensorFlow and Keras that regresses the percentage of three cell types straight from simulated microscopy images. It stacks convolution blocks with batch normalisation and dropout, and trains on images expanded with an OpenCV augmentation pipeline. It was benchmarked against VGG16, ResNet, MobileNet and an MNIST-derived baseline.
R-Net reached R² = 0.76 (0.7576, MSE 0.0072), against 0.40 for ResNet and 0.32 for VGG16, and trained in about 1.5 hours where the larger networks took 3 to 4.
| Model | R² | Training |
|---|---|---|
| R-Net | 0.758 | ~1.5 h |
| ResNet | 0.403 | ~4 h |
| MNIST baseline | 0.392 | ~1.5 h |
| VGG16 | 0.322 | ~4 h |
| MobileNet | 0.096 | ~3 h |