Repository navigation
Implement local JASPAR 2026 profile inference - #33
Open
ShinThomas wants to merge 2 commits into
Open
ShinThomas wants to merge 2 commits into
ShinThomas wants to merge 2 commits into
Conversation
Collaborator
Author
|
updated with documentation |
Collaborator
Author
|
@AnthonyGarza124 test ping |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved defects can misattribute alignment failures, conflate protein hit groups, erase validation status, and cause near-cubic export overhead.
4 open issues
What changed in this PR
Building on #29’s CLI, this PR replaces online JASPAR lookup with local JASPAR 2026 profile inference and expands exports to preserve supporting evidence.
Changes:
- Adds local inference, similarity scoring, exact-version matrix lookup, and data validation.
- Replaces event-row TSV output with grouped CSV, including inference metrics and partial-failure diagnostics.
- Retains isoform-labelled BLAST hits and updates tests, dependencies, and documentation.
| File | Description |
|---|---|
tests/v2/test_local_blast.py |
Tests retrieval diagnostics and isoform retention. |
tests/v2/test_jaspar.py |
Tests local matrix lookup, filtering, and inference integration. |
tests/v2/test_jaspar_window.py |
Uses the JASPAR 2026 adapter in window tests. |
tests/v2/test_jaspar_record.py |
Tests inference metric serialization. |
tests/v2/test_jaspar_models.py |
Adds similarity-scoring regression tests. |
tests/v2/test_jaspar_inference.py |
Tests inference rules and external-tool arguments. |
tests/v2/test_cli.py |
Tests grouped CSV, evidence associations, and failure preservation. |
src/lverage/pipeline.py |
Emits stage attempts and results for evidence tracking. |
src/lverage/jaspar.py |
Implements the local JASPAR 2026 adapter. |
src/lverage/jaspar_models.py |
Loads and scores Cis-BP similarity models. |
src/lverage/jaspar_inference.py |
Implements local HMMER/BLAST profile inference. |
src/lverage/jaspar_inference_license.txt |
Preserves the upstream MIT license. |
src/lverage/cli.py |
Adds local-inference options, grouped CSV, and metadata. |
src/lverage/blast.py |
Retains isoforms and enriches retrieval diagnostics. |
requirements.txt |
Adds NumPy. |
README.md |
Explains V2 installation and local inference requirements. |
pyproject.toml |
Declares NumPy and packages the upstream license. |
docs/user_guide.rst |
Documents local setup, grouped exports, and metrics. |
docs/api/jaspar.rst |
Documents the local adapter and filtering behavior. |
conda_lverage.yml |
Adds NumPy to the environment. |
.github/workflows/documentation.yml |
Runs the legacy test file separately from V2 discovery. |
Review effort: Balanced
Comment on lines
+398
to
+404
| def comparison_rows(comparison): | ||
| key = pair_key(comparison) | ||
| children = [] | ||
| # Preserve completion order, including a database failure after motifs. | ||
| for event in events: | ||
| if pair_key(event) != key: | ||
| continue |
| fields = _ortholog_fields(ortholog) | ||
| summary = blast_summaries[-1] if blast_summaries else {} | ||
| fields["BLAST Outcome"] = blast_outcome(summary) | ||
| fields.update({"BLAST Hit Group": h_index, |
Comment on lines
+833
to
+835
| metadata_factory = getattr(jaspar_database, "configuration_metadata", None) | ||
| if callable(metadata_factory): | ||
| metadata["tools"]["jaspar"] = metadata_factory() |
| if self._base_accession(query_domain.accession) != self._base_accession(ortholog_domain.accession): | ||
| continue | ||
| if evidence_collector is not None: | ||
| evidence_collector.emit( |
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
Runs JASPAR 2026 profile inference locally from Lverage.
This PR also includes the CLI, grouped CSV, and BLAST filtering and retrieval
updates used in validation. Motif rows retain their supporting ORF, protein hit,
domain comparison, and inference metrics.
Stacked on #29 (
lverage-command-line).