Skip to content

use gkb disease matches for variant-text#99

Open
elewis2 wants to merge 2 commits intodevelopfrom
feat/DEVSU-2856-broader-disease-matching-for-variant-texts
Open

use gkb disease matches for variant-text#99
elewis2 wants to merge 2 commits intodevelopfrom
feat/DEVSU-2856-broader-disease-matching-for-variant-texts

Conversation

@elewis2
Copy link
Collaborator

@elewis2 elewis2 commented Feb 5, 2026

When generating analyst summary text from IPR prepared variant text, does disease matching using same the list of matching disease terms from graphkb that are used to set matched_cancer on kb statements.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.09%. Comparing base (6ee9eb4) to head (a3715db).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #99      +/-   ##
===========================================
+ Coverage    83.05%   83.09%   +0.03%     
===========================================
  Files           18       18              
  Lines         2461     2466       +5     
===========================================
+ Hits          2044     2049       +5     
  Misses         417      417              
Flag Coverage Δ
unittests 83.09% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

# Matching disease RIDs from GraphKB using term tree
# (Will raise uncatched error if no match)
disease_matches: list[str] = get_kb_disease_matches(graphkb_conn, kb_disease_match)
disease_match_records: [list[str], list[str]] = get_kb_disease_matches(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically returns a tuple[list[str], list[str]]

return disease_matches
disease_match_rids = [item['@rid'] for item in disease_matches]
disease_match_names = [item['name'] for item in disease_matches]
return (disease_match_rids, disease_match_names)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious, why returning 2 seperate lists instead of a list of dict like

[
    {"@rid":"#123:45", "name":"disease 1"},
    {"@rid":"#123:46", "name":"disease 2"},
    ...
]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went back and forth on this, it's just a question of whether the work gets done in this func or in main. I'm happy to move it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it easier for get_kb_disease_matches() reusability, but non-blocking.

disease_match_records: [list[str], list[str]] = get_kb_disease_matches(
graphkb_conn, kb_disease_match
)
disease_match_rids: list[str] = disease_match_records[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can have it all in one go::

disease_match_rids, disease_match_names = get_kb_disease_matches(
    graphkb_conn,
    kb_disease_match,
)

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.

3 participants