LSMA

LONDON SCHOOL OF MULTIOMICS & AI

Free course

Free course

0 of 73 lessons

Lesson 1 of 9

Module 6 · Genome assembly

What genome assembly is

What genome assembly is

What genome assembly is

Sequencers cannot read a chromosome from end to end. They read millions of short fragments at random positions. Assembly puts the fragments back together by finding where they overlap.

⏱ 10 min readModule 6 · Genome assemblyFree
Lesson at a glance3 steps · about 10 min
  1. Two situations
  2. Coverage
  3. Why it is hard: repeats

Two situations

Module 5 started from reads and a reference genome: you checked read quality, trimmed adapters, aligned the reads and counted them per gene. All of that relied on someone else having already assembled the genome. This module removes that support and asks how the genome itself is built from reads, so that you can work on organisms nobody has sequenced before.

Genome assembly means rebuilding the full DNA sequence of an organism from the short fragments a sequencer reads. Whether you need to do it depends on one thing: is there already a good reference genome, a finished sequence of the same species that you can line your reads up against?

A reference exists
  • Human, mouse, most model organisms
  • Align reads to it (as in Module 5)
  • Fast, and good for finding differences
No reference, or a new strain
  • A new bacterial isolate, a non-model species
  • De novo assembly from the reads alone
  • Needed to find genes, structure and anything new

De novo is Latin for "from the beginning": the assembler starts with no map at all and works only from how the reads overlap each other. Alignment, by contrast, can only report what fits onto the reference. If a new bacterial isolate carries a gene that the reference strain lacks, for example an antibiotic resistance gene picked up on a plasmid (a small circle of DNA separate from the chromosome), its reads have nowhere to align and quietly drop out of the analysis. An assembly keeps them, because it is built from the sample's own reads.

Why not assemble every time, then? Assembly needs more data, more computing time and more checking than alignment, and the result is a new sequence with its own errors and gaps. A good reference, by contrast, has been checked and annotated over many years, so a read aligned to it immediately lands on a known gene with a known name and position. For human or mouse samples, alignment is almost always the right choice. The difficult middle case is a species with only a distant relative sequenced: reads from regions that have diverged align poorly or not at all, and differences between the two species can be mistaken for mutations in your sample. That is a common reason to assemble even when some reference exists.

Bacterial genomes are the usual starting point because they are small and mostly free of the long repeats that make large genomes hard. A typical bacterium such as Escherichia coli has a genome of about 5 million bases. The practice genome in this module is much smaller, about 32 thousand bases, so that every step runs in seconds on a laptop.

What comes out of an assembler is a FASTA file: a list of sequences, each with a name line starting with > and then the bases. Each sequence is one contig, a term explained at the end of this lesson. A draft genome is one still in several pieces; a complete or closed genome has one sequence per chromosome and plasmid with no gaps. Most short-read bacterial assemblies are drafts, and for many questions, such as which genes are present, a good draft is enough.

Coverage

Coverage (or depth) is how many times, on average, each base of the genome was read. It is the total sequenced bases divided by the genome size.

Coverage matters for assembly in two ways. Reads land at random, so some stretches are read many times and others by chance hardly at all; higher average coverage makes it less likely that any stretch is missed altogether, which would leave a gap. And every read contains a few errors, so each base needs to be seen several times for the correct letter to outvote the mistakes. The command below measures how much sequence you have, which is the first half of the calculation.

A second example shows how this scales. To reach 100× on a 5-million-base E. coli genome you need 5,000,000 × 100 = 500 million bases. With pairs of 150-base reads, each pair gives 300 bases, so that is about 1.7 million pairs. More is not always better: beyond a few hundred times coverage the number of read errors grows with the data, and some assemblers slow down or produce extra small, false contigs, which is why very deep data are often subsampled back to around 100× before assembly. Note also that coverage should be worked out on the reads you actually assemble. If you trimmed them as in Trimming and filtering, the total bases are a few per cent lower than in the raw files.

Terminal
conda activate asm
seqkit stats data/bact_R1.fastq.gz data/bact_R2.fastq.gz
file format type num_seqs sum_len min_len avg_len max_len data/bact_R1.fastq.gz FASTQ DNA 7,500 937,500 125 125 125 data/bact_R2.fastq.gz FASTQ DNA 7,500 937,500 125 125 125

What this does

  • conda activate asm switches to the conda environment called asm, which holds the assembly tools for this module. Keeping each project's tools in their own environment stops their versions from clashing. Module 3 showed how to create and use environments like this one.
  • seqkit stats reads each FASTQ file and prints one summary line per file. Here it is given the two files of a paired-end run: R1 holds the first read of each pair and R2 the second.

Reading the output

  • num_seqs is the number of reads: 7,500 in each file. The two numbers must match, because each read in R1 has its partner at the same position in R2. So there are 7,500 pairs, or 15,000 reads.
  • sum_len is the total number of bases in the file: 937,500. That is 7,500 reads × 125 bases.
  • min_len, avg_len and max_len are all 125, so every read has the same length. This tells you the reads have not been trimmed; trimming would make some of them shorter.

Worked example · coverage of the practice run

bases sequenced = 937,500 + 937,500 = 1,875,000
genome size (true) = 31,950 bases
coverage = 1,875,000 ÷ 31,950 = about 59×

