ptrus / suffix-trees

Python implementation of Suffix Trees and Generalized Suffix Trees.
MIT License
122 stars 28 forks source link

find_all problem #7

Closed lamenace91 closed 6 years ago

lamenace91 commented 6 years ago

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 6 years ago

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

lamenace91 commented 6 years ago

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

ptrus commented 6 years ago

Good luck :)