Repository navigation
Add initial CLI test and exports - #29
Open
ShinThomas wants to merge 2 commits into
Open
ShinThomas wants to merge 2 commits into
ShinThomas wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved issues can misreport reached stages, omit captured tool-error diagnostics, and cause quadratic export I/O and cubic selection work as runs grow.
4 open issues
What changed in this PR
Adds a command-line interface to the modular V2 pipeline, with evidence exports and per-gene failure handling while preserving longest-first, single-ORF selection.
Changes:
- Accepts per-gene FASTA inputs, local database settings, and an alignment-only stopping option.
- Exports results, unique candidate proteins, and run metadata while retaining partial evidence.
- Adds regression tests and documents the V2 CLI separately from the legacy workflow.
| File | Description |
|---|---|
tests/v2/test_pipeline.py |
Tests evidence retention, no-hit outcomes, and alignment-only runs. |
tests/v2/test_local_blast.py |
Tests incremental retrieval evidence and distinct failure statuses. |
tests/v2/test_cli.py |
Adds CLI export, validation, and failure-handling tests. |
src/lverage/pipeline.py |
Emits incremental evidence and supports stopping after alignment. |
src/lverage/ortholog_searcher.py |
Adds native hit identifiers to ortholog records. |
src/lverage/evidence.py |
Introduces the per-run evidence collector. |
src/lverage/cli.py |
Implements input validation, pipeline execution, and bundle exports. |
src/lverage/blast.py |
Reports retrieval progress, diagnostics, and native identifiers. |
README.md |
Introduces the V2 CLI and distinguishes legacy requirements. |
pyproject.toml |
Registers the installed lverage command. |
docs/user_guide.rst |
Documents CLI inputs, outputs, options, and statuses. |
docs/api/pipeline.rst |
Documents evidence collection and alignment-only execution. |
docs/api/index.rst |
Points to CLI documentation while retaining module-level imports. |
docs/api/blast.rst |
Documents incremental reporting and portable database setup. |
Review effort: Balanced
|
|
||
|
|
||
| def _redact_error(error): | ||
| text = re.sub(r"https?://[^\s]+", "<url-redacted>", str(error)) |
Comment on lines
+349
to
+351
| self._write_results() | ||
| self._write_orfs() | ||
| self.flush_metadata() |
Comment on lines
+360
to
+363
| selected_by_gene = { | ||
| gene: any(status == "selected" for (event_gene, _), status in selection.items() if event_gene == gene) | ||
| for gene, _ in self.events | ||
| } |
|
|
||
| def _stage_completion_events(final_status, last_stage): | ||
| stages = ("orf", "query_pfam", "blast", "ortholog_pfam", "alignment", "motif") | ||
| last_index = stages.index(last_stage) if last_stage in stages else -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Added a command-line interface for the pipeline.
Changes
results.tsv, unique candidate proteins inorfs.fasta, and run information inmetadata.json.--stop-after alignmentfor runs that intentionally exclude JASPAR.Limitations
unknownin metadata (will be changed)