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

picklists cause bug in LCA databases when relevant signatures are excluded #1638

Closed
ctb opened this issue Jun 25, 2021 · 0 comments · Fixed by #1639
Closed

picklists cause bug in LCA databases when relevant signatures are excluded #1638

ctb opened this issue Jun 25, 2021 · 0 comments · Fixed by #1639

Comments

@ctb
Copy link
Contributor

ctb commented Jun 25, 2021

as of 9dbd8b5, there's a bug (almost certainly caused by #1588) where if a relevant signature in an LCA database is excluded by a picklist (so it doesn't show up in self._signatures) then LCA_Database.find(...) fails on this line:

subj = self._signatures[idx]

because the idx is not present.

For example,

sourmash gather tests/test-data/47.fa.sig tests/test-data/lca/47+63.lca.json --picklist ident.csv:ident:ident

where ident.csv is

ident
NC_011663.1

yields


Starting prefetch sweep across databases.
Traceback (most recent call last):
  File "/Users/t/miniconda3/envs/py37/bin/sourmash", line 33, in <module>
    sys.exit(load_entry_point('sourmash', 'console_scripts', 'sourmash')())
  File "/Users/t/dev/sourmash/src/sourmash/__main__.py", line 13, in main
    return mainmethod(args)
  File "/Users/t/dev/sourmash/src/sourmash/cli/gather.py", line 89, in main
    return sourmash.commands.gather(args)
  File "/Users/t/dev/sourmash/src/sourmash/commands.py", line 687, in gather
    counter = db.counter_gather(prefetch_query, args.threshold_bp)
  File "/Users/t/dev/sourmash/src/sourmash/index.py", line 278, in counter_gather
    for result in self.prefetch(prefetch_query, threshold_bp, **kwargs):
  File "/Users/t/dev/sourmash/src/sourmash/index.py", line 217, in prefetch
    for sr in self.find(search_fn, query, **kwargs):
  File "/Users/t/dev/sourmash/src/sourmash/lca/lca_db.py", line 473, in find
    subj = self._signatures[idx]
KeyError: 32
ctb added a commit that referenced this issue Jun 25, 2021
@ctb ctb closed this as completed in #1639 Jun 25, 2021
ctb added a commit that referenced this issue Jun 25, 2021
* add test for bug #1638

* fix bug

* force generator to work
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

Successfully merging a pull request may close this issue.

1 participant