Skip to content

Implement ORF searcher with corrected terminal translation - #24

Merged
AnthonyGarza124 merged 1 commit into
refactor-v2from
orf-searcher
Oct 8, 2026
Merged

AnthonyGarza124 merged 1 commit into
refactor-v2from
orf-searcher

Conversation

@ShinThomas

Copy link
Copy Markdown
Collaborator

Summary

Implements the V2 ORF searcher for issue #17. The component accepts DNA and returns candidate protein sequences for downstream domain scanning.

Corrects a truncation bug in orffinder==1.8 that can drop the last complete codon from incomplete terminal ORFs.

Changes

  • Added OrffinderOrfSearcher, preserving OrfSearcherTemplate.
  • Uses orffinder.getORFs() to locate candidates, then extracts and translates complete codons on the appropriate strand without padding.
  • Checks minimum length against the actual nucleotide span and excludes terminal stop codons from complete ORFs.
  • Validates DNA inputs and configuration; supports ATG starts and the standard genetic code.
  • Leaves candidate sorting and deduplication to the pipeline.
  • Pins the tested dependency to orffinder==1.8.

Regression examples now produce:

  • ATGAAAGGG → MKG
  • ATGAAAGGGAAA → MKGK
  • Reverse-strand input CCCTTTCAT → MKG

Documentation explains nucleotide-length thresholds, accepted DNA symbols, nested and trailing candidate settings, and the dependency-specific workaround.

Testing

Local checks completed in lverage-v2:

  • V2 unittest discovery: 92 passed.
  • Retained legacy JASPAR-window tests: 11 passed.
  • Strict nitpicky Sphinx build: passed.

Tests cover both strands, incomplete suffixes with 0/1/2 leftover bases, length boundaries, ambiguity, invalid inputs, nested filtering, and protein handoff to the pipeline’s domain scanner.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation matches the dependency’s coordinate behavior and is comprehensively tested and documented.

0 open findings

What changed in this PR

Implements the V2 ORF-search adapter with corrected terminal translation.

Changes:

  • Adds validated six-frame ORF discovery and translation.
  • Adds regression, configuration, and pipeline integration tests.
  • Pins and documents orffinder 1.8 behavior.
File Description
src/​lverage/​orf_searcher.py Implements the ORF-search adapter.
tests/​v2/​test_orf_searcher.py Adds comprehensive tests.
pyproject.toml Adds the pinned dependency.
docs/​api/​orf_searcher.rst Documents behavior and limitations.
docs/​singularity_setup.md Records the runtime dependency.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@AnthonyGarza124
AnthonyGarza124 merged commit 75aeb04 into refactor-v2 Oct 8, 2026
2 checks passed
@AnthonyGarza124
AnthonyGarza124 deleted the orf-searcher branch October 8, 2026 20:10
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.

3 participants