Skip to content

About

End-to-end bulk RNA-seq differential expression pipeline for breast cancer using real public transcriptomics data, automated GDC download, QC, statistical testing, and visualisation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Breast Cancer RNA-seq Differential Expression Pipeline

This project is an end-to-end Python pipeline for differential expression analysis on a real public breast cancer bulk RNA-seq cohort.

It retrieves open-access RNA-seq count data from the Genomic Data Commons for the TCGA-BRCA cohort, builds a gene-level count matrix, performs tumor-versus-normal differential expression analysis, and generates output tables, visualizations, and a summary report.

Overview

The goal of this project was to build a complete and reproducible transcriptomics workflow using a real cancer dataset rather than a toy example. The pipeline is designed to cover the main stages of a practical analysis workflow, from data retrieval to interpretable outputs.

The analysis includes:

  • cohort discovery through the GDC API
  • download and parsing of raw count files
  • construction of a gene-level count matrix
  • low-expression filtering
  • CPM and log2-CPM normalization
  • tumor-versus-normal differential expression testing
  • Benjamini-Hochberg multiple testing correction
  • generation of result tables, PCA, volcano plot, heatmap, and summary report

Data Source

This pipeline uses the public TCGA-BRCA breast cancer RNA-seq cohort from the Genomic Data Commons. The project is framed around a CPTAC breast cancer analysis use case, while keeping the RNA-seq source fully public and reproducible.

Repository Structure

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

How to Run

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

The default configuration runs on a smaller real-data subset of 5 tumor and 5 normal samples so the pipeline can complete reliably on a typical laptop.

To run a larger subset:

python3 run_pipeline.py --max-tumor-samples 25 --max-normal-samples 25

Output

After a successful run, the pipeline writes:

  • output/processed/sample_metadata.tsv
  • output/processed/raw_count_matrix.tsv
  • output/processed/log2_cpm_matrix.tsv
  • output/processed/differential_expression_results.tsv
  • output/processed/significant_genes.tsv
  • output/figures/volcano_plot.png
  • output/figures/pca_plot.png
  • output/figures/top_genes_heatmap.png
  • output/reports/analysis_summary.md

Example Results

In a successful starter run on a real subset, the pipeline produced:

  • 5 tumor samples and 5 normal samples
  • more than 24,000 genes retained after filtering
  • more than 1,000 significant genes at FDR <= 0.05 and |log2FC| >= 1

Representative genes from the output included:

  • Upregulated: COL10A1, COL11A1, MMP11, COMP
  • Downregulated: LEP, FABP4, ADIPOQ, PLIN1

Methods

Gene expression values are parsed from public RNA-seq count files and assembled into a sample-by-gene matrix. Low-expression genes are removed prior to analysis. Counts are normalized to counts per million and log2-transformed. Differential expression is then computed between tumor and normal groups using Welch's t-test, followed by Benjamini-Hochberg correction to control the false discovery rate.

This implementation is intentionally lightweight and transparent, with the goal of making each step of the workflow easy to inspect and extend.

Technology

  • Python
  • pandas
  • numpy
  • scipy
  • matplotlib
  • seaborn

Testing

python3 -m unittest discover -s tests -v

License

MIT License. See LICENSE.

About

End-to-end bulk RNA-seq differential expression pipeline for breast cancer using real public transcriptomics data, automated GDC download, QC, statistical testing, and visualisation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages