ptrus/suffix-trees

find_all problem

Closed this issue · 3 comments

Hello,
I was looking for a package able to use a suffix tree to search DNA sequences.
I downloaded the last version of suffix_trees and find_all function (seems to) doesn't work. I tried test3.py and got an error. find_all return no hit even if the substring is into the string. I also tried the code below. Is there something wrong with my code? :-|

By the way, thank you very much for your package ;-)
Loïc
PS: please, let me know if you need more information

Example code run with python3.5

from suffix_trees import STree

Suffix-Tree example.

st = STree.STree("abcdefghab")
print(st.find("abc")) # 0
print(st.find_all("ab")) # [0, 8] ---> [] :-(

ptrus commented

Hi!
Thanks for the bug report, I fixed the bug, which was caused by a typo in a previous fix :)

Please checkout the latest code from Github, or install the latest version via pip: pip install suffix_trees --upgrade

Hi !
Thanks a lot for your quick fix. It works fine.
I just have to finish my analysis now :-)
Loic

ptrus commented

Good luck :)