Skip to content

Comments

Add sprinzl_coords parameter to plot_tRNA_structure()#21

Open
jayhesselberth wants to merge 2 commits intodevelfrom
sprinzl-coords-plot-structure
Open

Add sprinzl_coords parameter to plot_tRNA_structure()#21
jayhesselberth wants to merge 2 commits intodevelfrom
sprinzl-coords-plot-structure

Conversation

@jayhesselberth
Copy link
Member

Summary

  • plot_tRNA_structure() gains sprinzl_coords and trna_id parameters that automatically convert Sprinzl labels (e.g., anticodon positions 34-36) to 1-based sequence positions in modifications, outlines, text_colors, and linkages
  • Adds internal convert_sprinzl_positions() helper with warning on unmatched labels and row dropping
  • Handles both nuc--prefixed and bare tRNA IDs in Sprinzl coordinate tables

Closes #20

Test plan

  • convert_sprinzl_positions maps labels to positions correctly
  • Numeric input coerced to character works
  • Unmatched positions warn and are dropped (snapshot test)
  • Two-column conversion for linkages (pos1, pos2)
  • Error when tRNA not found in sprinzl_coords (snapshot test)
  • Integration test with real bundled E. coli sprinzl data
  • All existing tests still pass

🤖 Generated with Claude Code

When `sprinzl_coords` is provided, position columns in `modifications`,
`outlines`, `text_colors`, and `linkages` are interpreted as Sprinzl
labels and converted to 1-based sequence positions automatically. The
tRNA is resolved in the Sprinzl table via `trna_id` or auto-matched
from the `trna` argument.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Feb 23, 2026

Use plot_tRNA_structure() with linkage arcs to show significant rewiring
for tRNA-Glu-TTC, replacing the chord diagram visualization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

plot_tRNA_structure() should accept Sprinzl positions natively

1 participant