|
152 | 152 | 'conditions': [
|
153 | 153 | {'@class': 'PositionalVariant', '@rid': SOMATIC_KB_MATCHES[0]['kbVariantId']},
|
154 | 154 | {'@class': 'CategoryVariant', '@rid': SOMATIC_KB_MATCHES[1]['kbVariantId']},
|
155 |
| - {'@class': 'Disease', '@rid': ''}, # non-variant condition |
| 155 | + {'@class': 'Disease', '@rid': ''}, |
156 | 156 | ],
|
157 | 157 | },
|
158 | 158 | {
|
159 | 159 | '@rid': SOMATIC_KB_MATCHES[1]['kbStatementId'],
|
160 | 160 | 'conditions': [
|
161 | 161 | {'@class': 'CategoryVariant', '@rid': SOMATIC_KB_MATCHES[1]['kbVariantId']},
|
162 |
| - {'@class': 'PositionalVariant', '@rid': '157:0'}, # Unmatched variant |
| 162 | + {'@class': 'PositionalVariant', '@rid': '157:0', 'type': '#999:99'}, |
163 | 163 | ],
|
164 | 164 | },
|
165 | 165 | ]
|
@@ -230,6 +230,14 @@ def mock_func(*pos, **kwargs):
|
230 | 230 | monkeypatch.setattr(gkb_vocab, "get_term_tree", mock_func)
|
231 | 231 |
|
232 | 232 |
|
| 233 | +@pytest.fixture(autouse=True) |
| 234 | +def get_terms_set(monkeypatch): |
| 235 | + def mock_func(*pos, **kwargs): |
| 236 | + return {'#999:99'} |
| 237 | + |
| 238 | + monkeypatch.setattr(gkb_vocab, "get_terms_set", mock_func) |
| 239 | + |
| 240 | + |
233 | 241 | @pytest.fixture(autouse=True)
|
234 | 242 | def mock_categorize_relevance(monkeypatch):
|
235 | 243 | def mock_func(_, relevance_id):
|
@@ -365,6 +373,9 @@ def test_germline_kb_matches(self):
|
365 | 373 | ), "Germline variant matched to KB somatic statement."
|
366 | 374 |
|
367 | 375 | def test_multi_variant_filtering(self, graphkb_conn):
|
368 |
| - gkb_matches = multi_variant_filtering(graphkb_conn, SOMATIC_KB_MATCHES) |
369 |
| - assert len(SOMATIC_KB_MATCHES) == 2, 'Matches before filtering' |
370 |
| - assert len(gkb_matches) == 1, 'Incomplete matches filtered' |
| 376 | + assert ( |
| 377 | + len(multi_variant_filtering(graphkb_conn, SOMATIC_KB_MATCHES, [])) == 1 |
| 378 | + ), 'Incomplete matches filtered, without excluded types' |
| 379 | + assert ( |
| 380 | + len(multi_variant_filtering(graphkb_conn, SOMATIC_KB_MATCHES)) == 2 |
| 381 | + ), 'Incomplete matches filtered, with default excluded types' |
0 commit comments