Skip to content

Fix alignment display coordinates across row wraps (#26)#37

Draft
nathanweeks wants to merge 2 commits into
masterfrom
issue-26
Draft

Fix alignment display coordinates across row wraps (#26)#37
nathanweeks wants to merge 2 commits into
masterfrom
issue-26

Conversation

@nathanweeks

@nathanweeks nathanweeks commented Jul 4, 2026

Copy link
Copy Markdown
Owner

The --showalignment row-boundary coordinates were wrong whenever a display unit straddled the wrap column:

  • a codon split across the wrap (dna2protein) mis-numbered the row, since the marker recorded the unit's start rather than the position of the last character actually shown; interpolate proportionally across the unit instead, and emit a marker per crossed boundary so a single over-wide unit (eg an intron label under a small --alignmentwidth) no longer desyncs later rows.

  • the non-advancing sequence (eg the cDNA across a target intron in est2genome) was reported one base too high, as a zero-advance unit used the next base position rather than the last one emitted.

Add dna2protein and est2genome alignment-display regression tests.

The --showalignment row-boundary coordinates were wrong whenever a
display unit straddled the wrap column:

  - a codon split across the wrap (dna2protein) mis-numbered the row,
    since the marker recorded the unit's start rather than the position
    of the last character actually shown; interpolate proportionally
    across the unit instead, and emit a marker per crossed boundary so a
    single over-wide unit (eg an intron label under a small
    --alignmentwidth) no longer desyncs later rows.

  - the non-advancing sequence (eg the cDNA across a target intron in
    est2genome) was reported one base too high, as a zero-advance unit
    used the next base position rather than the last one emitted.

Add dna2protein and est2genome alignment-display regression tests.

Assisted-by: Claude:claude-opus-4-8
Track row-start coordinates separately from row-end coordinates when a
display unit spans a row wrap. This keeps split 3-letter amino-acid
labels on the same residue and prevents compressed introns from making
contiguous genome coordinates jump. Extend dna2protein and est2genome
alignment tests for the target side.

assisted-by: Claude-Code:claude-opus-4-8
Assisted-by: Codex:gpt-5.5
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.

Alignment issues with proteins containing selenocysteine

1 participant