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

Non-existent reference file in mappy causes segfault #413

Open
marcus1487 opened this issue May 29, 2019 · 1 comment
Open

Non-existent reference file in mappy causes segfault #413

marcus1487 opened this issue May 29, 2019 · 1 comment

Comments

@marcus1487
Copy link
Contributor

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
lh3 added a commit that referenced this issue Jun 7, 2019
@lh3
Copy link
Owner

lh3 commented Jun 7, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants