MMseqs short-sequence matching drops duplicate database hits
- Dominant language
- Python
- Stars
- 100
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
## Description
`calc_mmseqs_seq_identity()` records only the first database entity when a short query sequence has multiple exact matches. The Smith-Waterman implementation in the same module correctly emits every matching database ID.
## Reproduction
Use a short query sequence `AAA` and two database rows with the same sequence but different IDs (`A_1` and `B_2`). Call `calc_mmseqs_seq_identity()` with `min_seq_length=25`. Because all sequences take the short-sequence path, MMseqs2 does not need to produce any alignments.
Expected rows:
```text
query_id db_id similarity
Q_1 A_1 1.0
Q_1 B_2 1.0
```
Actual result contains only `Q_1 -> A_1`.
## Root cause
The short-sequence branch appends `id_in_db[0]` instead of extending the result with all IDs stored in `db_short_seq_to_id[seq]`.
## Impact
Downstream low-homology classification can miss a training PDB that shares the exact short sequence. If another entity provides the common PDB link, an entry can be incorrectly retained as low-homology, causing benchmark leakage.
## Environment
- PXMeter commit: `72117242154d0c9f52ce727dc352210aab76d495`
- Python 3.11 and 3.13 on Windows
A focused regression test can cover the short-sequence branch without invoking MMseqs2.
Contributor guide
Research direction
Start at calc_mmseqs_seq_identity() and inspect its short-sequence branch, especially how db_short_seq_to_id[seq] is used. Add a focused regression test using query AAA and database IDs A_1 and B_2; done means both exact-match rows are returned without invoking MMseqs2.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- bioinformatics
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100