Quality Control with FastQC

Before you trust a single result, you check the raw reads. FastQC is the standard five-minute health check for sequencing data. You'll run it in your browser and, more importantly, learn to actually read its report.

🟡 Intermediate ⏱️ ~45 min 💻 Command line 🌐 Runs free in Colab

Before you start

  • You've read How NGS Works, so reads and quality scores are familiar.
  • You're comfortable running a few command-line lines. New to that? See Command-line basics.
  • A free Google account to run the Colab notebook. Any term new? Check the Glossary.

Learning objectives

By the end of this lesson you will be able to: install and run FastQC on a set of reads, interpret the main modules of the FastQC report (per-base quality, adapter content, and more), and decide what a red or warning module actually means for your data.

Garbage in, garbage out

Raw sequencing reads are never perfect. The machine makes mistakes (more often toward the end of each read), leftover adapter sequence can cling to the reads, and sometimes a whole run just goes wrong. If you feed bad reads into alignment and variant calling, you get confident-looking nonsense. Quality control is the cheap, fast step that catches these problems before they cost you hours.

FastQC is the tool everyone uses for it. You point it at a FASTQ file, and it produces a tidy HTML report full of graphs, one per quality "module". Your job is to read those graphs.

▶ Run it in Google Colab

Colab is a free Linux machine in your browser, so real command-line tools like FastQC just work, with nothing to install on your computer.

Open the notebook in Colab →

1Install FastQC and get some reads

In Colab, a line starting with ! runs a command-line (shell) command instead of Python. First, install FastQC:

# the "!" tells Colab to run a shell command
!apt-get -qq install -y fastqc
!fastqc --version

Then we need a FASTQ file to inspect. The notebook generates a small example with a realistic quality drop toward the end of each read, so the report shows the pattern you'll meet in real data. (On your own data, you would just point FastQC at your real .fastq or .fastq.gz file instead.)

2Run FastQC

One command does it all. FastQC writes an HTML report and a zip of the underlying images.

!fastqc reads.fastq
!ls
# produces reads_fastqc.html and reads_fastqc.zip

The notebook then unzips the results and displays the most important graph, the per-base quality plot, right in the notebook.

3Reading the report, module by module

FastQC marks each module with a green tick, an amber warning, or a red cross. A useful rule: do not panic at red. The marks are rough rules of thumb, and what counts as a problem depends on your experiment. Read the actual graph, not just the colour. Here are the modules that matter most.

Per base sequence qualityThe most important plot. A box-and-whisker of quality at each position along the read. Quality almost always dips toward the 3' end. If boxes drop into the red zone, those bases need trimming (the next lesson).
Per sequence quality scoresShows whether a subset of reads is low-quality overall. You want one peak at high quality; a second low peak means some reads are junk.
Per base sequence contentThe proportion of A, T, G, C at each position. Wobble at the very start is common and usually harmless; big imbalances elsewhere can signal a problem.
Adapter contentHow much leftover adapter sequence is present. A rising line near the end means adapters that trimming will remove.
Overrepresented sequencesSequences that appear far more than expected, often adapters or contamination worth investigating.

Decode the jargonPhred quality score

A number that says how confident the machine is in a base. A Phred score of 20 means a 1-in-100 chance the base is wrong; 30 means 1-in-1000; 40 means 1-in-10,000. Higher is better. In the per-base quality plot, green is good (above ~28), amber is so-so, and red is poor. This is the same score encoded as symbols on the quality line of a FASTQ record.

Decode the jargonAdapter

Adapters are short, known DNA sequences attached to every fragment during library prep so the machine can grab and read it. When a fragment is shorter than the read length, the machine reads past the real DNA and into the adapter. That adapter sequence is not biology, so it must be trimmed off before alignment.

So a module is red. Now what?

FastQC diagnoses; it does not fix. The two most common issues, low-quality ends and adapter contamination, are both solved by trimming, which is exactly the next lesson. After trimming, you run FastQC again and watch the red turn green. That before-and-after loop is the everyday rhythm of read QC.

🔶 Level up: MultiQC

Real projects have dozens or hundreds of FASTQ files. MultiQC scans a folder of FastQC reports and combines them into one interactive summary, so you can spot the odd-one-out sample at a glance. Install it with pip install multiqc and run multiqc . in a folder of reports.

Check your understanding

Why run QC before alignment instead of after?
Because problems like low-quality ends and adapter contamination distort everything downstream. Catching and fixing them first saves you from chasing artefacts later. It is a fast check that prevents slow mistakes.
A read's last bases have a Phred score around 10. Is that good?
No. Phred 10 means roughly a 1-in-10 chance the base is wrong, which is poor. A quality drop at the 3' end is normal, but those bases should be trimmed before you use the reads.
FastQC flags a module red. Should you throw the data away?
Not automatically. The colours are rough heuristics. Read the actual graph and consider your experiment. Many red flags (like 3' quality drop or adapter content) are routine and simply fixed by trimming.
On the FastQC per-base quality plot, where does read quality almost always dip?
Quality almost always declines toward the 3' end of a read. A drop into the red zone there is normal and is fixed by trimming those late bases.
When you have dozens or hundreds of FASTQ files, which tool combines their FastQC reports into one summary?
MultiQC scans a folder of FastQC reports and merges them into a single interactive summary, so you can spot the odd-one-out sample at a glance.
Next in Track 2

Trimming & filtering reads →