Skip to content

Commit

Permalink
Merge pull request #90 from bcgsc/release/v1.10.2
Browse files Browse the repository at this point in the history
Release/v1.10.2
  • Loading branch information
mathieulemieux authored May 24, 2023
2 parents 727c329 + 59e6306 commit d79c449
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
26 changes: 11 additions & 15 deletions graphkb/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
looks_like_rid,
stringifyVariant,
)
from .vocab import get_term_tree
from .vocab import get_equivalent_terms, get_term_tree

FEATURES_CACHE: Set[str] = set()

Expand Down Expand Up @@ -477,25 +477,11 @@ def match_positional_variant(
raise FeatureNotFoundError(
f'unable to find the gene ({gene2}) or any equivalent representations'
)
# disambiguate the variant type
variant_types_details = get_term_tree(
conn,
parsed['type'],
root_exclude_term='mutation' if secondary_features else '',
ignore_cache=ignore_cache,
)

types = convert_to_rid_list(variant_types_details)

if not types:
variant_type = parsed['type']
raise ValueError(f'unable to find the term/category ({variant_type}) or any equivalent')

# match the existing mutations (positional)
query_filters = [
{'reference1': features},
{'reference2': secondary_features},
{'type': types},
{'break1Start.@class': parsed['break1Start']['@class']},
]

Expand Down Expand Up @@ -538,6 +524,16 @@ def match_positional_variant(
),
)

# disambiguate the variant type
variant_types_details = get_equivalent_terms(
conn,
parsed['type'],
root_exclude_term='mutation' if secondary_features else '',
ignore_cache=ignore_cache,
)

types = convert_to_rid_list(variant_types_details)

matches.extend(
conn.query(
{
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include_trailing_comma = true
[metadata]
name = graphkb
url = https://github.com/bcgsc/pori_graphkb_python
version = 1.10.1
version = 1.10.2
author_email = [email protected]
description = python adapter for interacting with the GraphKB API
long_description = file: README.md
Expand Down
1 change: 0 additions & 1 deletion tests/test_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ def test_tert_promoter_leading_one_alt_notation(self, conn):
# GERO-303 - technically this format is incorrect.
assert match.match_positional_variant(conn, 'TERT:c.1-124C>T')

@pytest.mark.skipif(True, reason="TODO: GERO-299 incomplete; cds and genomic fail test.")
def test_missense_is_not_nonsense(self, conn):
"""GERO-299 - nonsense mutation creates a stop codon and is usually more severe."""
# equivalent TP53 notations
Expand Down

0 comments on commit d79c449

Please sign in to comment.