Skip to content

Commit

Permalink
Merge pull request #113 from bcgsc/improvement/DEVSU-1885_fix_malform…
Browse files Browse the repository at this point in the history
…ed_deletions

Improvement/devsu 1885 fix malformed deletions
  • Loading branch information
dustinbleile committed Apr 21, 2023
2 parents 79314e3 + 236a8b7 commit 07678d7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
17 changes: 16 additions & 1 deletion ipr/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,22 @@ def annotate_positional_variants(
if not variant:
continue
try:
matches = gkb_match.match_positional_variant(graphkb_conn, variant)
try:
matches = gkb_match.match_positional_variant(graphkb_conn, variant)
except HTTPError:
# DEVSU-1885 - fix malformed single deletion described as substitution of blank
# eg.
if (
variant[-1] == '>'
and 'g.' in variant
and variant[-2].isalpha()
and variant[-3].isnumeric()
):
logger.warning(
f"Assuming malformed deletion variant {variant} is {variant[:-2] + 'del'}"
)
variant = variant[:-2] + 'del'
matches = gkb_match.match_positional_variant(graphkb_conn, variant)

# GERO-299 - check for conflicting nonsense and missense categories
missense = [
Expand Down
3 changes: 1 addition & 2 deletions ipr/ipr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
from graphkb import GraphKBConnection
from graphkb import statement as gkb_statement
from graphkb import vocab as gkb_vocab
from graphkb.types import Record
from typing import Dict, Iterable, List, Sequence, Set, Tuple

from .constants import GERMLINE_BASE_TERMS, VARIANT_CLASSES
from .types import GkbStatement, ImageDefinition, IprFusionVariant, IprGene, IprVariant, KbMatch
from .util import convert_to_rid_set, find_variant, logger
from .util import find_variant, logger


def display_evidence_levels(statement: GkbStatement) -> str:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ known_standard_library = requests

[metadata]
name = ipr
version = 3.7.1
version = 3.8.0
author_email = ipr@bcgsc.ca
author = ipr
maintainer_email = ipr@bcgsc.ca
Expand Down

0 comments on commit 07678d7

Please sign in to comment.