What is RNA-seq QC
and Why It Matters

Before any alignment or differential expression analysis, you need to know whether your raw sequencing data is trustworthy. This lesson explains what quality control means in RNA-seq and what it protects you from.

🅾 Free Lesson 📅 Module 6 · Week 8
📖 Lesson 1 of 9 ⏱ ~35 minutes 🟢 Beginner-friendly 🐧 Ubuntu / Linux

01 What is Quality Control?

Quality control (QC) in RNA-seq is the process of inspecting your raw sequencing data before you do any biology with it. It is not an optional extra step — it is the single most important thing you do at the start of an RNA-seq analysis.

💡 Why QC exists

Sequencing machines are not perfect. A modern Illumina sequencer reads hundreds of millions of short DNA fragments (reads) and assigns a quality score to every single base it calls. Some bases are read confidently; others are guesses. Some reads are contaminated with adapter sequences from the library preparation step. Some samples degrade before sequencing even begins.

If you skip QC and align these imperfect reads directly to a genome, you get garbage in → garbage out. Your differential expression results will include false positives, your coverage plots will look noisy, and your conclusions could be wrong. QC is your protection against all of this.

QC tells you three things:

  • Is the sequencing data good enough to use? — Some runs fail catastrophically and should be discarded entirely.
  • What problems exist and how bad are they? — Low-quality tails, adapter contamination, GC bias, over-represented sequences.
  • What preprocessing do I need? — Do I need to trim adapters? Remove low-quality bases? Filter out certain reads?
🌿

Plant genomics note: In plant RNA-seq experiments, QC problems are especially common. Plant RNA extractions often contain phenolic compounds, polysaccharides, and secondary metabolites that can degrade RNA quality before sequencing even starts. The QC report is your first signal that something went wrong in the wet lab.

02 Where QC Fits in the RNA-seq Workflow

RNA-seq analysis is a pipeline — a sequence of steps that transforms raw sequencing reads into biological knowledge. QC always comes first, and it actually happens twice: before and after trimming.

🧬
1. Raw sequencing data (FASTQ files) Output from the sequencer — millions of short reads with quality scores
🔍
2. QC Round 1 — FastQC + MultiQC Inspect the raw reads. Identify problems before doing anything else.
✂️
3. Trimming — Trimmomatic or Trim Galore Remove adapter sequences and low-quality bases from the ends of reads
🔍
4. QC Round 2 — FastQC + MultiQC again Confirm that trimming fixed the problems. Re-run on cleaned reads.
📍
5. Alignment — STAR or HISAT2 Map the clean reads to a reference genome. This comes in Module 7.
📊
6. Downstream analysis — counting, DESeq2 Quantify gene expression and find differentially expressed genes. Module 8.

This module covers steps 2, 3, and 4. By the end of the module you will be able to run a complete QC-to-trimming pipeline on any RNA-seq dataset.

03 What Can Go Wrong with Sequencing Data

Before you can interpret a QC report, you need to understand the types of problems that can appear. Here are the most common ones you will encounter in real RNA-seq projects.

🔬 The Phred quality score — the number behind every base call

Every base in a FASTQ file has a quality score called a Phred score (also written Q score). This score encodes the probability that the base call is wrong.

The formula is: Q = −10 × log₁₀(P) where P is the probability of an error.

This means Q30 = 1 in 1,000 chance of error (99.9% accuracy). Q20 = 1 in 100 chance (99% accuracy). In RNA-seq, you generally want the majority of your bases to have Q ≥ 30. Anything below Q20 is considered low quality and should be trimmed.

ProblemWhat it meansCaused byFixed by
Low per-base quality Quality scores drop at the 3′ end of reads Normal Illumina chemistry — signal degrades over longer reads Quality trimming
Adapter contamination Adapter sequences appear at the end of reads Short insert size — read runs off the end of the fragment into the adapter Adapter trimming
High duplication rate Many reads are identical copies Low input RNA, PCR over-amplification during library prep Mark duplicates after alignment; use more RNA input
GC content bias GC distribution does not match the expected genome curve PCR bias, contamination, or a highly AT/GC-rich organism Investigate; may be normal for your organism
Over-represented sequences A single sequence makes up >1% of all reads rRNA contamination, adapter dimers, library prep artefacts rRNA depletion in the wet lab; adapter trimming
Low read count Too few reads per sample (<10M for most RNA-seq) Sequencing failure, low RNA input, failed library Re-sequence the sample
⚠️

