Skip to content

Commit

Permalink
Add test_ensembl_protein
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieulemieux committed Mar 1, 2024
1 parent 15180c6 commit 1a2d5c4
Showing 1 changed file with 129 additions and 0 deletions.
129 changes: 129 additions & 0 deletions tests/test_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,135 @@ def test_checks_by_source_id_kras(self, conn):
]
assert "KRAS" in kras

# KBDEV-1163
# Testing if the addition of Ensembl protein Features are limiting results
# returned by get_equivalent_features() since SimilatTo queryType queries
# aren't traversing the graph to it's whole depth.
@pytest.mark.skipif(EXCLUDE_INTEGRATION_TESTS, reason="excluding data-specific test")
def test_ensembl_protein(self, conn):
for feature, expected in [
# Sample
(
'EGFR',
[
'EGFR',
'ERBB',
'ENSG00000146648',
'ENSG00000146648.17',
'ENST00000275493',
'ENST00000275493.6',
'NM_001346897',
'NM_001346897.2',
'NP_001333826',
'NP_001333826.1',
],
),
(
'NM_001346897',
[
'EGFR',
'ERBB',
'ENSG00000146648',
'ENSG00000146648.17',
'NM_001346897',
'NM_001346897.2',
'NP_001333826',
'NP_001333826.1',
],
),
(
'NM_001346897.2',
[
'EGFR',
'ERBB',
'ENSG00000146648',
'ENSG00000146648.17',
'NM_001346897',
'NM_001346897.2',
'NP_001333826',
'NP_001333826.1',
],
),
(
'NP_001333826',
[
'EGFR',
'ERBB',
'ENSG00000146648', # Warn: Versionized ENSG won't be returned due to API limitations
'NM_001346897',
'NM_001346897.2',
'NP_001333826',
'NP_001333826.1',
],
),
(
'NP_001333826.1',
[
'EGFR',
'ERBB',
'ENSG00000146648', # Warn: Versionized ENSG won't be returned due to API limitations
'NM_001346897',
'NM_001346897.2',
'NP_001333826',
'NP_001333826.1',
],
),
(
'ENSG00000146648',
[
'EGFR',
'ERBB',
'ENSG00000146648',
'ENSG00000146648.17',
'ENST00000275493',
'ENST00000275493.6',
'NM_001346897',
'NM_001346897.2',
'NP_001333826', # Warn: Versionized NP won't be returned due to API limitations
],
),
(
'ENSG00000146648.17',
[
'EGFR',
'ERBB',
'ENSG00000146648',
'ENSG00000146648.17',
'ENST00000275493',
'ENST00000275493.6',
'NM_001346897',
'NM_001346897.2',
'NP_001333826', # Warn: Versionized NP won't be returned due to API limitations
],
),
(
'ENST00000275493',
[
'EGFR',
'ERBB',
'ENSG00000146648',
'ENSG00000146648.17',
'ENST00000275493',
'ENST00000275493.6',
],
),
(
'ENST00000275493.6',
[
'EGFR',
'ERBB',
'ENSG00000146648',
'ENSG00000146648.17',
'ENST00000275493',
'ENST00000275493.6',
],
),
]:
equivalent_features = match.get_equivalent_features(conn, feature)
equivalent_features = [el['displayName'] for el in equivalent_features]
for equivalent_feature in expected:
assert equivalent_feature in equivalent_features


class TestMatchCopyVariant:
def test_bad_category(self, conn):
Expand Down

0 comments on commit 1a2d5c4

Please sign in to comment.