IAE Academy

FOR CORE AND IT JOBS · CHAPTER 6 OF 7

Sequencing data and genomics

This chapter explains how sequencers produce reads with quality scores, how coverage tells you whether a genome was read enough, and how reads become an assembly or a list of variants. An engineer needs it to judge whether a sequencing result can be trusted.

Updated 30 Oct 2026

What you will be able to do

You will pick between Sanger, short-read and long-read sequencing for a job. You will turn a FASTQ quality character into an error probability and expected errors. You will compute coverage, follow how reads become an assembly, and order the steps from reads to a VCF file.

Before you start

  1. Chapter 1, Biological data and databases

  2. DNA basics: the bases A, C, G and T, strands with 5' and 3' ends, copying by PCR

  3. Logarithms to base 10 and powers of ten

  4. ASCII character codes

  5. Expected value as a sum of probabilities

  6. Counting pairs among n items, n(n - 1)/2

  7. Graphs: nodes, directed edges and walks along them

Reads and their quality

A sequencer reads a genome as many short pieces, called reads, and reports for each base how sure it is. Sanger sequencing reads one fragment per reaction, by chain termination (copying stops at a labelled base). The other platforms read many fragments in parallel. Figures below are typical; instruments differ.

Feature

Sanger

Short-read (Illumina)

Long-read

Read length

700 to 1000 bases

50 to 300 bases

10 000 to over 100 000 bases

Accuracy per base

99.9% or better

99.9% or better for most bases

95% to 99.9%, by chemistry

Throughput (reads per run)

up to about 96

millions to billions

thousands to tens of millions

Typical use

checking one PCR product

resequencing, variant calling

new genomes, repeats, rearrangements

FASTQ extends FASTA (Chapter 1) with a quality per base: a record usually takes four lines, a name starting with @, the bases written 5' to 3', a line starting with +, and one quality character per base.

@read1
ACGTTGCA
+
II5?IIII

In Phred+33 encoding, score Q is stored as the character with ASCII code Q + 33: ! is 33, digits 0 to 9 are 48 to 57, ? is 63, capitals A to Z are 65 to 90.

PHRED QUALITY SCORE

Holds for 0 < p ≤ 1. p: estimated probability that the base call is wrong; Q: score (dimensionless). Each 10 units of Q cut p tenfold.

ERROR PROBABILITY FROM A SCORE

Holds for Q ≥ 0; same symbols. Divide the Phred equation by -10, then raise 10 to each side.

EXPECTED ERRORS IN A READ

Holds even when errors at different bases are not independent, because expectations add. L: read length (bases); , : p and Q of base i; E: expected wrong bases.

WATCH OUT FOR

Averaging Q values. A mean Q of 25 can hide one base at Q 5. The test: convert each Q to p first, then sum or average the p values.

WORKED EXAMPLE

For the quality string II5?IIII above, find p for each distinct character and the expected number of wrong bases.

Solution
  1. I is the ninth capital, so its code is 65 + 8 = 73. Subtract 33 for Phred+33: Q = 40, so .

  2. 5 has code 48 + 5 = 53, so Q = 20 and .

  3. ? has code 63, so Q = 30 and .

  4. The string has six I, one 5 and one ?. Expectations add, so .

Answer: E = 0.0006 + 0.011 = 0.0116 wrong bases, about 0.012.

Coverage and assembly

The number of reads covering a position is its depth. Coverage is the mean depth over the genome. N reads of length L give NL bases; spread over G positions, each is read NL/G times on average.

COVERAGE

Holds when every read comes from this genome. C: mean depth (dimensionless, 30x means 30); L: read length (bases); N: number of reads; G: genome length (bases).

READS NEEDED FOR A TARGET COVERAGE

The coverage equation solved for N; same symbols. Longer reads need fewer reads for the same C.

WATCH OUT FOR

Reading 30x as every base having 30 reads. Depth varies, and regions that sequence poorly get far fewer reads. The test: ask for the lowest depth, or the share of positions below a threshold.

WORKED EXAMPLE

A bacterial genome has G = 4 million bases. You sequence N = 2 million reads of L = 100 bases. What is the coverage?

Solution
  1. Total bases read , because each read contributes L bases.

  2. Divide by G, because those bases spread over positions: .

Answer: C = 50, that is 50x coverage.

