Reducing haystacks to needles – ViralClust: A Nextflow pipeline to cluster viral sequences

This article has been Reviewed by the following groups

Read the full article See related articles

Abstract

Background

The rapid accumulation of viral genome sequences presents major challenges for downstream analysis tools, including tools for multiple sequence alignments, phylogeny, and genome/alignment visualization, due to computational constraints and sampling biases caused by outbreak-driven over-representation. Selecting representative genomes through clustering offers a principled alternative to random subsampling, yet choosing appropriate clustering strategies remains non-trivial and context dependent.

Results

Here, we present ViralClust , a modular Nextflow pipeline for bias-aware representative selection from large viral genome datasets. ViralClust integrates five distinct clustering algorithms ( CD-HIT-EST , SUMACLUST , VSEARCH , MMSeqs2 , and HDBSCAN ) within a unified workflow, enabling direct comparison of clustering outcomes and flexible adaptation to diverse biological questions, considering a balanced phylogenic distribution of the selected sequences. We evaluated ViralClust on six RNA and DNA virus datasets ranging from 632 to 156,586 sequences and spanning genome lengths from 890 to 197,185 nucleotides. Across all datasets, clustering reduced dataset size by ∼95 % or more while preserving genetic diversity across species, genera, and families, and effectively mitigating biases introduced by outbreaks, partial genomes, and sequence orientation artifacts.

Conclusions

By supporting whole-genome clustering and scalable representative selection, ViralClust enables efficient and reproducible downstream analyses that would otherwise be computationally infeasible. Our framework provides a flexible foundation for large-scale viral genomics and supports future applications in comparative analysis and virus classification.

Key Points

  • ViralClust is a modular Nextflow pipeline for selecting representative viral genomes from (very) large sequence datasets.

  • It combines multiple clustering approaches to reduce dataset size while minimizing bias and preserving genetic diversity.

  • Tests on six RNA and DNA virus datasets show reductions of ∼95 % across a wide range of genome sizes and sequence counts.

  • ViralClust enables efficient and reproducible downstream analyses that are otherwise impractical with full viral genome collections.

