Exemplo n.º 1
0
    def test_no_disease_match(self, graphkb_conn) -> None:
        statement = base_graphkb_statement('other')
        result = convert_statements_to_alterations(graphkb_conn, [statement],
                                                   'disease', {'variant_rid'})

        assert len(result) == 1
        row = result[0]
        assert not row['matchedCancer']
Exemplo n.º 2
0
    def test_diagnostic_statement(self, graphkb_conn) -> None:
        statement = base_graphkb_statement()
        statement['relevance']['@rid'] = 'diag1'

        result = convert_statements_to_alterations(graphkb_conn, [statement],
                                                   'disease', {'variant_rid'})
        assert len(result) == 1
        row = result[0]
        assert row['category'] == 'diagnostic'
Exemplo n.º 3
0
    def test_disease_match(self, graphkb_conn) -> None:
        statement = base_graphkb_statement('disease')
        result = convert_statements_to_alterations(graphkb_conn, [statement],
                                                   'disease', {'variant_rid'})

        assert len(result) == 1
        row = result[0]
        assert row['kbVariantId'] == 'variant_rid'
        assert row['kbStatementId'] == 'statement_rid'
        assert row['matchedCancer']
        assert row['kbVariant'] == 'KRAS increased expression'
        assert row['relevance'] == 'relevance_display_name'
Exemplo n.º 4
0
    def test_approved_therapeutic_statement(self, graphkb_conn) -> None:
        statement = base_graphkb_statement()
        statement['relevance']['@rid'] = 'ther1'
        statement['evidenceLevel'] = [{
            '@rid': 'approved1',
            'displayName': 'level'
        }]

        result = convert_statements_to_alterations(graphkb_conn, [statement],
                                                   'disease', {'variant_rid'})
        assert len(result) == 1
        row = result[0]
        assert row['category'] == 'therapeutic'
Exemplo n.º 5
0
    def test_multiple_disease_not_match(self, graphkb_conn) -> None:
        statement = base_graphkb_statement('disease')
        statement['conditions'].append({
            '@class': 'Disease',
            '@rid': 'other',
            'displayName': 'disease_display_name'
        })
        result = convert_statements_to_alterations(graphkb_conn, [statement],
                                                   'disease', {'variant_rid'})

        assert len(result) == 1
        row = result[0]
        assert not row['matchedCancer']