Skip to content

feat: annotate indel hits with edit type and query position (Indel Positions column)#27

Merged
dmx2 merged 1 commit into
IEDB:masterfrom
Roman-Young:feature/indel-positions
Jul 13, 2026
Merged

feat: annotate indel hits with edit type and query position (Indel Positions column)#27
dmx2 merged 1 commit into
IEDB:masterfrom
Roman-Young:feature/indel-positions

Conversation

@Roman-Young

Copy link
Copy Markdown
Contributor

Summary

Adds an Indel Positions output column for indel searches, annotating each hit with the edit type, residue, and 1-based query position as we discussed in our meeting.

Format

  • <d/i>: <residue>[<pos or range>] — e.g. d: A[6] (deletion of A at query position 6), i: X[6] (insertion of X before query position 6). Exact matches report [].
  • The deletion residue comes from the query; the insertion residue from the matched protein substring.
  • In a repeat the exact position is ambiguous (indistinguishable residues), so the inclusive range of all valid positions is reported — e.g. d: A[2,4]. (We chose a range over listing all possible starting positions).

Implementation

  • Computed purely in Python in _to_dataframe from (query, matched)
  • Follows the existing one-column-per-mode pattern: Indel Positions in indel mode, Mutated Positions otherwise, in the same schema slot. Mismatch/exact output is unchanged.

Scope

1-indel only (single-residue edits), matching the currently supported max_indels=1. Will be naturally extended to 2-indels soon.

Testing

  • Added hand-verified unit tests plus deletion/insertion end-to-end tests to ensure the output correctly matches the indel found.
  • Full suite green (44 tests).

@dmx2 dmx2 self-assigned this Jul 13, 2026
@dmx2
dmx2 self-requested a review July 13, 2026 21:43
@dmx2 dmx2 removed their assignment Jul 13, 2026

@dmx2 dmx2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Approved and merged.

@dmx2
dmx2 merged commit 804d8c4 into IEDB:master Jul 13, 2026
8 checks passed
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 this pull request may close these issues.

2 participants