Skip to content

Implement local JASPAR 2026 profile inference - #33

Open
ShinThomas wants to merge 2 commits into
lverage-command-linefrom
jaspar-profile-inference
Open

ShinThomas wants to merge 2 commits into
lverage-command-linefrom
jaspar-profile-inference

Conversation

@ShinThomas

Copy link
Copy Markdown
Collaborator

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).

@ShinThomas

Copy link
Copy Markdown
Collaborator Author

updated with documentation

@ShinThomas

Copy link
Copy Markdown
Collaborator Author

@AnthonyGarza124 test ping

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.

🟡 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 thread src/lverage/cli.py
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
Comment thread src/lverage/cli.py
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 thread src/lverage/cli.py
Comment on lines +833 to +835
metadata_factory = getattr(jaspar_database, "configuration_metadata", None)
if callable(metadata_factory):
metadata["tools"]["jaspar"] = metadata_factory()
Comment thread src/lverage/pipeline.py
if self._base_accession(query_domain.accession) != self._base_accession(ortholog_domain.accession):
continue
if evidence_collector is not None:
evidence_collector.emit(
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