Tighten and prune BTE lookup query templates - #133
Open
maximusunc wants to merge 1 commit into
Open
Conversation
Several active multi-hop templates under-constrained their edges, causing the BTE lookup worker to return excessive results. Tighten the four over-broad Drug-treats-Disease templates: - Chem-affects-Gene-has_phenotype-DoP: constrain the bare `affects` first hop with an activity_or_abundance aspect qualifier (direction-agnostic). - Chem-affects_increases-Gene-loss_function-Disease and its _decreases mirror: the gene->disease edge had no predicate at all; give it `associated_with` + a `contributes_to` qualified predicate (following the existing associated_variant template pattern), and add an activity_or_abundance aspect to the first hop. - Chem-treats-PhenoOfDisease: narrow the catch-all `treats_or_applied_or_studied_to_treat` predicate to `treats`/`ameliorates`. Also remove 14 template files that no group in template_groups.json references (the old_ideas/ and NonChem-treats-Disease/ directories plus several loose correlation/interaction one-hops), so they no longer sit as unreachable dead weight. The 10 referenced templates are unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bj6iRrjjvnZSYApZMZd82p
Codecov Report✅ All modified and coverable lines are covered by tests. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
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.
Several active multi-hop templates under-constrained their edges, causing the BTE lookup worker to return excessive results. Tighten the four over-broad Drug-treats-Disease templates:
affectsfirst hop with an activity_or_abundance aspect qualifier (direction-agnostic).associated_with+ acontributes_toqualified predicate (following the existing associated_variant template pattern), and add an activity_or_abundance aspect to the first hop.treats_or_applied_or_studied_to_treatpredicate totreats/ameliorates.Also remove 14 template files that no group in template_groups.json references (the old_ideas/ and NonChem-treats-Disease/ directories plus several loose correlation/interaction one-hops), so they no longer sit as unreachable dead weight. The 10 referenced templates are unaffected.
After making these changes, I ran the Test Harness against my local BTE and here are the results:
Local, BTE ran all 85 queries in 4:38:
{ "bte": { "TopAnswer": { "PASSED": 59, "FAILED": 41, "NO_RESULTS": 2, "SKIPPED": 0, "ERROR": 0 }, "Acceptable": { "PASSED": 38, "FAILED": 50, "NO_RESULTS": 9, "SKIPPED": 2, "ERROR": 0 }, "BadButForgivable": { "PASSED": 12, "FAILED": 1, "NO_RESULTS": 4, "SKIPPED": 0, "ERROR": 0 }, "NeverShow": { "PASSED": 379, "FAILED": 21, "NO_RESULTS": 35, "SKIPPED": 0, "ERROR": 0 } } }vs CI (and I ran the same locally to check parity and it's spot on, and to check timing and it took 17:24):
{ "shepherd-bte": { "TopAnswer": { "PASSED": 56, "FAILED": 44, "NO_RESULTS": 2, "SKIPPED": 0, "ERROR": 0 }, "Acceptable": { "PASSED": 40, "FAILED": 48, "NO_RESULTS": 9, "SKIPPED": 2, "ERROR": 0 }, "BadButForgivable": { "PASSED": 10, "FAILED": 3, "NO_RESULTS": 4, "SKIPPED": 0, "ERROR": 0 }, "NeverShow": { "PASSED": 353, "FAILED": 47, "NO_RESULTS": 35, "SKIPPED": 0, "ERROR": 0 } } }