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

IndexDefect when using searchIndex.search #3

Open
Benjamin-Lee opened this issue Nov 18, 2021 · 2 comments
Open

IndexDefect when using searchIndex.search #3

Benjamin-Lee opened this issue Nov 18, 2021 · 2 comments

Comments

@Benjamin-Lee
Copy link

Hi @andreaferretti! I'm trying to use this awesome library for some bioinformatics but am running into a strange error:

import cello

let x = "CGGGACTTACTTGTGGTTCCTGTGGTGCACTCCTGACCCTGCCGCTTTGAAAGAAAAAGAAATGAGGCGAAGAAGTCCTTCAGGGATCCCCGGGGAAACCTGGAGGAAGTCCGACGAGATCGCGGCTGGGGCTTAGGACCCCACTCCTGCGAGACAGGAGTAATCCTAAACAGGGTTTTCACCCTTCCTTTAGTTTCCTTCCTCTCCTGGAGAGGTCTTCTGCCCTAGCCCGGTCTTCGAAGCTTCCTTTGGCTACTACCCGGTGGAAACAACTGAAGCTTCAACGCCTTTTTTTCCAATCTTCTTTAGCACCGGGCTAGGGAGTAAGCCCGTGGAACCTTAGTTTTGTTCCCT"

# works
let index2 = searchIndex(x[0..x.high-1])
echo index2.search(x[0..1])


# breaks
let index1 = searchIndex(x)
echo index1.search(x[0..1])

This specific sequence is unable to be searched, although removing the last character does allow it to be search. Do you have any idea why that could be?

@Benjamin-Lee
Copy link
Author

Ps here's the traceback:

BenjaminLee@mbp ~/r/playground [1]> nim r monomerize.nim                        (viroid-search) 
Hint: used config file '/usr/local/Cellar/nim/1.6.0/nim/config/nim.cfg' [Conf]
Hint: used config file '/usr/local/Cellar/nim/1.6.0/nim/config/config.nims' [Conf]
....................................................................................................
CC: monomerize.nim
Hint:  [Link]
Hint: gc: refc; opt: none (DEBUG BUILD, `-d:release` generates faster code)
58492 lines; 1.388s; 93.918MiB peakmem; proj: /Users/BenjaminLee/research/playground/monomerize.nim; out: /Users/BenjaminLee/.cache/nim/monomerize_d/monomerize_4651918B165140654B6F77303C1F7E8C0EB6DBDA [SuccessX]
Hint: /Users/BenjaminLee/.cache/nim/monomerize_d/monomerize_4651918B165140654B6F77303C1F7E8C0EB6DBDA  [Exec]
@[67, 237, 111, 149, 114, 284, 120, 42, 122, 0, 312, 90, 230, 260, 330]
/Users/BenjaminLee/research/playground/monomerize.nim(12) monomerize
/Users/BenjaminLee/.nimble/pkgs/cello-0.3.0/cello.nim(802) search
/Users/BenjaminLee/.nimble/pkgs/cello-0.3.0/cello.nim(795) search
/Users/BenjaminLee/.nimble/pkgs/cello-0.3.0/cello.nim(435) rank
/Users/BenjaminLee/.nimble/pkgs/cello-0.3.0/cello.nim(434) rank
/Users/BenjaminLee/.nimble/pkgs/cello-0.3.0/cello.nim(320) rank
/usr/local/Cellar/nim/1.6.0/nim/lib/system/fatal.nim(53) sysFatal
Error: unhandled exception: index 4 not in 0 .. 3 [IndexDefect]
Error: execution of an external program failed: '/Users/BenjaminLee/.cache/nim/monomerize_d/monomerize_4651918B165140654B6F77303C1F7E8C0EB6DBDA '

@andreaferretti
Copy link
Owner

Hi @Benjamin-Lee sorry it took a while to ackowledge your issue, I recently had a newborn :-)

I am going to see what's going on here, it's definitely strange!

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

2 participants