The rRNA contamination problem in plants: If your library preparation used poly-A selection, you should see very little rRNA in your data. If you see massive over-represented sequences similar to known rRNA, your poly-A selection may have failed. This is a serious wet-lab problem — QC catches it before you waste weeks of computational analysis.

04 QC Tools You Will Learn in This Module

The bioinformatics community has settled on a core set of tools for RNA-seq QC. You will use all of these in this module.

ToolWhat it doesOutputLesson
FastQC Runs ~12 quality checks on a single FASTQ file and generates an HTML report with pass/warn/fail badges .html report + .zip data file Lessons 3 & 4
MultiQC Aggregates FastQC reports from all samples into a single interactive HTML dashboard — essential for comparing 10+ samples at once multiqc_report.html Lesson 5
Trimmomatic Java-based trimmer. Highly configurable. Trims adapters, low-quality bases, leading/trailing bases. Industry standard for many years. Trimmed FASTQ files Lesson 6
Trim Galore Wrapper around Cutadapt. Simpler to use than Trimmomatic. Automatically detects adapter sequences. Excellent for paired-end data. Trimmed FASTQ files + QC report Lesson 7

🤔 FastQC vs MultiQC — what is the difference?

FastQC analyses one FASTQ file and produces one report. If you have 24 samples (12 conditions × 2 replicates), you run FastQC 24 times and get 24 separate HTML reports. Reading 24 reports manually is tedious and error-prone.

MultiQC reads all 24 FastQC outputs and combines them into a single interactive report where every sample appears as one line in every plot. You can immediately see which samples are outliers. This is why MultiQC is now standard practice in any serious RNA-seq project.

05 Setting Up Your Environment

Before running any QC tools, you need to set up a Conda environment with the required software. This keeps all your QC tools isolated from other projects and ensures reproducibility.

💡 Why a dedicated Conda environment for QC?

FastQC requires Java. Trimmomatic requires Java. MultiQC requires Python. Trim Galore requires Cutadapt (Python) and FastQC. If you install all these in your base environment, they can conflict with other tools. A dedicated rnaseq-qc environment means you can always recreate this exact software setup, share it with collaborators, and avoid dependency conflicts.

In Module 3 (Conda) you learned the full theory. Here you simply use it. If you have not set up Conda yet, install Miniconda3 first.

Step 1 — Create and activate the environment

📁 Run from: any directory (this is a system-level setup command)
bash
# Create a new Conda environment named rnaseq-qc
# -c bioconda and -c conda-forge supply the bioinformatics packages
conda create -n rnaseq-qc \
    -c bioconda -c conda-forge \
    fastqc multiqc trimmomatic trim-galore \
    -y

# Activate the environment — must do this every new terminal session
conda activate rnaseq-qc

# Verify all four tools are installed
fastqc --version
FastQC v0.12.1

multiqc --version
multiqc, version 1.21

trimmomatic -version
0.39

trim_galore --version
Trim Galore version 0.6.10

Step 2 — Create your project directory structure

Good directory organisation is essential in bioinformatics. Create this structure once and reuse it throughout the module.

📁 Run from: your home directory (~)
bash
# Create the full project directory tree in one command
# Brace expansion {...} creates multiple directories simultaneously
mkdir -p ~/rnaseq-project/{data/{raw,trimmed},qc/{fastqc_raw,fastqc_trimmed,multiqc},results,logs}

# Verify the full structure
tree ~/rnaseq-project
rnaseq-project/
├── data/
│   ├── raw/          ← original FASTQ files — NEVER modify these
│   └── trimmed/      ← trimmed reads from Trimmomatic/Trim Galore
├── qc/
│   ├── fastqc_raw/   ← FastQC reports on raw data
│   ├── fastqc_trimmed/ ← FastQC reports after trimming
│   └── multiqc/      ← MultiQC combined dashboard
├── results/          ← final outputs (counts tables, plots)
└── logs/             ← log files from every tool you run

# Protect raw data — make it read-only so you cannot accidentally delete it
chmod -R 444 ~/rnaseq-project/data/raw
💡

The golden rule of raw data: Never modify or delete files in data/raw/. These are your original, unprocessed reads from the sequencer. They are irreplaceable. The chmod -R 444 command makes the entire directory read-only so even an accidental rm command will fail with a permission error.

Step 3 — Peek at a FASTQ file to understand its format

Before running FastQC, it is worth understanding what the raw data actually looks like. A FASTQ file is a plain text file — you can read it directly on the command line.

