Skip to content

Add local and online PfamScan support - #12

Merged
AnthonyGarza124 merged 2 commits into
refactor-v2from
pfamscan
Oct 13, 2026
Merged

AnthonyGarza124 merged 2 commits into
refactor-v2from
pfamscan

Conversation

@ShinThomas

Copy link
Copy Markdown
Collaborator

Summary

Adds local and online PfamScan support to the refactor-v2 domain scanning workflow.

Changes

Local PfamScan

  • Added LocalPfamScanner
  • Runs local pfam_scan.pl
  • Writes the protein query to a temporary FASTA file
  • Uses the configured Pfam database directory
  • Parses local PfamScan output into DomainRecord
  • Converts Pfam coordinates to zero-based, half-open indexing

Online PfamScan

  • Added OnlinePfamScanner
  • Submits jobs to the EMBL-EBI PfamScan service
  • Explicitly requests JSON output
  • Polls job status with bounded retries
  • Discovers the JSON result type
  • Fetches and parses the result into DomainRecord
  • Handles terminal failure and timeout states

Tests

Added focused test modules:

  • tests/v2/test_local_pfam.py
  • tests/v2/test_online_pfam.py

Focused local and online Pfam tests pass, and the full v2 test suite passes.

Remaining work

  • PfamScan validation on SCC would be good

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.

Copilot review overview

🔵 Needs a closer look

Fix Windows temporary-file handling in the local scanner; add the missing Pfam API documentation.

Review effort: Lite
Findings: None

What changed in this PR

Adds local and online PfamScan adapters for the v2 domain-scanning workflow.

Changes:

  • Added local PfamScan execution and parsing.
  • Added online submission, polling, and JSON result handling.
  • Added focused local and online scanner tests.
File Summary
tests/​v2/​test_online_pfam.py Tests online scanning behavior.
tests/​v2/​test_local_pfam.py Tests local scanning behavior.
src/​lverage/​pfam.py Implements both scanners. Needs Windows-safe temporary-file handling and API documentation updates.

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

@AnthonyGarza124

Copy link
Copy Markdown
Collaborator

Awesome. So I looked at the copilot review and agreed with what it said after I reviewed. So the problem was that Windows is a pain with temporary files and can fail to run a process on a file that is currently open/being written to. So I applied a patch that makes sure the file is closed and applied a try and catch statement around just in case.

@AnthonyGarza124

Copy link
Copy Markdown
Collaborator

@ShinThomas If possible re-run the code and its tests to make sure they work fine with my adjustment. Then comment on the PR again and I'll look at it.

@ShinThomas

Copy link
Copy Markdown
Collaborator Author

Retested after the temporary-file handling patch.

  • Local PfamScan unit tests: 5 passed.
  • Online PfamScan unit tests: 6 passed.

@AnthonyGarza124
AnthonyGarza124 merged commit 41df0c7 into refactor-v2 Oct 13, 2026
1 check passed
@AnthonyGarza124
AnthonyGarza124 deleted the pfamscan branch October 13, 2026 17:23
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