HapSolo2 is a reimplementation of HapSolo that accelerates and modernizes the ortholog-guided removal of secondary haplotigs from heterozygous diploid genome assemblies. The original HapSolo treated haplotig removal as an optimization problem that searched three pairwise alignment thresholds—percent identity, query coverage, and the ratio of aligned query to aligned reference length—to minimize a cost defined over single-copy, duplicated, and missing conserved orthologs. However, the first implementation required per-contig BUSCO v3 runs, depended on Python 2.7 and pandas inside its inner loop, used a single randomized forward-walk optimizer, and relied on OrthoDB v9 lineage datasets that are no longer distributed.
HapSolo2 addresses these limitations while preserving the original optimization concept and cost definition.
HapSolo2 retains the optimization framework that balances single-copy, duplicated, and missing conserved orthologs but extends the search methods. In addition to the original randomized forward-walk optimizer, HapSolo2 adds steepest descent and simulated annealing optimizers. These additional optimizers provide alternative search strategies that explore threshold space differently and can converge on low-cost solutions using distinct update rules.
Across 45 runs on four diploid assemblies and three OrthoDB releases, the three optimizers (random walk, steepest descent, and simulated annealing) reached best costs within 1.8% of one another, indicating consistent convergent performance across optimizer types.
A central change in HapSolo2 is the removal of the per-contig BUSCO v3 requirement. Instead, HapSolo2 performs ortholog classification using miniprot against OrthoDB lineage datasets (OrthoDB v9, v10, or v12.2). This change eliminates the need to run BUSCO separately for every contig and removes dependency on legacy BUSCO workflows while maintaining ortholog-guided scoring.
By using miniprot and current OrthoDB releases, HapSolo2 supports reproducible ortholog classification across different OrthoDB versions and reduces setup complexity for users.
HapSolo2 evaluates all optimization walkers in batched CuPy array operations on a single GPU, which accelerates the large number of iterations typical of optimization over alignment thresholds. The GPU-based implementation replaces Python 2.7/pandas inner-loop operations from the original HapSolo and executes many operations in parallel on GPU hardware.
The authors report performance comparisons using an NVIDIA RTX A6000: on a specific avocado assembly example, 100,000 iterations of random walk and steepest descent executed substantially faster on the GPU compared with CPU parallel processes.
The team evaluated HapSolo2 across four diploid genome assemblies spanning a range of genome sizes (from 212 Mb to 3.2 Gb): Anopheles funestus, Persea americana (avocado), Vitis vinifera, and Amblyraja radiata. They ran 45 total optimization runs across three OrthoDB releases to compare optimizer behavior and reproducibility.
On the avocado assembly used as a performance benchmark, HapSolo2 processed 5,122 contigs scored against 1,440 orthologs and performed 100,000 iterations of both random walk and steepest descent during benchmarking.
Independent assessment with BUSCO v6.1 was used to quantify changes in duplicated orthologs and completeness after haplotig removal by HapSolo2. Reported reductions in duplicated orthologs included:
These decreases in duplication were accompanied by small decreases in completeness, with completeness falling by at most 1.3 percentage points in the reported datasets.
In the avocado assembly benchmark, HapSolo2 improved both cost and contiguity metrics relative to the original HapSolo. Specifically, HapSolo2 reduced the optimization cost achieved by the original HapSolo from 0.2200 to 0.1036. Contig N50 improved from 3,366 kb to 4,608 kb after applying HapSolo2, reflecting increased assembly contiguity following ortholog-guided haplotig removal.
Performance on the NVIDIA RTX A6000 GPU for this avocado case showed that 100,000 iterations of random walk and steepest descent ran 5.6- and 7.6-fold faster, respectively, than equivalent operations performed on 10 CPU processes.
HapSolo2 is distributed as an installable Python package and includes a unified command-line pipeline. The distribution bundles assembly statistics and plotting tools, an Apptainer container for portability, and archived copies of legacy ortholog datasets to support reproducible workflows. The combination of miniprot-based ortholog classification, multiple optimizers, and GPU-accelerated batched evaluation makes ortholog-guided haplotig removal practical on a single workstation in minutes and reproducible across OrthoDB releases.
Note: this work is reported as a preprint and has not been certified by peer review. The authors provide source code and supplementary materials via the project repository linked in the original preprint.