All chapters

FASTQ Quality Control

intermediate

FastQC Module Overview

Key FastQC Quality Modules

📊Per-base QualityTarget: median >Q28; drop at 3' end is normal
📈Per-seq QualityMost reads mean Q>30; peak should be sharp
🔄GC Content~42% for human; sharp peaks = contamination
🔌Adapter Content<5% before trimming; fastp auto-detects
📋Duplication<20% ideal; >30% = library quality problem
📏Sequence LengthUniform before trim; mixed after is normal

FastQC

FastQC generates an HTML report with 12 QC modules for each FASTQ file. Always run on raw reads before any processing.

code
# Single file
fastqc sample_R1.fastq.gz

# Multiple files with 4 threads
fastqc -o qc_results/ -t 4 *.fastq.gz

# Paired-end
fastqc sample_R1.fastq.gz sample_R2.fastq.gz -o qc/

Interpreting FastQC Modules

  • Per base sequence quality - box plots per position; median should stay green (>Q28). Drop at 3' end is normal
  • Per sequence quality - most reads should have mean Q>30
  • Per base sequence content - first 10–13 bases biased (library prep artifact); rest should be ~25% each
  • Per sequence GC content - bell curve centred on organism GC% (~42% human); sharp peaks = contamination
  • Per base N content - Ns should be <1%; higher means sequencer failed to call base
  • Sequence length distribution - usually uniform; mixed lengths after trimming
  • Sequence duplication levels - <20% ideal; high duplication = low complexity or over-amplified library
  • Overrepresented sequences - adapter sequences or rRNA contamination
  • Adapter content - should be <5% before trimming; fastp/Trimmomatic removes these

MultiQC

MultiQC aggregates FastQC (and 90+ other tools) reports into a single interactive HTML. Essential for batch QC assessment across dozens of samples.

code
# Run in directory containing FastQC results
multiqc .

# Custom output directory
multiqc . -o multiqc_report/

# Include specific tools only
multiqc . --module fastqc --module trimmomatic

# Export data tables
multiqc . --export

BAM-Level QC

code
# Coverage statistics (mosdepth - fast)
mosdepth --quantize 0:1:10:50:500: \
  --by capture.bed \
  sample_cov sample.bam

# samtools flagstat - alignment summary
samtools flagstat sample.bam
# Output example:
# 98.5% mapped
# 95.2% properly paired

# GATK CollectWgsMetrics
gatk CollectWgsMetrics \
  I=sample.bam R=hg38.fa O=wgs_metrics.txt

# VerifyBamID - contamination check
verifyBamID2 --SVDPrefix genome \
  --Reference hg38.fa \
  --BamFile sample.bam
# FREEMIX <0.03 = acceptable