This was an oversight affecting v2.22+. The latest minimap2 ranks hits and
estimates mapping quality with an adjusted alignment score (see the minimap2
update paper). This score however is not calculated when there is only one hit.
As a result, the ms:i tag varies depends on other sequences in the reference
genome, which is confusing. This change lets minimap2 to output the unadjusted
score at ms:i. At present, the adjusted score is not outputted.
Resolves#1146
* Added the lr:hq preset suggested by Nanopore developers (#1127)
* Fixed transition scoring. It did not work with presets.
* Cleaned up preset documentation
* Implements a transition-aware alignment scoring scheme and configuration presets for ICLR
* Fix to enable use of general scoring matrix in ksw as suggested by lh3
---------
Co-authored-by: koadman <>
* a new option --secondary-seq to output SEQ field for secondary alignments
* comments removed
* Fixed a conflict in #687
---------
Co-authored-by: Heng Li <lh3@me.com>
On the mm2-update dataset, -j8 leads to sparser k-mer selection at higher
accuracy. The speed becomes a little slower. There seems a benefit but not a
big one.
Give the CIGAR constants names to clarify the code. So that ksw2.h
remains self-contained, define KSW_* versions of the CIGAR operators
it needs for use within ksw2.h. Other code should in general use the
full set of MM_CIGAR_* constants in minimap.h.
Define MM_CIGAR_STR to the full string of CIGAR operators (including
the 'B' operator as well) and use it throughout the C code.
It would be possible to use it from the Cython code too, but it's easier
to keep that as a Cython string literal to avoid adding extra runtime
code to handle locale conversion.