📁 Run from: ~/rnaseq-project/data/raw
bash
# FASTQ files are gzip-compressed (.gz) to save disk space
# zcat decompresses on-the-fly and sends output to stdout
# pipe to head -8 to see the first 2 reads (4 lines each)
cd ~/rnaseq-project/data/raw
zcat sample1_R1.fastq.gz | head -8

@SRR8245019.1 1/1                 ← Line 1: read identifier (starts with @)
ACTGGTACGATCGATCGTAGCTAGCTAGCTA  ← Line 2: the DNA sequence (150 bases)
+                                 ← Line 3: separator (always +)
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII  ← Line 4: quality scores (ASCII-encoded Phred)
@SRR8245019.2 2/1
GCTAGCTAGCGATCGATCGTAGCTAGCTAGC
+
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

# Count total reads: divide total lines by 4
zcat sample1_R1.fastq.gz | wc -l
80000000
# 80,000,000 lines ÷ 4 = 20,000,000 reads — a typical RNA-seq run
💡 Decoding the 4-line FASTQ format

Line 1 — Read identifier: Starts with @. Contains the instrument name, run ID, flowcell coordinates, and read number. Every read has a unique identifier.

Line 2 — DNA sequence: The actual nucleotide sequence the sequencer called. Each character is one base (A, T, G, C, or N for unknown). For paired-end 150 bp sequencing, this line is exactly 150 characters long.

Line 3 — Separator: Always a + sign. Sometimes the read identifier is repeated here, but most modern tools just write + to save space.

Line 4 — Quality scores: One ASCII character per base in Line 2. The character encodes a Phred quality score using the formula: Phred = ASCII value − 33. The character I has ASCII value 73, so its Phred score is 73 − 33 = 40, meaning 99.99% base-call accuracy. The character ! (ASCII 33) gives Phred 0 — essentially a random guess.

Enjoying this lesson? Support Shopnil Academy by checking out our partners below

06 Exercises

1
Set up your QC environment
  1. Create the Conda environment named rnaseq-qc with FastQC, MultiQC, Trimmomatic, and Trim Galore installed from the bioconda and conda-forge channels.
  2. Activate the environment and confirm all four tools installed by running their --version flags.
  3. Create the full project directory structure at ~/rnaseq-project/ with all subdirectories as shown in Step 2 above.
▶ Show answer

Run: conda create -n rnaseq-qc -c bioconda -c conda-forge fastqc multiqc trimmomatic trim-galore -y

Then: conda activate rnaseq-qc and verify with fastqc --version, multiqc --version, trimmomatic -version, trim_galore --version.

Create all directories in one command: mkdir -p ~/rnaseq-project/{data/{raw,trimmed},qc/{fastqc_raw,fastqc_trimmed,multiqc},results,logs}

2
Inspect a FASTQ file manually
  1. Download or obtain any .fastq.gz file and place it in ~/rnaseq-project/data/raw/.
  2. Use zcat and head -12 to display the first 12 lines. How many complete reads does this show?
  3. Count the total number of reads using: zcat sample.fastq.gz | wc -l then divide by 4. How many reads are there?
  4. What is the length of the first read? Try: zcat sample.fastq.gz | head -2 | tail -1 | wc -c (subtract 1 for the newline character).
▶ Show answer

12 lines ÷ 4 lines per read = 3 complete reads shown by head -12.

Divide total line count by 4 to get read count. A typical Illumina RNA-seq run has 20–50 million reads per sample.

Modern paired-end RNA-seq is usually 150 bp reads. Older runs may be 75 bp or 100 bp. The wc -c count includes the newline character, so the actual read length is the result minus 1.

3
Decode Phred quality scores
  1. Look at Line 4 of the first read in your FASTQ file. What ASCII characters do you see?
  2. The character I has ASCII value 73. What is its Phred score? (Subtract 33, because Illumina uses Phred+33 encoding.)
  3. What does Phred 40 mean in terms of base-call accuracy? Use: accuracy = 1 − 10^(−Q/10)
  4. What Phred score does the character # (ASCII 35) represent? Is this a good or bad quality base?
▶ Show answer

I → ASCII 73 → Phred score 73 − 33 = 40. Accuracy = 1 − 10^(−4) = 99.99%. This is excellent — only 1 error per 10,000 base calls.

# → ASCII 35 → Phred score 35 − 33 = 2. Accuracy = 1 − 10^(−0.2) = ~37%. This is a very poor quality base — nearly worthless. Bases with Phred < 20 should be trimmed away before alignment.

Advertisement Google AdSense slot reserved