Wire the confidence facets together - #79
Closed
edkerk wants to merge 1 commit into
Closed
Conversation
Three integration steps that turn the per-facet scorers into a pipeline,
and close the loop between confidence and curation.
* annotate_confidence(model, proposal=..., scores=...) runs every
applicable scorer in one call and returns {facet: count}. equation and
gene_association need only the model; localization runs only when a
proposal and its scores are supplied, and is skipped (not failed)
otherwise -- the same abstain-rather-than-guess rule the scores follow.
The returned dict reports what actually ran.
* curation_priority reads the confidence record: a placement a curator
settled with mark_curated drops out of the review queue (new
respect_curated=True), so score -> review -> curate -> stop-being-asked
is a closed loop. The skip is targeted (only that reaction's placement
rows) and reversible (respect_curated=False). The confidence import is
lazy to avoid the localization <-> confidence cycle.
* The no-SBO warning now names its remedy,
raven_toolbox.annotation.add_sbo_terms(model).
Tests cover the umbrella (facet selection, localization skipped without a
proposal, unknown-facet error), the curated skip (suppressed then
restored, targeted not global), and reuse the existing helpers.
Member
Author
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.
The three per-reaction confidence scorers (
localization,equation,gene_association) shipped as separate calls with no glue. This wires them into a pipeline and closes the loop between confidence and curation — the "wire the facets together" work item.annotate_confidence— one call, every applicable facetannotate_confidence(model, proposal=..., scores=...)runs every scorer and returns{facet: count}.equationandgene_associationneed only the model;localizationruns only when a proposal and its scores are supplied, and is skipped rather than failed otherwise — the same abstain-rather-than-guess rule the scores themselves follow. The returned dict reports what actually ran, andfacets=[...]restricts the set (an unknown facet raises).curation_priorityreads the record — the loop closesA placement a curator has settled with
mark_curatednow drops out of the review queue (newrespect_curated=True, default on). So the pipeline is a closed loop:The skip is targeted (only that reaction's placement rows — a second flagged reaction stays) and reversible (
respect_curated=Falseranks everything as before). Transports and gap-fills are unaffected, since curation settles a reaction's placement, not the bridges around it. The confidence import is lazy, to avoid thelocalization↔confidencecycle.Smaller fix
The no-SBO warning now names its remedy —
raven_toolbox.annotation.add_sbo_terms(model)— instead of just saying "annotate SBO terms first".Tests & verification
New tests cover the umbrella (facet selection, localization skipped without a proposal, unknown-facet error) and the curated skip (flagged → suppressed → restored; targeted not global).
pytest842 passed / 4 skipped; ruff, mypy, and the-Wdocs build clean.Note on the study doc
The
confidence_tracking.md§10 plan that lists these as the next items is being rewritten in #73 (which removes the rejected reversibility facet). To avoid a merge conflict I left the doc to #73; once both land, its §10 should mark these three items done. Flagging so it doesn't fall through the cracks.