Article activity feed

  1. AbstractBackground The rapid accumulation of viral genome sequences presents major challenges for downstream analysis tools, including tools for multiple sequence alignments, phylogeny, and genome/alignment visualization, due to computational constraints and sampling biases caused by outbreak-driven over-representation. Selecting representative genomes through clustering offers a principled alternative to random subsampling, yet choosing appropriate clustering strategies remains non-trivial and context dependent.Results Here, we present ViralClust, a modular Nextflow pipeline for bias-aware representative selection from large viral genome datasets. ViralClust integrates five distinct clustering algorithms (CD-HIT-EST, SUMACLUST, VSEARCH, MMSeqs2, and HDBSCAN) within a unified workflow, enabling direct comparison of clustering outcomes and flexible adaptation to diverse biological questions, considering a balanced phylogenic distribution of the selected sequences. We evaluated ViralClust on six RNA and DNA virus datasets ranging from 632 to 156,586 sequences and spanning genome lengths from 890 to 197,185 nucleotides. Across all datasets, clustering reduced dataset size by ∼95 % or more while preserving genetic diversity across species, genera, and families, and effectively mitigating biases introduced by outbreaks, partial genomes, and sequence orientation artifacts.Conclusions By supporting whole-genome clustering and scalable representative selection, ViralClust enables efficient and reproducible downstream analyses that would otherwise be computationally infeasible. Our framework provides a flexible foundation for large-scale viral genomics and supports future applications in comparative analysis and virus classification.

    This work has been peer reviewed in GigaScience (see https://doi.org/10.1093/gigascience/giag090), which carries out single-anonymized peer review. These reviews are published under a CC-BY 4.0 license and were as follows:

    Reviewer 2:

    Sandra Triebel et al. build a modular Nextflow pipeline—ViralClust for clustering large viral genome datasets and selecting representative sequences in a bias-aware way. The pipeline integrates five clustering tools (CD-HIT-EST, SUMACLUST, VSEARCH, MMSeqs2, and HDBSCAN), offers optional evaluation outputs (MSA + rough phylogenetic representations), and produces HTML summaries and per-tool representative sets. While the pipeline sounds a good tool to addresses a genuine need in viral genomics, several major concerns regarding validation, methodological clarity, and practical implementation need to be addressed.

    Major Comments.

    1. Although the author demonstrated that clustering preserves the phylogenetic topology, they did not adequately verify whether the selected representative strains retained biologically relevant traits such as host range, geographic distribution, temporal dynamics, or phenotypic characteristics.
    2. The author present results under various parameter combinations but does not adequately explain how users should select appropriate parameters based on specific research questions, which can be confusing for those unfamiliar with the context. For example, when should users use a 70% rather than a 90% sequence similarity threshold? How does this choice affect different downstream analyses?
    3. Recombination occurs across multiple viral families, and the authors did not adequately explain how recombinant sequences are handled during the clustering process. Depending on the genomic regions used to calculate similarity, recombinant genomes may yield divergent clustering outcomes. The authors should discuss whether their method is applicable to highly recombinant viruses and clarify whether additional preprocessing steps (such as recombination detection or removal) are necessary.
    4. The author mentions that HDBSCAN is not suitable for large datasets and that MMseqs2 is faster but does not provide specific data on computational requirements under different dataset sizes and parameter combinations. For users handling ultra-large datasets, such information is very important for analysis planning.

    Minor Comments.

    1. The introduction would be more appealing if it briefly discusses existing methods for handling large-scale viral datasets (such as reference-based alignment and k-mer approaches) and explains why cluster-based representative sequence selection offers advantages in certain applications.
    2. The table 4 comparing clustering results would be more informative if it included a column showing the percentage of total diversity captured by each method, perhaps using a metric like phylogenetic diversity (PD) or sum of branch lengths in the representative tree versus the full tree.
    3. The split graphs of IAV segments showing partial and reverse complement sequences (Figure 7) are informative, but it would benefit from quantitative metrics on how many sequences were affected and how correction improved clustering results. Provide a table summarizing the number of sequences in each category before and after correction.
    4. The Figure 8 showing the relationship between sequence similarity threshold and number of clusters are useful, but they only show results for segments 3 and 6. Either show results for all segments in supplementary materials or explain why these two segments were chosen as representatives.
    5. Discussion the statement "Large and unevenly sampled datasets are often computationally infeasible to analyze", is somewhat vague. Specify what types of analyses become infeasible, such as multiple sequence alignment.
  2. AbstractBackground The rapid accumulation of viral genome sequences presents major challenges for downstream analysis tools, including tools for multiple sequence alignments, phylogeny, and genome/alignment visualization, due to computational constraints and sampling biases caused by outbreak-driven over-representation. Selecting representative genomes through clustering offers a principled alternative to random subsampling, yet choosing appropriate clustering strategies remains non-trivial and context dependent.Results Here, we present ViralClust, a modular Nextflow pipeline for bias-aware representative selection from large viral genome datasets. ViralClust integrates five distinct clustering algorithms (CD-HIT-EST, SUMACLUST, VSEARCH, MMSeqs2, and HDBSCAN) within a unified workflow, enabling direct comparison of clustering outcomes and flexible adaptation to diverse biological questions, considering a balanced phylogenic distribution of the selected sequences. We evaluated ViralClust on six RNA and DNA virus datasets ranging from 632 to 156,586 sequences and spanning genome lengths from 890 to 197,185 nucleotides. Across all datasets, clustering reduced dataset size by ∼95 % or more while preserving genetic diversity across species, genera, and families, and effectively mitigating biases introduced by outbreaks, partial genomes, and sequence orientation artifacts.Conclusions By supporting whole-genome clustering and scalable representative selection, ViralClust enables efficient and reproducible downstream analyses that would otherwise be computationally infeasible. Our framework provides a flexible foundation for large-scale viral genomics and supports future applications in comparative analysis and virus classification.

    This work has been peer reviewed in GigaScience (see https://doi.org/10.1093/gigascience/giag090), which carries out single-anonymized peer review. These reviews are published under a CC-BY 4.0 license and were as follows:

    Reviewer 1:

    The authors present ViralClust, a modular Nextflow pipeline designed to address the computational challenges and sampling biases associated with the rapid accumulation of viral genome sequences. By integrating five distinct clustering algorithms (CD-HIT-EST, SUMACLUST, VSEARCH, MMSeqs2, and HDBSCAN), the pipeline offers a complete workflow from data pre-processing to representative sequence selection. The authors evaluated the tool on six viral datasets of varying size and type, including Orthoebolavirus, Hepacivirus, Influenza A, and Monkeypox virus. This is a highly practical tool, particularly given the context of rapidly expanding viral genomic databases. The manuscript is well-structured, and the test datasets are representative, covering diverse viral characteristics. However, there is room for improvement regarding the analysis of specific algorithm performance, user guidance, and the presentation of results.

    Specific Comments:

    1. Currently, ViralClust functions more as a "toolbox" of aggregated methods rather than a mature, user-friendly "solution." Although five clustering algorithms are provided, the manuscript lacks sufficient guidance on the specific application scenarios for each. I recommend that the authors design a comprehensive scoring metric to rank the clustering results of each algorithm, providing a reference for users. Alternatively, please provide recommended algorithms or parameter presets (profiles) tailored to different analysis scenarios (e.g., specific profiles for RNA viruses, DNA viruses, or segmented viruses). This would significantly aid users in selecting the most appropriate strategy.

    2. The Results section is currently somewhat verbose and repetitive. As this is a Method/Tool paper, the core focus should be on demonstrating the tool's generalizability, accuracy, and the comparative logic between different algorithms, rather than a monotonous recitation of statistics for every dataset. Please consolidate the Results into 1-2 focused sections. Avoid listing exhaustive statistics for every case study and instead focus on summarizing trends and algorithmic differences.

    3. The authors mention filtering out sequences containing less than 90% ACGT characters. Ambiguous bases (e.g., N, R, Y) are very common in consensus sequences, and strict filtering may be inappropriate. For instance, in the Monkeypox analysis, SUMACLUST discarded approximately 66% of the sequences, which is a significant loss of data. Consider relaxing this filter or modifying the strategy to calculate non-ACGT content only within Open Reading Frames (ORFs) to avoid discarding potentially valuable genomic data.

    4. The authors noted that the easy-linclust module of MMSeqs2 performed poorly on the large Influenza A dataset and hypothesized that easy-linclust is unsuitable for such data. Since ViralClust is explicitly aimed at handling "large-scale" data, it is insufficient to merely report this failure. I suggest the authors attempt to integrate other MMSeqs2 clustering modules, such as the easy-cluster, to see if results improve. If an alternative module performs better, it should be implemented as an alternative option or fallback within the pipeline.

    5. The evaluation reveals a critical limitation in HDBSCAN, which tends to misclassify biologically significant but low-abundance lineages as noise—evidenced by the failure to identify TAFV and rare Influenza subtypes (H17/H18, N10/N11), alongside a disproportionately high generation of singletons (e.g., 1,333 in Flaviviridae). As the current requirement to manually recover these files undermines the pipeline's automation and poses a risk of data loss, I strongly recommend implementing a parameter (e.g., --keep_singletons) to automatically include unclustered sequences in the final representative output, while also expanding the Discussion/User guidance to explicitly warn users about the trade-offs of using density-based clustering for rare variant detection.

    6. Please include the maximum memory consumption (Peak RAM) for each dataset in Table 1. While runtimes are provided, memory usage is a critical factor for users handling large datasets.