feat: rank and filter logic for biolink:statistical_significance_qualifier - #2859
Open
SkyeAv wants to merge 3 commits into
Open
Conversation
SkyeAv
force-pushed
the
feat/implement-ranking-logic-for-the-statistical-significance-qualifier
branch
from
July 28, 2026 20:52
9e65dcb to
3da09b3
Compare
…lter action - Register significance band scores and trust weight in ARAX_ranker - Add _get_significance_qualifier_value() to read from edge.qualifiers - Integrate qualifier as additive signal in edge_attribute_score_combiner - Add remove_edges_by_statistical_significance action to KG filter - Implement ordinal threshold logic in Filter_KG/remove_edges.py
…lifier - Score mapping, qualifier lookup, and edge-case tests for ranker - Ordinal filter, threshold boundary, and registration tests for filter_kg - Two @pytest.mark.slow integration tests (expand → filter/rank → resultify)
SkyeAv
force-pushed
the
feat/implement-ranking-logic-for-the-statistical-significance-qualifier
branch
from
July 29, 2026 22:18
fac2c03 to
c915b7d
Compare
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.
Adds ranking and KG-level filtering support for the
biolink:statistical_significance_qualifier(biolink/biolink-model#1766), which categorizes an edge's evidence into coarse significance bands (very_strongly_significantthroughnot_significant) as a companion to the authoritative numericp value/adjusted p valueslots. Closes #2858.Ranker
edge_attribute_score_combiner()inARAX_ranker.pynow injects a significance-band score into the existing loop algorithm (W_r = W_r + (1 - W_r) * W_i) alongside numeric p-value and other attributes — the qualifier can only boost, never penalize._significance_trust_weightconstant at0.5, with band scores ranging0.0–0.70(max effective contribution0.35). TODO comment marks this for revisit once adoption is widespread._get_significance_qualifier_value(self: Self, edge: Edge) -> Optional[str]to look up the qualifier before thefloat()conversion inedge_attribute_score_normalizer()(which would otherwiseValueErroron enum strings and silently return0).edge.qualifiers(the TRAPI path for biolink qualifier descendants), stripping anybiolink:prefix from the value.KG Filter
remove_edges_by_statistical_significanceinARAX_filter_kg.py+Filter_KG/remove_edges.py— an ordinal threshold filter, not exact-match.minimum_significance=significantremovessuggestiveandnot_significantedges while keepingsignificantand above.filter_kg(action=remove_edges_by_statistical_significance, minimum_significance=suggestive)removes onlynot_significant; supportsremove_connected_nodes,qedge_keys, andqnode_keys.allowable_actions,command_definitions, and parameter descriptors matching the existingremove_edges_by_discrete_attributepattern.Design
edge.qualifiers[]. It is read only from there — it is not registered as an edge attribute in the decorator and is not read fromedge.attributesanywhere.ARAX_filter.py) — edge-level KG filtering is the right granularity. Significance-aware pathfinding is a candidate for future work.Testing
ARAX_ranker.py— score mapping, qualifier lookup (edge.qualifiers/prefixed), edge cases (multiple qualifiers, empty lists, unrecognized values), additive-with-pValue → all PASSFilter_KG/remove_edges.py— ordinal removal, threshold boundaries (very_strongly_significantremoves 4/5,not_significantremoves 0/5), qualifier-less edges kept,command_definitionsregistration → all PASS@pytest.mark.slow) included that query liveinfores:retrieverend-to-end; these are forward-looking until BioPack-team/retriever#197 ships.