Abstract
Analysis of genomic and metagenomic sequences is inherently more challenging than that of amino acid sequences due to the higher divergence among evolutionarily related nucleotide sequences, variable k-mer and codon usage within and among genomes of diverse species, and poorly understood selective constraints. We introduce Scorpio (Sequence Contrastive Optimization for Representation and Predictive Inference on DNA), a versatile framework designed for nucleotide sequences that employ contrastive learning to improve embeddings. By leveraging pre-trained genomic language models and k-mer frequency embeddings, Scorpio demonstrates competitive performance in diverse applications, including taxonomic and gene classification, antimicrobial resistance (AMR) gene identification, and promoter detection. A key strength of Scorpio is its ability to generalize to novel DNA sequences and taxa, addressing a significant limitation of alignment-based methods. Scorpio has been tested on multiple datasets with DNA sequences of varying lengths (long and short) and shows robust inference capabilities. Additionally, we provide an analysis of the biological information underlying this representation, including correlations between codon adaptation index as a gene expression factor, sequence similarity, and taxonomy, as well as the functional and structural information of genes.
Introduction
Traditional DNA sequence alignment tools, such as BLAST or MMseqs2, are foundational to genomics but face significant hurdles when processing complex metagenomic data. While highly effective at identifying known sequences, these methods often fail to recognize novel or highly divergent genes. Alignment-free alternatives based on k-mer frequencies offer speed but frequently sacrifice the positional context essential for understanding gene function. To bridge this gap, we present Scorpio, a framework designed to generate rich, generalizable DNA embeddings that capture both taxonomic and functional information.
Methodology: The Scorpio Framework
Scorpio (Sequence Contrastive Optimization for Representation and Predictive Inference on DNA) utilizes a triplet network approach for contrastive learning. The model is trained to minimize the distance between an "anchor" sequence and a biologically similar "positive" sequence, while maximizing the distance from a dissimilar "negative" sequence.
The framework employs diverse encoders, including 6-mer frequency counters and transformer-based BigBird models optimized for long sequences. A key innovation is hierarchical sampling, which teaches the model biological relationships across multiple levels of the tree of life simultaneously. For inference, Scorpio integrates FAISS for rapid nearest-neighbor retrieval and a custom confidence scoring mechanism to ensure high-precision classification.
Key Insights and Results
Scorpio demonstrates superior performance in classifying unseen sequences. On the "Gene Out" evaluation—which tests the model's ability to classify genes it has never seen during training—Scorpio achieved phylum-level accuracy up to 17x higher than MMseqs2 and 67x higher than Kraken2. In zero-shot AMR prediction, the Scorpio-BigDynamic model reached ~93% accuracy, significantly outperforming specialized tools like Abricate (34%).
Beyond classification, Scorpio's embeddings capture intrinsic biological signals, such as the Codon Adaptation Index (CAI), which correlates with gene expression efficiency. This suggests the model learns fundamental biological semantics independent of simple sequence matching. Furthermore, the model's success in promoter detection—improving MCC by 18% over raw pre-trained models—highlights the value of contrastive fine-tuning.
Conclusion
While Scorpio shows robust performance, challenges remain with extremely short (150 bp) or error-prone reads and data imbalance at lower taxonomic levels. Future work will focus on expanding training data diversity, incorporating functional annotations, and optimizing retrieval speeds using technologies like ScaNN. Scorpio represents a significant step toward more resilient and informative genomic analysis tools.
Summary updated