Closed robegan21 closed 7 years ago
Hi Rob,
Thank you for creating this pull request! I really appreciate all your input, it helped a lot!!
I merged your pull request, though not directly into master because I wanted to perform some tests. It got merged into the bugfix branch, which after testing was merged to master. I managed to find the cause of faulty coordinates, but these tests definitely don't hurt.
I referenced you in the README.md btw. :-)
Ivan
For some of my datasets with many smaller scaffolds, I found that the latest version of graphmap was segfaulting again on certain reads. When I dove deep into the debugger, I found that the start alignment positions were negative so there was a buffer underrun on the reference sequence.
Additionally even when an alignment is classified as insane and is_aligned is false, the MD and metrics were still being called. I fixed that so that there would not be a buffer under run there too.
This patch adds assertions in cigargen.cc: CountAlignmentOperations() and AlignmentToMD() And performs additional checks for insane alignments and avoids alignment calculations when is_aligned is false
I did not investigate why certain alignments were being calculated outside the bounds of the reference sequence, which would be a better fix, but at least this stops the segfaults on my datasets.
I have also not verified, but this could also fix issue #60 and #43