Genome Assembly
Algorithmic Track • Chapter 4
Estimated Study Time: 24 minutes • Level: Advanced
Learning Objectives
- Compare De Bruijn Graph (Eulerian path) vs Overlap-Layout-Consensus (Hamiltonian path) assembly paradigms.
- Understand repeat resolution boundaries and the necessity of long reads to span repetitive elements.
- Execute phased diploid dual-haplotype assembly with hifiasm using PacBio HiFi and Hi-C data.
- Evaluate assembly continuity and completeness using N50, L50, and BUSCO ortholog metrics.
1. The Fundamental Challenge: Genomic Repeats
De novo genome assembly reconstructs an unknown genome sequence from millions of fragmented sequencing reads without using a reference guide. The central mathematical obstacle is genomic repetitiveness. If a repetitive element (such as an Alu element, LINE-1 retrotransposon, or segmental duplication) is longer than the sequencing read length, the assembler cannot determine which unique flanking genomic regions connect through the repeat.
Figure 9.1: De Bruijn Graphs (k-mers) vs Overlap-Layout-Consensus (OLC) Graphs
2. Phased Assembly & Scaffolding CLI Workflow
# 1. Haplotype-resolved de novo assembly using hifiasm with Hi-C data
hifiasm -o human_asm -t 32 \
--h1 sample_hic_R1.fastq.gz --h2 sample_hic_R2.fastq.gz \
sample_hifi.fastq.gz
# Extract maternal and paternal phased contigs into FASTA format
awk '/^S/{print ">"$2"\n"$3}' human_asm.hic.hap1.p_ctg.gfa > hap1_contigs.fa
awk '/^S/{print ">"$2"\n"$3}' human_asm.hic.hap2.p_ctg.gfa > hap2_contigs.fa
# 2. Chromosome-scale scaffolding with YaHS
samtools faidx hap1_contigs.fa
bwa-mem2 mem -t 16 hap1_contigs.fa sample_hic_R1.fastq.gz sample_hic_R2.fastq.gz | \
samtools view -bh -F 2316 | samtools sort -n -@ 8 -o hic_aligned.bam -
yahs hap1_contigs.fa hic_aligned.bam -o hap1_scaffolded
# 3. Completeness benchmarking with BUSCO
busco -i hap1_scaffolded_scaffolds_final.fa -l primates_odb10 -m genome -c 16 -o busco_eval