Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mappy check index flags before mapping #1008

Merged
merged 1 commit into from
Apr 20, 2023
Merged

Conversation

alexomics
Copy link
Contributor

mappy creates a CIGAR string by default (-c flag) and so is incompatible with indexes that are created using the --idx-no-seq flag.

The previous implementation of mappy did not check for the MM_I_NO_SEQ flag and would seg fault when attempting to map a read or retrieve a reference sequence from the index. This patch adds a check to both mappy.Aligner.seq and mappy.Aligner.map and returns None if there is no index sequences. I've chose None as this is inline with the behaviour of mappy for reads that do not align/retrieving sequences that aren't in the index, however it might be better to raise an exception so that this error is distinct and can be communicated to the caller.

closes #1007

mappy creates a CIGAR string by default (`-c` flag) and so is
incompatible with indexes that are created using the `--idx-no-seq`
flag.

The previous implementation of mappy did not check for the `MM_I_NO_SEQ`
flag and would seg fault when attempting to map a read or retrieve a
reference sequence from the index. This patch adds a check to both
`mappy.Aligner.seq` and `mappy.Aligner.map` and returns `None` if there
is no index sequences. I've chose `None` as this is inline with the
behaviour of mappy for reads that do not align/retreiving sequences that
aren't in the index, however it might be better to raise an exception so
that this error is distinct and can be communicated to the caller.
@lh3 lh3 merged commit c3d461e into lh3:master Apr 20, 2023
@alexomics alexomics deleted the mappy_seg_fault branch April 20, 2023 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mappy segmentation fault with --idx-no-seq index
2 participants