Chapter 10: De Novo Metagenome Assembly: metaSPAdes & MEGAHIT
Chapter 10: De Novo Metagenome Assembly: metaSPAdes & MEGAHIT
Reference-based profiling cannot identify novel microbes missing from public databases. Metagenome assembly reconstructs contiguous genomic contigs de novo from mixed, multi-species sequencing reads.
Why Metagenome Assembly is Hard
Standard genome assemblers assume uniform coverage across a single diploid or haploid genome. In metagenomics, coverage spans four orders of magnitude (1x for rare taxa to 10,000x for dominant species), and inter-species homologous repeats create tangled de Bruijn graph tangles.
1. Assembling Metagenomes with MEGAHIT & metaSPAdes
# Option A: MEGAHIT (Ultra-fast, ultra-low memory for large cohorts)
megahit \\
-1 microbial_R1.fastq.gz -2 microbial_R2.fastq.gz \\
-t 16 \\
--k-min 21 --k-max 141 --k-step 12 \\
-o ./megahit_assembly/
# Option B: metaSPAdes (Maximum contig length, high RAM usage)
metaspades.py \\
-1 microbial_R1.fastq.gz -2 microbial_R2.fastq.gz \\
-t 32 -m 128 \\
-o ./metaspades_assembly/
# Assess assembly metrics with MetaQUAST
metaquast.py megahit_assembly/final.contigs.fa -o ./metaquast_report/