Skip to content

Latest commit

 

History

History
121 lines (86 loc) · 4.36 KB

File metadata and controls

121 lines (86 loc) · 4.36 KB

Cancer Variant Annotation and Prioritization Pipeline

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.

Dataset

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.

Workflow

The pipeline performs the following steps:

  1. downloads and extracts the cBioPortal study archive
  2. loads mutation, sample-level clinical, and patient-level clinical data
  3. retains coding and splice variants relevant to interpretation
  4. scores variants using a transparent rule-based prioritization model
  5. summarizes the most frequently mutated genes across the cohort
  6. calculates per-sample mutation burden
  7. summarizes variant classifications
  8. generates an oncoprint-style mutation matrix for top genes
  9. writes result tables, plots, and a markdown summary report

Results

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:

  • PIK3CA in 346 samples
  • TP53 in 346 samples
  • CDH1 in 127 samples
  • GATA3 in 127 samples
  • KMT2C in 97 samples
  • MAP3K1 in 89 samples

The highest-priority variants included recurrent truncating or splice-site events in genes with clear relevance to breast cancer biology, including:

  • BRCA1
  • BRCA2
  • CDH1

These results are consistent with well-established mutation patterns in breast cancer and support the usefulness of the prioritization approach for exploratory interpretation.

Prioritization Logic

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.

Output Files

After a successful run, the pipeline writes:

  • output/processed/prioritized_variants.tsv
  • output/processed/top_mutated_genes.tsv
  • output/processed/sample_mutation_burden.tsv
  • output/processed/variant_classification_counts.tsv
  • output/reports/analysis_summary.md
  • output/figures/mutation_burden_histogram.png
  • output/figures/top_mutated_genes.png
  • output/figures/variant_classifications.png
  • output/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.

Repository Structure

.
├── run_pipeline.py
├── requirements.txt
├── pyproject.toml
├── src/variant_pipeline/
│   ├── analysis.py
│   ├── data.py
│   └── pipeline.py
└── tests/

Running the Pipeline

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python3 run_pipeline.py

Implementation Notes

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

Testing

python3 -m unittest discover -s tests -v

License

MIT License. See LICENSE.