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

error message: "not implemented: only one Signature currently allowed when using 'load_sig'" #501

Open
ctb opened this issue Nov 6, 2024 · 1 comment

Comments

@ctb
Copy link
Collaborator

ctb commented Nov 6, 2024

As of sourmash_branchwater_plugin v0.9.9, this error message will be returned in certain circumstances - the easiest way to trigger it is to use a pathlist that points at a .sig/.sig.gz file that contains more than one Signature.

This was never supported, but previous plugin releases did the wrong thing silently and simply loaded the first compatible sketch encountered. The new error message in v0.9.9 results from a change in sourmash (sourmash-bio/sourmash#3333) that flags the situation and displays an error.

The solution, for now, is to convert any and all .sig/.sig.gz files into .sig.zip files (by using, for example, sourmash sig cat sig_file -o file.sig.zip).

Here is a more detailed description of the problem from sourmash-bio/sourmash#3333:

The problem at hand: when loading a SigStore/Signature from a Storage, sourmash only loads the first one and ignores any others.

https://github.com/sourmash-bio/sourmash/blob/26b50f3e3566006fd6356a4f8b4d47c5e381aeec/src/core/src/storage/mod.rs#L34-L38

This results from the concept of a Signature as containing one or more sketches; the history of this is described here, and it leads to some interesting silliness in the Python layer.

The contrapositive is that, in Rust, a single Signature can include multiple sketches, e.g. with different ksizes. So this works fine for the wort case where we have a single .sig file with k=21, k=31, k51.

Note that the Python layer (and hence the entire sourmash CLI) fully supports multiple Signatures in JSON: this is well tested and well covered behavior. The branchwater plugin runs into it because it is using the Rust layer and the API is not fully fleshed out there.

@ctb
Copy link
Collaborator Author

ctb commented Nov 6, 2024

#445 explores it in more technical detail, along with potential fixes, but does not (yet) fix it.

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

1 participant