Skip to content

Repository files navigation

🧬 Compare Gene Expression Differential Expression Analysis in R

Eastern European Bioinformatics and Computational Genomics Workshop (EEBG 2026)

Workshop Python Jupyter Bioinformatics License

EEBG 2026 - Differential Expression Analysis (DEA) in R

Author: Tomek Gaczorek (Jagiellonian University)

Project Overview

This repository contains a comprehensive workflow for performing Differential Expression Analysis (DEA) on bulk RNA-seq data using R. The primary objective of this analysis is to identify differentially expressed genes between smoker and non-smoker groups, analyzing male and female cohorts separately based on the GSE237252 dataset.

Dataset

The analysis utilizes the following data files:

  • GSE237252_raw_data.csv: Raw gene expression counts.
  • GSE237252_males_metadata.csv: Metadata for the male cohort, detailing smoking status.
  • GSE237252_females_metadata.csv: Metadata for the female cohort, detailing smoking status.

Dependencies

The analysis is conducted in R (v4.6.1) and relies on the following key Bioconductor and CRAN packages:

  • Data manipulation: dplyr
  • DEA core: DESeq2
  • Visualization: ggplot2, enrichplot
  • Functional Analysis: clusterProfiler, org.Hs.eg.db

Workflow Summary

1. Data Preprocessing

  • Raw counts are loaded and matched to corresponding metadata.
  • Lowly expressed genes are filtered out based on a threshold (e.g., rowSums > 42).

2. Differential Expression Analysis (DESeq2)

  • Model Design: ~SMOKING (comparing smokers vs. nonsmokers).
  • Standard DESeq2 pipeline steps: estimating size factors, estimating gene-wise dispersions, and fitting the negative binomial GLM.
  • Log2 fold-change (LFC) shrinkage is applied to handle noise in low-count genes.

3. Quality Control & Exploratory Data Analysis

Several visual diagnostic tools are implemented to inspect the integrity of the data and normalization:

  • Raw vs. Normalized Counts: Evaluates the normalization efficacy. Raw vs. Normalized Counts - Males

  • Dispersion Estimates: Checks the mean-dispersion relationship. Dispersion Estimates - Males

  • Principal Component Analysis (PCA): Visualizes sample clustering by variance (PC1 & PC2) to observe group separations. PCA Plot - Males

4. Result Visualization

Significant genes are identified (using thresholds like padj < 0.01 and |log2FoldChange| > 2) and visualized using:

  • Log2-fold Shrinkage Density Plots: Comparing original vs. shrinked distributions. Log2-fold Shrinkage Density - Males

  • MA Plot: Showing log-fold change against the mean of normalized counts. MA Plot - Males

  • Volcano Plot: Highlighting highly significant and highly folded-changed genes. Volcano Plot - Males

5. Functional Enrichment Analysis

  • Over-representation analysis of Gene Ontology (GO) Biological Processes (BP) is performed using clusterProfiler on the significantly differentially expressed genes.
  • The top enriched pathways are visualized using dot plots.

(Note: Add the GO-terms dotplot to the male_results folder and link it here when generated)


Female Cohort Analysis

The repository also includes a complete replication of the pipeline specifically on the female cohort. This allows for an independent assessment and a cross-sex comparison of the transcriptomic impacts of smoking.

PCA Plot - Females

(Note: Ensure female plots are saved in the female_results directory using the same naming conventions to render correctly)

Usage

To reproduce the analysis:

  1. Clone the repository.
  2. Ensure the GSE237252 raw data and metadata CSV files are located in your working directory.
  3. Open the main R script / Jupyter Notebook.
  4. Run the chunks sequentially to generate the DESeq2 objects, plots, and enrichment tables.

About

A step-by-step R workflow for conducting Differential Gene Expression (DGE) analysis to compare gene expression profiles.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages