Skip to content

Remove remote BLAST support and improved local BLAST - #8

Merged
AnthonyGarza124 merged 2 commits into
refactor-v2from
blastpdev
Sep 21, 2026
Merged

AnthonyGarza124 merged 2 commits into
refactor-v2from
blastpdev

Conversation

@ShinThomas

@ShinThomas ShinThomas commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Removed remote/online BLAST implementation from the refactor-v2 codebase while preserving the local BLAST workflow. Updated BLAST support in the refactor-v2 codebase by removing remote BLAST functionality and improving the local BLAST workflow.

Changes

  • Removed RemoteBlastSearcher from src/lverage/blast.py

  • Removed remote-only BLAST dependencies and constants:

    • requests
    • NCBI_EFETCH_URL
    • unused SeqIO
  • Deleted tests/v2/test_remote_blast.py

  • Preserved LocalBlastSearcher

  • Preserved shared BLAST parsing and ortholog-record logic

  • Confirmed no changes were required in:

    • src/lverage/pipeline.py
    • src/lverage/ortholog_searcher.py

Documentation

docs/api/blast.rst still contains references to remote BLAST and RemoteBlastSearcher.

Remote BLAST changes

  • Removed RemoteBlastSearcher
  • Removed remote-only BLAST dependencies and constants
  • Deleted tests/v2/test_remote_blast.py
  • Preserved the local BLAST implementation

Local BLAST changes

  • Updated blastp invocation to explicitly read the protein query from stdin using -query -
  • Updated query coverage calculation to use BLAST query coordinates
  • Added fallback sequence retrieval using the accession when retrieval by BLAST hit ID fails
  • Skips hits when the full protein sequence cannot be retrieved by either identifier

Testing

Focused local BLAST tests:

12 passed

The local BLAST tests cover:

  • local blastp command construction
  • FASTA query input through stdin
  • coordinate-based query coverage
  • complete sequence retrieval with blastdbcmd
  • fallback from hit ID to accession
  • failure handling when sequence retrieval fails

@ShinThomas

Copy link
Copy Markdown
Collaborator Author

Documentation build currently fails because docs/api/blast.rst still references the removed RemoteBlastSearcher. The docs directory was inspected but intentionally not modified.

@ShinThomas ShinThomas changed the title Remove remote BLAST support Remove remote BLAST support and improved local BLAST Sep 20, 2026
Comment thread src/lverage/blast.py
"evalue": best_hsp.expect,
"identity": best_hsp.identities / best_hsp.align_length,
"query_coverage": best_hsp.align_length / query_length,
"query_coverage": (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This changes “query coverage” from alignment-column length to the query-coordinate span of the best HSP. That seems reasonable and avoids gap-driven values above 100%, but it is slightly different from counting the exact query residues aligned.

I’m happy to accept this behavior for now. Could we add or track a follow-up test with gapped HSPs (and possibly multiple HSPs) to document the intended semantics?

@AnthonyGarza124
AnthonyGarza124 merged commit 8ef6c78 into refactor-v2 Sep 21, 2026
1 check failed
@AnthonyGarza124
AnthonyGarza124 deleted the blastpdev branch September 21, 2026 21: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.

2 participants