Skip to content

Cache complement translation table in get_forward_sequence#1386

Draft
nh13 wants to merge 1 commit intopysam-developers:masterfrom
nh13:nh13/cache-complement-table
Draft

Cache complement translation table in get_forward_sequence#1386
nh13 wants to merge 1 commit intopysam-developers:masterfrom
nh13:nh13/cache-complement-table

Conversation

@nh13
Copy link
Copy Markdown
Contributor

@nh13 nh13 commented Mar 2, 2026

Summary

  • Move the str.maketrans("ACGTacgtNnXx", "TGCAtgcaNnXx") call from inside get_forward_sequence() to a module-level COMPLEMENT_TABLE constant
  • Previously the translation table was rebuilt on every invocation

Test plan

  • Run REF_PATH=: pytest tests/AlignedSegment_test.py -v -k forward

AI disclosure: This PR was AI-assisted using Claude Code. The issue was identified via AI-guided code review, and the implementation was drafted by AI with human review and approval.

@nh13 nh13 marked this pull request as draft March 3, 2026 06:21
@nh13 nh13 changed the title perf: cache complement translation table in get_forward_sequence Cache complement translation table in get_forward_sequence Mar 3, 2026
@nh13 nh13 force-pushed the nh13/cache-complement-table branch from 4f859b0 to 015246a Compare March 3, 2026 06:24
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.

1 participant