* Allow passing read name to mappy
This adds the (optional) ability to pass the read
name to the mappy `map` method. Without the
read name, the call to `map` can sometimes give
different output than the command line version
of `minimap2` because of the way minimap uses
the hash of the read name to break ties in ordering
hits. This can affect which / if certain
supplementary alignments are generated, and even
which / if non-primary alignments are generated.
* Pass name directly to mm_map_aux
Get rid of additional function, and always
accept the name parameter in the mm_map_aux
function (can be nullptr if not available).
---------
Co-authored-by: Rob Patro <rob@newton>
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
The Minimap2 behavior was found to handle sequences with large
deletions differently when upgraded from v2.17 to v2.26, causing
potential issues in projects mapping extensive deletions of ~1200 base
pairs. The originally suggested solution of setting `-r 500,500` was
observed to be partially non-applicable since the Python Wrapper,
`mappy`, only allowed manipulation of parameter `bw`.
In response to issue #1111, where this was originally reported,
this commit introduces a modification in the Python wrapper,
`mappy`. Until now, `mappy` only allowed manipulation of the `bw`
parameter, preventing the suggested fix of setting `-r 500,500`.
This commit introduces a modification in the Python wrapper to include
the `bw_long` option in the `Aligner` class. Consequently, both
parameters `bw` and `bw_long` can be manipulated, thereby allowing the
desired Minimap2 behavior encountered in version 2.17. As a result,
this patch ensures consistent handling of sequences containing large
deletions irrespective of the version upgrade."
Closes#1111
* 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 <>