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

ValueError: end_index must be non-negative #13

Closed
theo-allnutt-bioinformatics opened this issue Jan 29, 2019 · 6 comments
Closed

ValueError: end_index must be non-negative #13

theo-allnutt-bioinformatics opened this issue Jan 29, 2019 · 6 comments

Comments

@theo-allnutt-bioinformatics

Any idea what might be causing this error? Thanks.

T.

Traceback (most recent call last):
File "/home/allnutt.t/scripts/primer_clip_fastq.py", line 111, in
m=find_near_matches(primer,seq1,max_l_dist=mm)
File "/home/allnutt.t/.conda/envs/py2/lib/python2.7/site-packages/fuzzysearch/init.py", line 51, in find_near_matches
return search_func(subsequence, sequence, search_params)
File "/home/allnutt.t/.conda/envs/py2/lib/python2.7/site-packages/fuzzysearch/init.py", line 87, in
find_near_matches_levenshtein(subsequence, sequence, search_params.max_l_dist)
File "/home/allnutt.t/.conda/envs/py2/lib/python2.7/site-packages/fuzzysearch/levenshtein.py", line 33, in find_near_matches_levenshtein
max_l_dist)
File "/home/allnutt.t/.conda/envs/py2/lib/python2.7/site-packages/fuzzysearch/levenshtein_ngram.py", line 176, in find_near_matches_levenshtein_ngrams
for index in search_exact(subsequence[ngram_start:ngram_end], sequence, start_index, end_index):
File "/home/allnutt.t/.conda/envs/py2/lib/python2.7/site-packages/fuzzysearch/common.py", line 159, in search_exact
start_index, end_index if end_index is not None else -1)
ValueError: end_index must be non-negative

@theo-allnutt-bioinformatics
Copy link
Author

No problem.. I think its when the search string is longer than the subject sequence.

@taleinat
Copy link
Owner

taleinat commented Feb 1, 2019

Hi @theo-allnutt-bioinformatics,

This was indeed caused by an internal bug. It has now been fixed in commit 05f33c4 and will be included in the next release. Thanks for reporting this!

Regardless, I'm happy that you could quickly find a workaround :)

@jtlz2
Copy link

jtlz2 commented Jun 25, 2020

@taleinat Amazing module - thanks - unfortunately I still get the problem above in 0.7.2. Should it have been fixed therein? Thanks again

@taleinat
Copy link
Owner

Hi @jtlz2,

The fix mentioned above is indeed included since version 0.6.2. You may be encountering a similar bug.

It would be great if you could open a new issue with example code that reproduces the error you're seeing!

@taleinat
Copy link
Owner

Also, could you please mention what platform you're running on and what version of Python you're using, including whether it is a 64-bit build?

Similar errors are occurring on the conda-forge Windows builds, but I haven't been able to reproduce these on my own machines.

@jtlz2
Copy link

jtlz2 commented Jun 26, 2020

@taleinat Thanks - done - see #32

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

No branches or pull requests

3 participants