|
5 | 5 | from pori_python.graphkb import vocab as gkb_vocab |
6 | 6 | from pori_python.ipr.ipr import ( |
7 | 7 | convert_statements_to_alterations, |
| 8 | + create_key_alterations, |
8 | 9 | germline_kb_matches, |
9 | 10 | get_kb_disease_matches, |
10 | 11 | get_kb_matched_statements, |
| 12 | + get_kb_matches_sections, |
11 | 13 | get_kb_statement_matched_conditions, |
12 | 14 | get_kb_variants, |
13 | | - get_kb_matches_sections, |
14 | | - create_key_alterations, |
15 | 15 | ) |
16 | 16 | from pori_python.types import Statement |
17 | 17 |
|
@@ -497,10 +497,10 @@ def test_germline_kb_matches(self): |
497 | 497 | ] |
498 | 498 |
|
499 | 499 | ALL_VARIANTS = [ |
500 | | - {"variant": "var1", "key": '1', "variantType": 'mut'}, |
501 | | - {"variant": "var2", "key": '2', "variantType": 'mut'}, |
502 | | - {"variant": "var3", "key": '3', "variantType": 'mut'}, |
503 | | - {"variant": "var4", "key": '4', "variantType": 'mut'}, |
| 500 | + {"variant": "var1", "key": "1", "variantType": "mut"}, |
| 501 | + {"variant": "var2", "key": "2", "variantType": "mut"}, |
| 502 | + {"variant": "var3", "key": "3", "variantType": "mut"}, |
| 503 | + {"variant": "var4", "key": "4", "variantType": "mut"}, |
504 | 504 | ] |
505 | 505 |
|
506 | 506 | BASIC_GKB_MATCH = { |
@@ -709,8 +709,8 @@ def test_partial_matches_omitted(self): |
709 | 709 | gkb_matches = create_gkb_matches(input_fields) |
710 | 710 | sections = get_kb_matches_sections(gkb_matches, allow_partial_matches=False) |
711 | 711 |
|
712 | | - stmts = sections['kbMatchedStatements'] |
713 | | - kbcs = sections['kbStatementMatchedConditions'] |
| 712 | + stmts = sections["kbMatchedStatements"] |
| 713 | + kbcs = sections["kbStatementMatchedConditions"] |
714 | 714 | assert len(stmts) == 2 |
715 | 715 | assert len(kbcs) == 1 # X only |
716 | 716 | assert kbcs[0]["kbStatementId"] == "X" |
@@ -796,14 +796,14 @@ def test_kbvariants_removed_from_set_when_not_part_of_full_conditionset_match(se |
796 | 796 | item["kbVariant"] = "test" |
797 | 797 | gkb_matches = create_gkb_matches(input_fields) |
798 | 798 | sections1 = get_kb_matches_sections(gkb_matches, allow_partial_matches=False) |
799 | | - kbcs1 = sections1['kbStatementMatchedConditions'] |
800 | | - kbvars1 = sections1['kbMatches'] |
| 799 | + kbcs1 = sections1["kbStatementMatchedConditions"] |
| 800 | + kbvars1 = sections1["kbMatches"] |
801 | 801 | assert len(kbcs1) == 1 # only fully matched condition sets included |
802 | 802 | assert len(kbvars1) == 2 # therefore, kbvars associated with stmt X are pruned |
803 | 803 |
|
804 | 804 | sections2 = get_kb_matches_sections(gkb_matches, allow_partial_matches=True) |
805 | | - kbcs2 = sections2['kbStatementMatchedConditions'] |
806 | | - kbvars2 = sections2['kbMatches'] |
| 805 | + kbcs2 = sections2["kbStatementMatchedConditions"] |
| 806 | + kbvars2 = sections2["kbMatches"] |
807 | 807 | assert len(kbcs2) == 2 # all condition sets included |
808 | 808 | assert len(kbvars2) == 3 # therefore, no pruning |
809 | 809 |
|
@@ -844,12 +844,12 @@ def test_create_key_alterations_includes_only_pruned_kbmatches(self): |
844 | 844 |
|
845 | 845 | sections1 = get_kb_matches_sections(gkb_matches, allow_partial_matches=False) |
846 | 846 | key_alts1, counts1 = create_key_alterations( |
847 | | - gkb_matches, ALL_VARIANTS, sections1['kbMatches'] |
| 847 | + gkb_matches, ALL_VARIANTS, sections1["kbMatches"] |
848 | 848 | ) |
849 | 849 |
|
850 | 850 | sections2 = get_kb_matches_sections(gkb_matches, allow_partial_matches=True) |
851 | 851 | key_alts2, counts2 = create_key_alterations( |
852 | | - gkb_matches, ALL_VARIANTS, sections2['kbMatches'] |
| 852 | + gkb_matches, ALL_VARIANTS, sections2["kbMatches"] |
853 | 853 | ) |
854 | 854 |
|
855 | 855 | # check partial-match-only variants are not included in key alterations when |
|
0 commit comments