Inferensys

Glossary

VirSorter

A bioinformatics tool that identifies viral sequences from metagenomic data by leveraging a probabilistic model that integrates multiple lines of evidence, including the presence of viral hallmark genes and statistical departures from microbial genomic features.
Developer demonstrating multi-agent tool use, agent tool selection interface on laptop, casual tech demo moment.
VIRAL SEQUENCE DETECTION

What is VirSorter?

VirSorter is a computational tool that identifies viral sequences in metagenomic data using a probabilistic model integrating viral hallmark genes, non-Caudovirales gene enrichment, and statistical deviations from microbial genomic features.

VirSorter is a reference-dependent and reference-independent tool designed to detect viral contigs from mixed microbial community sequencing data. It operates by evaluating each assembled contig against a curated database of viral hallmark genes—specifically those encoding capsid proteins, terminases, and replication machinery—while simultaneously assessing the enrichment of genes characteristic of non-Caudovirales lineages and calculating statistical departures from expected microbial nucleotide signatures.

The classifier employs a probabilistic scoring framework that integrates multiple lines of evidence into confidence categories, enabling the recovery of both known and divergent viruses, including prophages integrated into bacterial genomes. By leveraging hidden Markov model profiles from the Pfam and VOGDB databases, VirSorter distinguishes viral sequences from microbial genomic background, making it a foundational component in viral metagenomics pipelines for constructing viral operational taxonomic units and expanding the catalog of the global virome.

PROBABILISTIC VIRUS DETECTION

Key Features of VirSorter

VirSorter identifies viral sequences from metagenomic data by integrating multiple lines of evidence into a probabilistic model, moving beyond simple homology searches to detect novel and divergent viruses.

01

Multi-Modal Evidence Integration

VirSorter combines three independent lines of evidence into a unified probabilistic score:

  • Viral Hallmark Genes: Detection of capsid, terminase, and other structural proteins using hidden Markov models (HMMs) from Pfam and custom viral databases
  • Non-Caudovirales Gene Enrichment: Statistical enrichment of genes characteristic of non-tailed viruses, distinguishing them from prophage elements
  • Compositional Departure: Identification of genomic regions with nucleotide composition (k-mer frequencies, GC skew) that deviate significantly from microbial host signatures

This multi-signal approach enables detection of highly divergent viruses that lack detectable nucleotide similarity to known references.

02

Two-Tier Classification Confidence

VirSorter assigns predictions into confidence categories to help researchers prioritize results:

  • Category 1 (Most Confident): Contigs with strong viral hallmark gene evidence AND significant compositional departure from microbial norms
  • Category 2 (Likely): Contigs with viral hallmark genes but weaker compositional signal, or strong compositional signal without hallmark genes
  • Category 3 (Possible): Contigs with marginal evidence, often short sequences or prophage regions integrated into host chromosomes
  • Category 4-6: Progressively lower confidence, often representing prophages, gene transfer agents, or false positives

This tiered system reduces manual curation burden by surfacing the highest-confidence viral predictions first.

03

Prophage Boundary Detection

VirSorter includes specialized logic for delineating prophage integration boundaries within microbial genomes:

  • Identifies the transition zones where viral-like compositional signatures revert to host-like signatures
  • Uses sliding window analysis of k-mer frequencies and gene content to pinpoint attachment sites
  • Distinguishes between active prophages (retaining viral gene synteny) and degraded prophage remnants (gene order disrupted by host evolution)

This capability is critical for studying lysogenic conversion, horizontal gene transfer, and the evolutionary arms race between phages and their hosts.

04

Reference Database Architecture

VirSorter relies on a curated hierarchical reference database rather than raw sequence similarity:

  • HMM Profiles: Custom-built hidden Markov models trained on viral protein families from RefSeqVirus and manually curated prophage datasets
  • Taxonomic Stratification: Separate models for different viral groups (Caudovirales, ssDNA viruses, RNA viruses) to improve specificity
  • Host Contamination Filters: Explicit exclusion of HMMs matching conserved bacterial and archaeal proteins to reduce false positives

This profile-based approach captures remote homology that BLAST-based methods miss, enabling detection of viruses with no close sequenced relatives.

05

Virome Decontamination Logic

VirSorter implements post-hoc filtering to remove non-viral sequences that pass initial scoring:

  • Ribosomal RNA Screening: Flags contigs containing 16S/18S rRNA genes, which are definitive markers of cellular organisms
  • Universal Single-Copy Gene Check: Cross-references against bacterial/archaeal marker gene sets (e.g., TIGRFAMs) to identify misclassified cellular contigs
  • Plasmid Discrimination: Uses replicon typing and conjugation gene detection to separate viral sequences from conjugative plasmids and integrative conjugative elements (ICEs)

This decontamination step is essential for generating high-purity viral genome catalogs from complex metagenomes.

06

Integration with Downstream Pipelines

VirSorter outputs are designed for seamless integration into broader metagenomic workflows:

  • CheckV Compatibility: Viral contigs can be directly passed to CheckV for completeness estimation, host contamination removal, and quality assessment
  • DRAM-v Integration: Predicted viral contigs feed into DRAM-v for functional annotation of auxiliary metabolic genes (AMGs)
  • vConTACT2 Clustering: Outputs support protein-sharing network analysis for taxonomic assignment of novel viral clusters
  • iVirus Ecosystem: Part of the CyVerse-supported iVirus toolkit, enabling cloud-based analysis of large-scale viromic datasets

This interoperability makes VirSorter a foundational component of modern viral ecogenomics pipelines.

VIRUS DETECTION

Frequently Asked Questions

Common questions about the VirSorter tool for identifying viral sequences in metagenomic and microbial genomic datasets.

VirSorter is a probabilistic bioinformatic tool designed to identify viral sequences from metagenomic and microbial genomic data. It works by integrating multiple independent lines of evidence into a unified prediction model rather than relying on a single detection method. The tool evaluates each input sequence against three core criteria: the presence of viral hallmark genes (such as capsid proteins, terminases, and replication modules), enrichment of genes characteristic of non-Caudovirales viruses, and statistical departures from expected microbial genomic features like strand-switching patterns and nucleotide composition. VirSorter uses a curated database of hidden Markov model (HMM) profiles from known viral protein families and applies a random forest classifier to combine these heterogeneous signals into a confidence score. The output categorizes predictions into confidence categories (Categories 1-6), with Category 1 and 2 representing the highest-confidence viral identifications. This multi-evidence approach significantly reduces false positives compared to single-feature methods, particularly when distinguishing integrated prophages from bacterial genomic islands.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.