Strengthen supplement matched protein sequence ID test#280
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3aea28f719
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if hmm_name in hmm_name_to_package: | ||
| raise Exception("Duplicate HMM NAME {} found for {}".format(hmm_name, hmm_path)) |
There was a problem hiding this comment.
Allow metapackages with shared HMM NAMEs
The new duplicate check raises an exception whenever two packages share the same HMM NAME. Metapackages can legitimately include multiple SingleM packages that reuse the same GraftM alignment HMM (e.g., different window sizes or taxonomy variants backed by the same align_hmm), which means their NAME fields collide; in that case supplement will now abort before running hmmsearch even though it previously worked. If you need the package basename in matched protein IDs, consider disambiguating by rewriting HMM NAME entries to include the package basename (or falling back to the original HMM name when duplicates exist) instead of failing on duplicates.
Useful? React with 👍 / 👎.
Motivation
Description
NAMEentries tograftm_package_basenameand to use that package basename when constructing matched protein sequence IDs.NAMEentries and pass ahmm_name_to_packagemapping into the per-genome worker.test_output_matched_protein_sequencesintest/test_supplement.pyto acquire the metapackage, collect package basenames viagraftm_package_basename(), and assert the matched protein record IDs include one of those basenames.Testing
pixi run -e dev pytest test/test_supplement.py.7 passed, 2 skipped, 1 warningand the test run completed successfully.Codex Task