waveygang / wfmash

base-accurate DNA sequence alignments using WFA and mashmap3
MIT License
174 stars 18 forks source link

Avoid division by 0 to determine `minhash_kmer_size` #252

Closed AndreaGuarracino closed 3 months ago

AndreaGuarracino commented 3 months ago

When the estimated identity is 1, we were getting a division by 0, resulting in a minhash_kmer_size equal to 8. While this isn't typically problematic for very highly similar regions, it causes issues inside the human centromeres when aligning their HORs. This leads to increased runtime, high memory usage, and inaccurate alignments.

Here is an example of a chr10 alignment with an HG002 assembly vs HG002v1.0.1:

Whole wrong region image

Zoom ins image image