Allow passing read name to mappy (#1260)

* 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 commit is contained in:
Rob Patro
2024-11-15 08:51:10 -05:00
committed by GitHub
parent fcb5d5e6eb
commit 358a39850f
3 changed files with 16 additions and 7 deletions

View File

@@ -129,7 +129,7 @@ cdef extern from "cmappy.h":
void mm_reg2hitpy(const mm_idx_t *mi, mm_reg1_t *r, mm_hitpy_t *h)
void mm_free_reg1(mm_reg1_t *r)
mm_reg1_t *mm_map_aux(const mm_idx_t *mi, const char *seq1, const char *seq2, int *n_regs, mm_tbuf_t *b, const mm_mapopt_t *opt)
mm_reg1_t *mm_map_aux(const mm_idx_t *mi, const char* seqname, const char *seq1, const char *seq2, int *n_regs, mm_tbuf_t *b, const mm_mapopt_t *opt)
char *mappy_fetch_seq(const mm_idx_t *mi, const char *name, int st, int en, int *l)
mm_idx_t *mappy_idx_seq(int w, int k, int is_hpc, int bucket_bits, const char *seq, int l)