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

Index.select(...) currently allows incorrect moltypes #1547

Open
ctb opened this issue May 23, 2021 · 1 comment
Open

Index.select(...) currently allows incorrect moltypes #1547

ctb opened this issue May 23, 2021 · 1 comment
Labels
good next issue An issue that should be ready to resolve.

Comments

@ctb
Copy link
Contributor

ctb commented May 23, 2021

This should raise an error, but does not:

db = sourmash.load_file_as_index('tests/test-data/63.fa.sig')
db = db.select(moltype='FOO')

Currently, the only valid moltypes are 'DNA', 'protein', 'dayhoff', and 'hp'.

Your mission, should you choose to accept it, is to make sure that this is generally true.

I think the function to modify is src/sourmash/index.py:select_signature(...), and it should raise a ValueError for invalid moltypes. This function is used by all of the Index subclasses in index.py and so fixing it should be enough.

Please also add a test or three in tests/test_index.py.

The other major Index subclasses, SBT and LCA databases, should be fine, but maybe worth a quick check.

see also #1427 -> more tests needed for Index.select

@ctb ctb added the good next issue An issue that should be ready to resolve. label May 23, 2021
@bryshalm

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good next issue An issue that should be ready to resolve.
Projects
None yet
Development

No branches or pull requests

2 participants