Skip to content

Commit

Permalink
Logs: don't show expected OLS query errors for OMIM and MedGen ontolo…
Browse files Browse the repository at this point in the history
…gies
  • Loading branch information
tskir committed Oct 10, 2019
1 parent 35f1dc6 commit 6d2e21f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eva_cttv_pipeline/trait_mapping/ols.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def get_ontology_label_from_ols(ontology_uri: str) -> str:

# If the '_embedded' section is missing from the response, it means that the term is not found in OLS
if '_embedded' not in json_response:
logger.warning('OLS queried OK but did not return any results for URL {}'.format(url))
if '/medgen/' not in url and '/omim/' not in url:
logger.warning('OLS queried OK but did not return any results for URL {}'.format(url))
return None

# Go through all terms found by the requested identifier and try to find the one where the _identifier_ and the
Expand All @@ -48,7 +49,8 @@ def get_ontology_label_from_ols(ontology_uri: str) -> str:
if term["is_defining_ontology"]:
return term["label"]

logger.warning('OLS queried OK, but there is no defining ontology in its results for URL {}'.format(url))
if '/medgen/' not in url and '/omim/' not in url:
logger.warning('OLS queried OK, but there is no defining ontology in its results for URL {}'.format(url))
return None


Expand Down

0 comments on commit 6d2e21f

Please sign in to comment.