For bacterial short-read assembly, 50–100× is a common target. In real projects you do not know the genome size in advance; K-mers and genome size estimates it from the reads.

Step by step. Add the bases in the two files: 937,500 + 937,500 = 1,875,000. Divide by the genome size: 1,875,000 ÷ 31,950 = 58.7, which rounds to 59. Each base of the practice genome was therefore read about 59 times.

What the answer means. 59× sits inside the 50–100× range, so this run has enough data for a good short-read assembly. It is an average: some positions will have been read 40 times and others 80, and that spread is normal. Remember the order of the calculation for later lessons: total bases first, then divide by genome size. A common slip is to forget that a paired run has two files and count only one, which halves the coverage.

Go deeper: how much of the genome is missed at a given coverage

If reads land at random, the share of bases that no read covers at all is about e to the power of −c, where c is the coverage and e ≈ 2.718. This result comes from Lander and Waterman (1988). At 1× coverage it is about 0.37: more than a third of the genome is never read. At 3× it is about 0.05, or 5%, and at 10× about 0.005%.

At 59× the chance of any one base being missed is so small that, in a 32 kb genome, you would expect no gaps from chance at all. Real gaps at high coverage have other causes: repeats, and regions that library preparation copies poorly, such as stretches very rich in G and C. So the formula gives the best case, not a prediction of what you will see.

Why it is hard: repeats

If a stretch of DNA occurs more than once and is longer than the reads (and the distance between read pairs), the reads cannot tell which copy they came from, or how the copies connect. The assembler stops at the repeat, so the genome ends up in several pieces called contigs. Errors in the reads and uneven coverage add to the difficulty.

Errors cause trouble because a single wrong base creates a short stretch of sequence that exists in one read and nowhere in the genome. To the assembler it looks like a possible side branch, and it must decide whether the branch is real variation or a mistake. Uneven coverage makes that decision harder: a stretch read only a few times can look as weak as an error and be thrown away.

A repeat is any sequence present in two or more nearly identical copies. Bacteria usually carry several copies of their ribosomal RNA genes, each copy several thousand bases long, and many also carry insertion sequences, small mobile elements of one to two thousand bases that copy themselves around the genome. The human genome is far more repetitive: one family alone, the Alu elements, is about 300 bases long and present in around a million copies.

Read pairs help up to a point. In a paired-end run both ends of a DNA fragment a few hundred bases long are read, so the two reads of a pair are known to lie a set distance apart. If that distance is longer than a repeat, one read can sit on each side and link them. A repeat longer than the fragment defeats both the reads and the pairs. The word contig comes from "contiguous": each contig is one unbroken stretch of sequence the assembler is confident about.

On real data the effect is easy to see. A short-read assembly of a typical bacterium usually comes out in tens to a couple of hundred contigs, and many of the breaks fall at the ribosomal RNA genes and insertion sequences. The repeat copies are often collapsed: the assembler builds one contig for all of them, so that contig has roughly two or three times the coverage of its neighbours. A common pitfall is to read a collapsed repeat as a single-copy gene and undercount it. Assembly graphs, later in this module, shows how the assembler represents these junctions, and Judging an assembly shows how to spot collapsed and missing sequence.

What genome assembly is · LSMA free course A genome contains the same repeat twice. Short reads land at random; reads that fall wholly inside a repeat could have come from either copy. Overlapping the reads gives three unique contigs and one repeat contig that stands for both copies. 1 · ONE GENOME, A REPEAT PRESENT TWICE repeat copy 1 repeat copy 2 2 · SHORT READS AT RANDOM POSITIONS 3 · OVERLAPS GIVE CONTIGS, BROKEN AT THE REPEAT contig 1 repeat, both copies contig 2 contig 3
The two pale reads lie wholly inside a repeat copy and could belong to either. The assembler cannot tell how the pieces join across the repeat, so it stops there: three unique contigs plus one contig standing for both repeat copies. Schematic, not to scale.

The problems repeats cause for short reads are reviewed by Treangen and Salzberg (2012, Nature Reviews Genetics). The figure of around a million Alu copies comes from the first analysis of the human genome sequence (International Human Genome Sequencing Consortium, Lander et al. 2001, Nature), which found that repeats make up about half of the genome. The first gap-free human assembly is Nurk et al. (2022, Science). Copy numbers for repeat families are estimates that depend on how similar a copy must be to count, so quote them as approximate and cite the source and the genome version.

Key point

Read length decides which repeats can be resolved. Short reads give accurate but fragmented assemblies; long reads span repeats and give whole chromosomes.

A second example: for many years the human reference genome still had gaps, mostly in long, highly repetitive regions such as the centromeres, the pinched middles of chromosomes. The first gap-free human assembly, published in 2022, depended on long reads that were able to cross those repeats. More short reads alone would never have closed them.

Further reading · Module 6Why are de Bruijn graphs useful for genome assembly?: a short, open-access primer on assembly graphs. Read this one even if you read nothing else. · The T2T-CHM13 project page: the complete human genome and its downloads. · All reading for this course

Check your understanding

1. A 5 Mb genome is sequenced with 2 million reads of 150 bases. What is the coverage?

2. When is de novo assembly needed?

3. What usually breaks a short-read assembly into contigs?

Up next

Lesson 2

K-mers and genome size

Ask BioTutor

Create a free website with Framer, the website builder loved by startups, designers and agencies.