ResMiCo: Increasing the quality of metagenome-assembled genomes with deep learning

Olga Mineeva, Daniel Danciu, Bernhard Schölkopf, Ruth E. Ley, Gunnar Rätsch, Nicholas D. Youngblut · DOI

TL;DR

ResMiCo is a deep convolutional residual neural network designed for reference-free detection of misassembled contigs in metagenomics assemblies. By training on a massive, highly diverse synthetic dataset, it dramatically improves misassembly detection accuracy (AUPRC of 0.76 vs. 0.25 for existing tools), filters out bad contigs without sacrificing contiguity, and enables data-driven assembler hyperparameter tuning on real metagenomes.

What Problem Does This Paper Address?

Metagenome-assembled genomes (MAGs) now dominate microbial databases like GTDB and UHGG. However, assembling short sequencing reads into contiguous sequences (contigs) without a reference genome is error-prone. Variations in coverage, repetitive sequences, and cross-species chimeric joins frequently cause structural errors (e.g., inversions, relocations, translocations).

Traditional quality checks like CheckM only evaluate whether conserved single-copy marker genes are present or duplicated; they cannot pinpoint structural misassemblies. Meanwhile, existing reference-free machine learning predictors (such as DeepMAsED, metaMIC, and ALE) achieve low precision-recall performance (AUPRC $\le$ 0.57) and struggle to generalize to novel taxa, varying read depths, or different assemblers.

Methods

ResMiCo (Residual neural network for Misassembled Contig identification) formulates quality assessment as a supervised classification task on read-alignment features:

  • Feature Extraction: Reads are mapped back to assembled contigs using Bowtie2. ResMiCo extracts 23 per-position features and uses SHAP (Shapley Additive Explanations) to select the 14 most informative features (e.g., mapping quality, alignment scores, SNV counts, orphan read counts).
  • Residual Architecture: A 1D convolutional network structured into 4 residual groups (containing 2, 5, 5, and 2 residual blocks). Skip connections allow the network to learn long-range patterns (up to 20 kb) around structural breakpoints.
  • Handling Variable Lengths: Contigs are dynamically padded, passed through convolutional layers, masked to eliminate padding bias, and condensed via global average pooling before entering fully connected classification layers. Contigs longer than 20,000 bp are chunked with a 500 bp sliding stride, taking the maximum prediction score across chunks.
  • Efficient Engineering: Feature generation was implemented in C++ (yielding a $10\times$ speedup over standard samtools pileup routines) and orchestrated via Snakemake.

Datasets

  • Synthetic Benchmarks (MGSIM + ART):
  • n9k-train: 3,000 simulated metagenomes comprising 52.5M contigs (159 Gbp) across wide parameter spaces (richness 50–5,000, variable depths, error profiles, insert sizes, and assemblers MEGAHIT / metaSPAdes).
  • n9k-novel: 6.8M contigs from 9,000 reference genomes belonging entirely to families excluded from the training split.
  • n2k-novel-intra-species: A dedicated novel-family test set with high intra-species diversity.
  • CAMI Datasets: Standardized benchmarks from the Critical Assessment of Metagenome Interpretation challenge covering human gut, skin, oral, marine, and plant biomes.
  • Mock Communities: Real sequencing runs from BMock12 and MBARC-26.
  • Real-World Metagenomes: 7 published datasets (UHGG, TwinsUK, Animal-gut, Pinnell2019, Mantri2021, MarineMetagenomeDB, and TerrestrialMetagenomeDB) totaling over 8.2M contigs.

Key Insights and Ideas

  • Training Scale and Heterogeneity are Essential: Previous models failed largely because they were trained on small, homogeneous sets. Training on over 150 Gbp of simulated data spanning realistic community structures allowed ResMiCo to maintain high accuracy across entirely unseen taxonomic families and non-human biomes.
  • Alignment Signals Outweigh Discordant Read Flags: SHAP analysis revealed that features like mean mapping quality and alignment score statistics provide far stronger signals for misassemblies than the frequency of discordant read pairs, which previous tools heavily relied upon.
  • Assembler Tuning Beyond N50: Traditionally, researchers select assembler parameters (e.g., $k$-mer combinations) to maximize contig length (N50). The authors found that N50 frequently correlates with higher error rates. ResMiCo's predictions strongly correlate ($r \approx 0.9$) with ground-truth error rates, enabling researchers to optimize assembly parameters directly for accuracy without requiring mock controls.

Key Results

  • Benchmark Performance: On the taxonomically novel test set (n9k-novel), ResMiCo achieved an AUPRC of 0.766, outperforming DeepMAsED (0.251), ALE (0.080), and metaMIC (0.095). It maintained high performance across CAMI datasets (AUPRC 0.611–0.831; AUROC 0.965–0.991).
  • Contig Filtering: Discarding contigs with a ResMiCo score $>0.8$ cut the true misassembly rate on n9k-novel from 4.0% to 1.2%, while leaving assembly contiguity (N50: 3,919 vs. 3,917 bp) and reference genome coverage fraction virtually untouched.
  • Real-World Error Audit: ResMiCo detected that an average of $7\% \pm 5.7\%$ of contigs across real-world datasets are misassembled (ranging from 3.4% in TwinsUK to 12.5% in soil databases)—a substantially higher error rate than prior estimates (~1%).
  • Runtime: Processes 108 contigs/second on a single GPU (~38.7 contigs/second on CPU), enabling ~140,000 contigs to be screened per hour on a standard CPU.

Limitations and Future Work

  • Insert Size Sensitivity: ResMiCo's accuracy degrades if the sequencing library's mean insert size distribution deviates substantially from training bounds (117 to 493 bp).
  • Specific Error Types: The model performs worse on inversions compared to translocations or relocations, and accuracy dips on samples with very low coverage/richness or high intra-species diversity.
  • Binary Contig-Level Output: Currently, ResMiCo flags whether an entire contig is misassembled rather than outputting exact breakpoint base coordinates or characterizing the specific misassembly class.
  • Platform Scope: The model was trained exclusively on Illumina short reads and bacterial/archaeal genomes; it does not currently support error-prone long reads (e.g., Oxford Nanopore) or eukaryotic and viral metagenomes.

Summary updated

BibTeX
@article{mineeva2023resmico,
  author = {Olga Mineeva and Daniel Danciu and Bernhard Schölkopf and Ruth E. Ley and Gunnar Rätsch and Nicholas D. Youngblut},
  title = {{ResMiCo: Increasing the quality of metagenome-assembled genomes with deep learning}},
  journal = {PLOS Computational Biology},
  year = {2023},
  doi = {10.1371/journal.pcbi.1011001},
}
Figure