Commit c96d7e1 1 parent 3ccb9be commit c96d7e1 Copy full SHA for c96d7e1
File tree 2 files changed +9
-8
lines changed
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -627,8 +627,14 @@ def get_kb_matches_sections(
627
627
628
628
629
629
def get_kb_disease_matches (
630
- graphkb_conn : GraphKBConnection , kb_disease_match : str = 'cancer' , verbose = True
630
+ graphkb_conn : GraphKBConnection , kb_disease_match : str = None , verbose : bool = True
631
631
) -> list [str ]:
632
+
633
+ if not kb_disease_match :
634
+ kb_disease_match = 'cancer'
635
+ if verbose :
636
+ logger .warning (f"No disease provided; will use '{ kb_disease_match } '" )
637
+
632
638
if verbose :
633
639
logger .info (f"Matching disease ({ kb_disease_match } ) to graphkb" )
634
640
Original file line number Diff line number Diff line change @@ -384,13 +384,8 @@ def ipr_report(
384
384
kb_disease_match : str = content ["kbDiseaseMatch" ]
385
385
386
386
# Matching disease RIDs from GraphKB using term tree
387
- disease_matches : list [str ] = []
388
- try :
389
- disease_matches = get_kb_disease_matches (graphkb_conn , kb_disease_match )
390
- except ValueError as err :
391
- # 2nd try using deafult disease term.
392
- # Will raise uncatched error if no match
393
- disease_matches = get_kb_disease_matches (graphkb_conn )
387
+ # (Will raise uncatched error if no match)
388
+ disease_matches : list [str ] = get_kb_disease_matches (graphkb_conn , kb_disease_match )
394
389
395
390
# GKB MATCHING
396
391
gkb_matches : List [Hashabledict ] = []
You can’t perform that action at this time.
0 commit comments