HapSolo2: GPU-accelerated optimization for removing secondary haplotigs from diploid genome assemblies
- 1Halicioglu Data Science Institute, University of California San Diego; ESB AI Lab Corporation
Abstract
BackgroundSecondary haplotigs retained in a primary assembly inflate genome size and duplicate gene content, and their removal remains a necessary curation step for heterozygous diploid genomes. HapSolo (Solares et al. 2021) treats this step as an optimization problem: it searches 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. The original implementation depended on a separate BUSCO v3 run for every contig, on Python 2.7 and pandas in its inner loop, on a single randomized forward-walk optimizer, and on OrthoDB v9 lineage datasets that are no longer distributed.
ResultsHere we report HapSolo2, a reimplementation that replaces the per-contig BUSCO step with miniprot-based ortholog classification against OrthoDB v9, v10, or v12.2 lineage datasets, adds steepest descent and simulated annealing to the original random forward walk, and evaluates all walkers in batched CuPy array operations on a single GPU. On an avocado assembly of 5,122 contigs scored against 1,440 orthologs, 100,000 iterations of random walk and steepest descent ran 5.6- and 7.6-fold faster on one NVIDIA RTX A6000 than on 10 CPU processes. Across 45 runs on four diploid assemblies (Anopheles funestus, Persea americana, Vitis vinifera, and Amblyraja radi-ata; 212 Mb to 3.2 Gb) and three OrthoDB releases, the three optimizers reached best costs within 1.8% of one another. Independent assessment with BUSCO v6.1 showed that HapSolo2 reduced duplicated orthologs from 52.0% to 5.6% in P. americana, from 17.9% to 10.4% in V. vinifera, and from 7.8% to 2.8% in A. funestus, with completeness decreasing by at most 1.3 percentage points. On the avocado assembly, HapSolo2 reduced the cost reached by the original HapSolo from 0.2200 to 0.1036 and raised contig N50 from 3,366 kb to 4,608 kb.
ConclusionsHapSolo2 makes ortholog-guided haplotig removal practical in minutes on a single workstation, independent of a BUSCO installation, and reproducible across OrthoDB releases. It is distributed as an installable Python package with a unified command-line pipeline, an assembly statistics and plotting tool, an Apptainer container, and archived copies of the legacy ortholog datasets.
Related
- Terminal Modification Reprograms Supramolecular Organization of Integrin Ligand Assemblies to Shape Cell Migration
- Tracing the dynamic recruitment trajectory of Optineurin between the centrosome and other macromolecular assemblies, signifying its role in cell cycle progression
- Dissecting functional elements in giant genomes using the first generation of high quality salamander assemblies
- Gap‐Free Cannabis sativa Assemblies Reveal Post‐Polyploid Genome Remodelling and Refine the Evolution of Cannabinoid Synthase Genes
- Lens species genome assemblies reveal evolutionarily fragile chromosomes associated with pericentric inversions
BibTeX
@misc{yin2026hapsolo2,
title = {{HapSolo2: GPU-accelerated optimization for removing secondary haplotigs from diploid genome assemblies}},
author = {J. Yin and M. Agrawal and P. Goel and E. A. Solares},
howpublished = {bioRxiv},
year = {2026},
month = oct,
doi = {10.64898/2026.10.02.756147},
url = {https://www.biorxiv.org/content/10.64898/2026.10.02.756147v1},
note = {CC BY-ND},
}
RIS
TY - UNPB
TI - HapSolo2: GPU-accelerated optimization for removing secondary haplotigs from diploid genome assemblies
AU - J. Yin
AU - M. Agrawal
AU - P. Goel
AU - E. A. Solares
PY - 2026
DA - 2026/10/02
PB - bioRxiv
DO - 10.64898/2026.10.02.756147
UR - https://www.biorxiv.org/content/10.64898/2026.10.02.756147v1
AB - BackgroundSecondary haplotigs retained in a primary assembly inflate genome size and duplicate gene content, and their removal remains a necessary curation step for heterozygous diploid genomes. HapSolo (Solares et al. 2021) treats this step as an optimization problem: it searches 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. The original implementation depended on a separate BUSCO v3 run for every contig, on Python 2.7 and pandas in its inner loop, on a single randomized forward-walk optimizer, and on OrthoDB v9 lineage datasets that are no longer distributed. ResultsHere we report HapSolo2, a reimplementation that replaces the per-contig BUSCO step with miniprot-based ortholog classification against OrthoDB v9, v10, or v12.2 lineage datasets, adds steepest descent and simulated annealing to the original random forward walk, and evaluates all walkers in batched CuPy array operations on a single GPU. On an avocado assembly of 5,122 contigs scored against 1,440 orthologs, 100,000 iterations of random walk and steepest descent ran 5.6- and 7.6-fold faster on one NVIDIA RTX A6000 than on 10 CPU processes. Across 45 runs on four diploid assemblies (Anopheles funestus, Persea americana, Vitis vinifera, and Amblyraja radi-ata; 212 Mb to 3.2 Gb) and three OrthoDB releases, the three optimizers reached best costs within 1.8% of one another. Independent assessment with BUSCO v6.1 showed that HapSolo2 reduced duplicated orthologs from 52.0% to 5.6% in P. americana, from 17.9% to 10.4% in V. vinifera, and from 7.8% to 2.8% in A. funestus, with completeness decreasing by at most 1.3 percentage points. On the avocado assembly, HapSolo2 reduced the cost reached by the original HapSolo from 0.2200 to 0.1036 and raised contig N50 from 3,366 kb to 4,608 kb. ConclusionsHapSolo2 makes ortholog-guided haplotig removal practical in minutes on a single workstation, independent of a BUSCO installation, and reproducible across OrthoDB releases. It is distributed as an installable Python package with a unified command-line pipeline, an assembly statistics and plotting tool, an Apptainer container, and archived copies of the legacy ortholog datasets.
ER -