Assembly joins reads into longer sequences, called contigs, with no reference genome (an already assembled genome of the species). An overlap graph links reads whose ends overlap, but finding overlaps directly compares all N(N - 1)/2 pairs, about for a million reads. A de Bruijn graph cuts each read into k-mers, substrings of length k, and makes each k-mer an edge from its first k - 1 bases to its last k - 1 bases. Reads sharing a (k-1)-mer then meet at one node without being compared. For ATGGCGT with k = 3:

3-mer (edge)

From node

To node

ATG

AT

TG

TGG

TG

GG

GGC

GG

GC

GCG

GC

CG

CGT

CG

GT

K-MERS IN ONE READ

Holds for . L: read length (bases); k: k-mer length (bases); n: count. Here L = 7 and k = 3 give the 5 edges in the table.

To spell the sequence, write the start node AT, then the last base of each node reached: G, G, C, G, T, giving ATGGCGT. A repeat, a stretch found at two places in the genome, gives both copies the same (k-1)-mers. Past the repeat the copies differ: if one continues CGT and the other CGA, node CG has edges to GT and GA, and the walk cannot tell which to take. Reads shorter than the repeat cannot settle it, so the assembly breaks there. A long read spanning the repeat into unique sequence on both sides settles the order.

From reads to variants

When a reference genome exists, you place each read on it and record where the sample differs. Each step uses the output of the one before.

Step

Input

Output

What happens

1. Quality control

FASTQ

cleaned FASTQ

Check Phred scores per position; trim low-quality ends and adapters (synthetic DNA added for sequencing).

2. Read alignment

cleaned FASTQ, reference FASTA

SAM

Place each read at its best match, with a mapping quality (Phred-scaled chance it is misplaced). SAM is text, one line per alignment.

3. BAM file

SAM

sorted, indexed BAM

The same data in binary, sorted by position and indexed so tools can jump to a region.

4. Variant calling

BAM, reference

VCF

Compare the reads' bases with the reference at each position; write out differences with enough evidence.

A VCF file has one line per variant site, with eight fixed columns (CHROM, POS, ID, REF, ALT, QUAL, FILTER, INFO) and genotype columns for samples. QUAL is Phred-scaled: 30 means about a 1 in 1000 chance the call is wrong, under the caller's model. A diploid genome has two copies of each chromosome; a site is heterozygous when they carry different bases. At 30x about half its reads show each base; at 2x, one differing read cannot be told from a sequencing error.

Check yourself

CHECK YOURSELF 1One or more options are correct

Which statements about the steps from raw reads to variants are true?

  1. (A)

    Reads are aligned to the reference before quality control.

  2. (B)

    A BAM file holds the same alignments as a SAM file, compressed to binary.

  3. (C)

    Variant calling takes a sorted BAM file and the reference as input.

  4. (D)

    A VCF file has one line per read.

Answer and solution

Answer: (B), (C)

  1. Quality control comes first, on the FASTQ, so A is false.

  2. BAM is SAM in binary, so B is true.

  3. Variant calling reads the BAM and the reference, so C is true.

  4. A VCF file has one line per variant site, so D is false.

CHECK YOURSELF 2

A read of 50 bases has every base at Q = 20. How many wrong bases do you expect in the read?

Answer and solution

Answer: (accepted range )

  1. Q = 20 gives per base.

  2. Expectations add: E = 50 × 0.01 = 0.5.

CHECK YOURSELF 3

Why is a de Bruijn graph used to assemble millions of short reads?

  1. (A)

    It compares every pair of reads directly

  2. (B)

    Reads are cut into k-mers that join at shared (k-1)-mers, so reads are never compared pairwise

  3. (C)

    It works only with reads longer than the genome's repeats

  4. (D)

    It needs a reference genome to place the reads

Answer and solution

Answer: (B)

  1. Each k-mer is an edge between two (k-1)-mers, so reads sharing a (k-1)-mer meet at one node with no pairwise comparison; A is wrong.

  2. It is built for short reads, which are shorter than many repeats, so C is wrong; it needs no reference, so D is wrong.

CHECK YOURSELF 4

A genome has G = 2.5 million bases. You sequence N = 500 000 reads, each L = 150 bases long, all from this genome. What is the coverage C (as a number, for example 30 for 30x)?

Answer and solution

Answer: (accepted range )

  1. Total bases .

  2. .

Used in these GATE topics