This repository contains an end-to-end Python pipeline for somatic variant annotation and prioritization using a real public breast cancer genomics cohort.
The workflow uses the BRCA TCGA PanCancer Atlas study from cBioPortal, starting from the downloaded mutation and clinical data files and proceeding through variant filtering, rule-based prioritization, cohort-level mutation summaries, and report generation. The pipeline produces ranked variant tables, mutation burden summaries, an oncoprint-style visualization, and a short report.
The analysis uses the public Breast Invasive Carcinoma PanCancer Atlas study from cBioPortal:
- Study identifier:
brca_tcga_pan_can_atlas_2018 - Source:
https://download.cbioportal.org/brca_tcga_pan_can_atlas_2018.tar.gz
This study provides a large real-world breast cancer mutation cohort together with mutation annotation and clinical metadata, making it a good dataset for demonstrating practical cancer genomics workflows in Python.
The pipeline performs the following steps:
- downloads and extracts the cBioPortal study archive
- loads mutation, sample-level clinical, and patient-level clinical data
- retains coding and splice variants relevant to interpretation
- scores variants using a transparent rule-based prioritization model
- summarizes the most frequently mutated genes across the cohort
- calculates per-sample mutation burden
- summarizes variant classifications
- generates an oncoprint-style mutation matrix for top genes
- writes result tables, plots, and a markdown summary report
In the current run, the pipeline produced:
- 85,488 retained coding and splice variants
- 1,009 tumor samples with retained variants
- 16,432 uniquely mutated genes
The most frequently mutated genes recovered by the pipeline included:
PIK3CAin 346 samplesTP53in 346 samplesCDH1in 127 samplesGATA3in 127 samplesKMT2Cin 97 samplesMAP3K1in 89 samples
The highest-priority variants included recurrent truncating or splice-site events in genes with clear relevance to breast cancer biology, including:
BRCA1BRCA2CDH1
These results are consistent with well-established mutation patterns in breast cancer and support the usefulness of the prioritization approach for exploratory interpretation.
Variant ranking is based on a transparent score derived from fields already present in the mutation annotation table, including:
- variant classification
- impact annotation
- hotspot status
- clinical significance
- COSMIC presence
- PolyPhen and SIFT predictions
- low ExAC allele frequency when available
- membership in a curated set of well-known breast cancer driver genes
The goal is not to reproduce a clinical-grade interpretation engine, but to demonstrate a practical and inspectable prioritization workflow using real cancer mutation data.
After a successful run, the pipeline writes:
output/processed/prioritized_variants.tsvoutput/processed/top_mutated_genes.tsvoutput/processed/sample_mutation_burden.tsvoutput/processed/variant_classification_counts.tsvoutput/reports/analysis_summary.mdoutput/figures/mutation_burden_histogram.pngoutput/figures/top_mutated_genes.pngoutput/figures/variant_classifications.pngoutput/figures/oncoprint_top_genes.png
The full filtered mutation table is also generated locally, but it is treated as an intermediate output and is typically not committed to Git because of file size.
.
├── run_pipeline.py
├── requirements.txt
├── pyproject.toml
├── src/variant_pipeline/
│ ├── analysis.py
│ ├── data.py
│ └── pipeline.py
└── tests/
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python3 run_pipeline.pyThis project is intended to demonstrate practical familiarity with cancer genomics data handling, mutation annotation, and variant prioritization in Python. The ranking model is heuristic and should be interpreted as a reproducible prioritization strategy for exploratory analysis rather than a clinical decision framework.
python3 -m unittest discover -s tests -vMIT License. See LICENSE.