minimap2
minimap2 copied to clipboard
Non-existent reference file in mappy causes segfault
I have just come across this behavior testing out mappy on a genome file that I had accidentally moved. mappy.Aligner
is able to initialize with a non-existent file, but any operation (aside from the map
function) on that alignment object causes a segmentation fault (seq
or seq_names
).
It would be nice if the Aligner
object raised a python error on a non-existent file, but raising a catchable error for the seq
and seq_names
functions would be useful as well.
The following code reproduces this error (assuming foo.fasta
does not exist):
>> import mappy
>> aligner = mappy.aligner('foo.fasta')
>> aligner.seq_names
Segmentation fault: 11
Could you check if 03dc8d5 fixes the issue? Also note that you can
a = mp.Aligner(fn)
if not a: raise Exception("bla")
to test if an index is present.