WGSQuikr: Fast Whole-Genome Shotgun Metagenomic Classification

David Koslicki, Simon Foucart, Gail RosenPLoS 2014

Abstract

With the decrease in cost and increase in output of whole-genome shotgun technologies, many metagenomic studies are utilizing this approach in lieu of the more traditional 16S rRNA amplicon technique. Due to the large number of relatively short reads output from whole-genome shotgun technologies, there is a need for fast and accurate short-read OTU classifiers. While there are relatively fast and accurate algorithms available, such as MetaPhlAn, MetaPhyler, PhyloPythiaS, and PhymmBL, these algorithms still classify samples in a read-by-read fashion and so execution times can range from hours to days on large datasets. We introduce WGSQuikr, a reconstruction method which can compute a vector of taxonomic assignments and their proportions in the sample with remarkable speed and accuracy. We demonstrate on simulated data that WGSQuikr is typically more accurate and up to an order of magnitude faster than the aforementioned classification algorithms. We also verify the utility of WGSQuikr on real biological data in the form of a mock community. WGSQuikr is a Whole-Genome Shotgun QUadratic, Iterative, K-mer based Reconstruction method which extends the previously introduced 16S rRNA-based algorithm Quikr.

Introduction

Metagenomics has undergone a paradigm shift from 16S rRNA sequencing toward Whole-Genome Shotgun (WGS) sequencing. While WGS offers a more comprehensive view of microbial communities, it generates massive volumes of data, often reaching millions or billions of short DNA reads. Traditional classification tools like MetaPhlAn or PhymmBL typically analyze these datasets by comparing every single read against a database. This "read-by-read" approach is computationally expensive, creating a significant bottleneck as sequencing throughput continues to explode. WGSQuikr addresses this by moving from individual read classification to a global mathematical reconstruction.

Methodology: A Reconstruction Approach

WGSQuikr treats taxonomic classification as a system of linear equations: $A^{(k)}x \approx s^{(k)}$.

  1. The Training Matrix ($A$): Pre-calculated frequencies of all possible $k$-mers (short DNA sequences of length $k$) for thousands of known bacterial genomes (1,401 genomes and 1,082 plasmids from NCBI).
  2. The Sample Vector ($s$): Calculated $k$-mer frequencies across the entire pool of reads in a new metagenomic sample.
  3. The Reconstruction ($x$): Using nonnegative least squares (NNLS)—a technique from compressive sensing—the algorithm finds the vector $x$ representing the relative abundance of each bacteria that best explains the observed $k$-mer frequencies.

A key innovation is the use of $k=7$. This length provides a unique "fingerprint" for different taxonomic groups while keeping $k$-mer frequency calculations nearly instantaneous.

Key Insights

A major advantage of WGSQuikr is its decoupled execution time. Because the algorithm solves a fixed-size linear system based on global $k$-mer counts, the "solve" step's duration is nearly constant, regardless of the sample's total read count. Only the initial $k$-mer counting scales with data size, and this process is extremely efficient.

Execution time vs. number of reads for WGSQuikr, MetaPhyler, and MetaPhlAn.

Furthermore, WGSQuikr is highly robust to short reads (35–50 bp). Unlike marker-gene or BLAST-based methods that struggle with short sequences lacking unique identifiers, WGSQuikr's global distribution approach maintains high performance.

Results

The authors evaluated WGSQuikr using 720 simulated datasets (totaling over 1 billion reads) and the Human Microbiome Project (HMP) "even" mock microbial community.

Speed

WGSQuikr demonstrated significant speed advantages. On datasets with 5 million reads, it was 27 times faster than MetaPhyler and 5 times faster than MetaPhlAn. A mock community of 6 million reads was processed in under 8 minutes on a standard laptop.

Accuracy

At the genus level, WGSQuikr achieved a mean $\ell_1$-error (total absolute error) of 0.644, significantly lower than MetaPhyler (1.006) and MetaPhlAn (0.984).

Distribution of $\ell_1$-error for taxonomic reconstruction at the genus level.

Limitations and Future Work

While WGSQuikr excels at genus-level classification, its performance at the species or strain level is currently more limited. Like all database-dependent methods, its accuracy decreases when samples contain "novel" bacteria not present in the training matrix. Future work will focus on optimizing the current MATLAB implementation and improving taxonomic resolution to better distinguish between closely related species.

A MATLAB implementation of WGSQuikr is available at: http://sourceforge.net/projects/wgsquikr.

Summary updated

BibTeX
@inproceedings{koslicki2014wgsquikr,
  author = {David Koslicki and Simon Foucart and Gail Rosen},
  title = {{WGSQuikr: Fast Whole-Genome Shotgun Metagenomic Classification}},
  booktitle = {PLoS},
  year = {2014},
  doi = {10.1371/journal.pone.0091784},
}
Figure