Deepurify: a multi-modal deep language model to remove contamination from metagenome-assembled genomes

Lu Zhang, Bohao Zou, Jingjing Wang, Yi Ding, Zhenmiao Zhang, Yufen Huang, Xiaodong Fang, Ka Chun Cheung, Simon SeeResearch 2023

Abstract

Metagenome-assembled genomes (MAGs) offer valuable insights into the exploration of microbial dark matter using metagenomic sequencing data. However, there is a growing concern that contamination in MAGs may significantly impact the downstream analysis results. Existing MAG decontamination methods heavily rely on marker genes but do not fully leverage genomic sequences. To address the limitations, we have introduced a novel decontamination approach named Deepurify, which utilizes a multi-modal deep language model employing contrastive learning to learn taxonomic similarities of genomic sequences. Deepurify utilizes inferred taxonomic lineages to guide the allocation of contigs into a MAG-separated tree and employs a tree traversal strategy for maximizing the total number of medium- and high-quality MAGs. Extensive experiments were conducted on two simulated datasets, CAMI I, and human gut metagenomic sequencing data. These results demonstrate that Deepurify significantly outperforms other decontamination methods.

Introduction

In metagenomics, researchers sequence DNA from entire environmental samples, such as soil or the human gut, rather than isolated cultures. A critical step in this process is "binning," where DNA fragments (contigs) are grouped into Metagenome-Assembled Genomes (MAGs). However, these bins are frequently "chimeric," containing a mixture of DNA from different species. This contamination can severely distort downstream biological interpretations.

Existing decontamination tools, such as MAGpurify or MDMcleaner, rely primarily on marker genes—specific, well-characterized genes—and alignment to reference databases. This approach faces two major hurdles: the "Dark Matter" problem, where over 95% of microbial species remain uncharacterized in databases, and a lack of resolution, as marker genes represent only a tiny fraction of the genome. Consequently, these tools often struggle to distinguish between closely related species where the majority of contamination occurs.

The Deepurify Framework

To overcome these limitations, we developed Deepurify, a multi-modal deep language model that treats genomic sequences and taxonomic lineages as two distinct "modalities" of the same information. This approach is inspired by CLIP (Contrastive Language-Image Pre-training), which links images with their textual descriptions.

Overview of the Deepurify framework, including the multi-modal contrastive learning model and the MAG decontamination pipeline.

Multi-modal Architecture and Contrastive Learning

Deepurify utilizes two specialized encoders:

  1. GseqFormer: A genomic sequence encoder designed to process DNA fragments.
  2. LSTM: A taxonomic encoder that processes lineage strings (e.g., Kingdom > Phylum > ... > Species).

During the training phase, the model employs contrastive learning to maximize the cosine similarity between a DNA sequence and its correct taxonomic lineage while minimizing similarity for incorrect pairings. This allows the model to learn the "evolutionary grammar" of DNA across the entire genome, rather than relying on a few conserved genes. This enables the model to accurately identify the lineage of even novel microbes absent from training databases.

MAG-Separated Tree and Traversal

Unlike traditional tools that simply delete suspicious contigs, Deepurify is reconstructive. It assigns every contig in a contaminated MAG to a taxonomic lineage and constructs a MAG-separated tree. Using a depth-first search (DFS) tree traversal strategy, the model identifies the optimal way to split a single contaminated MAG into one or more high-quality, clean genomes.

Experimental Results

Deepurify was evaluated against standard benchmarks (CAMI I) and real-world datasets, including a large cohort of patients with Irritable Bowel Syndrome with diarrhea (IBS-D).

  • Superior Accuracy: On simulated data, Deepurify’s F1-scores were nearly double those of MAGpurify. At the genus and species levels, Deepurify improved F1-scores by 40.54% and 63.72%, respectively, compared to MDMcleaner.
  • Real-World Impact: In the IBS-D dataset, Deepurify successfully rescued 70.12% of highly contaminated MAGs (completeness ≥ 50%, contamination ≥ 25%), converting them into medium- or high-quality genomes. In contrast, MAGpurify and MDMcleaner rescued only 1.4% and 0.7%, respectively.
  • Biological Discovery: By cleaning contaminated data, the authors identified five new species and one new genus within the IBS-D cohort that were previously obscured by genomic noise.

Discussion and Future Work

While Deepurify represents a significant leap forward, some limitations remain. The model currently assumes that individual contigs are "clean" and cannot yet address "chimeric contigs"—single fragments misassembled from two different species. Additionally, the integration of CheckM for quality assessment during tree traversal introduces a computational bottleneck.

Future iterations of Deepurify may integrate assembly error correction tools to mitigate intra-contig contamination and explore more efficient quality assessment metrics to streamline the pipeline. Nevertheless, Deepurify provides a powerful new lens for exploring the microbial dark matter with unprecedented precision.

Summary updated

BibTeX
@inproceedings{zhang2023deepurify,
  author = {Lu Zhang and Bohao Zou and Jingjing Wang and Yi Ding and Zhenmiao Zhang and Yufen Huang and Xiaodong Fang and Ka Chun Cheung and Simon See},
  title = {{Deepurify: a multi-modal deep language model to remove contamination from metagenome-assembled genomes}},
  booktitle = {Research},
  year = {2023},
  doi = {10.21203/rs.3.rs-3420465/v1},
}
Figure