Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RNA-seq

This repository contains a complete RNA-seq analysis pipeline designed for SLURM environments.

Contents

  • Pre-processing (RNAseq_PIPELINE.sh)
  • Differential Gene Expresion Analysis (DGE_analysis.Rmd)

Pre-procesing Step-by-Step Description

How to Run

  1. Modify the variables inside RNAseq_PIPELINE.sh with your paths and sample names.
  2. Submit to SLURM:
sbatch RNAseq_PIPELINE.sh

1. Quality Control (FastQC)

Runs a quality control check on the raw FASTQ files.

Command:

fastqc sample_R1.fastq.gz sample_R2.fastq.gz -o output_dir

Arguments:

  • sample.fastq.gz: Input FASTQ file
  • -o: Output directory

2. Alignment (STAR)

Aligns paired-end reads to the reference genome using STAR. Outputs include:

  • Sorted BAM file
  • Gene count matrix

Command:

STAR \
  --genomeDir STAR_index_dir \
  --sjdbGTFfile annotation.gtf \
  --readFilesIn sample_R1.fastq.gz sample_R2.fastq.gz \
  --readFilesCommand zcat \
  --runThreadN 4 \
  --outFileNamePrefix output_prefix \
  --outSAMtype BAM SortedByCoordinate \
  --quantMode GeneCounts
  • --genomeDir: Path to STAR genome index (e.g. built for hg38)
  • --sjdbGTFfile: GTF annotation file used for guided alignment
  • --readFilesIn: Input paired-end FASTQ files
  • --readFilesCommand: Decompression method (e.g., zcat for .gz)
  • --runThreadN: Number of threads for parallel processing
  • --outFileNamePrefix: Prefix for all output files
  • --outSAMtype: BAM SortedByCoordinate Output sorted BAM file by coordinate
  • --outTmpDir: Temporary directory for STAR to use
  • --outWigStrand: Unstranded Type of strand specificity in wiggle files (Unstranded, Forward, or Reverse)
  • --quantMode: GeneCounts Outputs read counts per gene

3. Index BAM File (SAMtools)

Indexes the sorted BAM file for downstream tools.

Command:

samtools index Aligned.sortedByCoord.out.bam

4. Generate Signal Tracks (deepTools)

Creates a normalized bigWig file for visualization.

Command:

bamCoverage \
  --bam input.bam \
  --outFileName output.bw \
  --effectiveGenomeSize 2913022398 \
  --outFileFormat bigwig \
  --binSize 1 \
  --normalizeUsing RPGC

Arguments:

  • --bam: Input BAM file (cleaned, filtered, and deduplicated)
  • --outFileName: Output bigWig file name
  • --effectiveGenomeSize: Effective genome size (e.g. 2913022398 for human hg38)
  • --outFileFormat: Output format, typically bigwig
  • --binSize: Bin size for signal aggregation (e.g. 1 bp resolution)
  • --normalizeUsing: Normalization method (e.g. RPGC = Reads Per Genomic Content)

Differential Gene Expresion Analysis

This workflow includes gene annotation, count filtering, normalization, statistical testing, visualization, and functional enrichment analysis.

How to Run

  1. Open DGE_analysis.Rmd in RStudio.
  2. Set the variables in the CONFIG section at the top.
  3. Knit or run chunk by chunk.

Input Files

File Description
counts.tab Raw gene counts matrix (from STAR --quantMode GeneCounts)
genes.bed Gene annotation BED file with Ensembl IDs and gene symbols

Pipeline Overview

1. Import & Annotate Reads the count matrix, merges with a gene annotation file to add gene symbols, and deduplicates entries where multiple Ensembl IDs map to the same symbol.

2. Differential Expression (DESeq2) Builds a DESeq2 object, filters lowly expressed genes, and runs the model with a user-defined reference condition. Genes are classified as UP, DOWN, or NO based on |LFC| > 1 and padj < 0.05.

3. Visualization

  • PCA — assesses sample clustering and replicate reproducibility after VST normalization
  • Volcano plot — displays fold change vs. significance, labelling the top N most significant genes

4. GO Enrichment (enrichR) Runs Gene Ontology Biological Process enrichment separately on UP and DOWN regulated genes.

Output Files

  • Differential expression results (DGE_*.xlsx)
  • Normalized gene expression values (normalized_counts_*.xlsx)
  • PCA plot (PCA.pdf)
  • Volcano plot (Volcano_*.pdf)
  • GO enrichment tables (GO_UP_*.xlsx, GO_DOWN_*.xlsx)
  • GO enrichment plots (GO_*.pdf)

About

Pipeline for RNA-seq data analysis used, including quality control, alignment, quantification, differential expression analysis, and downstream analysis.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages