mappy check index flags before mapping #1008
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 bothmappy.Aligner.seq
andmappy.Aligner.map
and returnsNone
if there is no index sequences. I've choseNone
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