Skip to content

Wire the confidence facets together - #79

Closed
edkerk wants to merge 1 commit into
developfrom
feat/confidence-facet-wiring
Closed

Wire the confidence facets together#79
edkerk wants to merge 1 commit into
developfrom
feat/confidence-facet-wiring

Conversation

@edkerk

@edkerk edkerk commented Jul 18, 2026

Copy link
Copy Markdown
Member

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 facet

annotate_confidence(model, proposal=..., scores=...) runs every scorer 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 rather than failed otherwise — the same abstain-rather-than-guess rule the scores themselves follow. The returned dict reports what actually ran, and facets=[...] restricts the set (an unknown facet raises).

curation_priority reads the record — the loop closes

A placement a curator has settled with mark_curated now drops out of the review queue (new respect_curated=True, default on). So the pipeline is a closed loop:

score → review here → curate (mark_curated) → stop being asked

The skip is targeted (only that reaction's placement rows — a second flagged reaction stays) and reversible (respect_curated=False ranks 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 the localizationconfidence cycle.

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). pytest 842 passed / 4 skipped; ruff, mypy, and the -W docs 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.

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.
@edkerk

edkerk commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

Duplicate of #78, which is the canonical facet-wiring PR. Closing in favour of #78.

@edkerk edkerk closed this Jul 18, 2026
@edkerk
edkerk deleted the feat/confidence-facet-wiring branch July 18, 2026 22:02
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.

1 participant