Skip to content

Commit b7e4e72

Browse files
authored
Merge pull request #172 from WengLab-InformaticsResearch/deprecate_oxo
Deprecate oxo
2 parents 95a8895 + cc87b03 commit b7e4e72

4 files changed

Lines changed: 200 additions & 190 deletions

File tree

cohd/cohd_flask.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
DEPLOYMENT_ENV = 'ITRB-CI' # Expected values: ITRB-CI, ITRB-TEST, or ITRB-PROD
22
DEBUG = False
3-
CACHE_TYPE = 'filesystem'
3+
CACHE_TYPE = 'FileSystemCache'
44
CACHE_DEFAULT_TIMEOUT = 3600
55
CACHE_DIR = 'flask_cache'
66
CACHE_THRESHOLD = 100000

cohd/cohd_oas3.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ info:
4141
[OMOP Common Data Model](https://github.com/OHDSI/CommonDataModel/wiki)
4242
[Athena](http://athena.ohdsi.org) (OMOP vocabularies, search, concept relationships, concept hierarchy)
4343
[Atlas](http://www.ohdsi.org/web/atlas/) (OMOP vocabularies, search, concept relationships, concept hierarchy, concept sets)
44-
version: 5.0.0
44+
version: 5.1.0
4545
title: Columbia Open Health Data (COHD) API
4646
contact:
4747
name: Casey Ta
@@ -669,10 +669,15 @@ paths:
669669
example: "SNOMED"
670670
/omop/xrefToOMOP:
671671
get:
672+
deprecated: true
672673
tags:
673674
- OMOP
674675
summary: Cross-reference from an ontology to OMOP standard concepts using the Ontology Xref Service
675676
description: >-
677+
This endpoint has been deprecated. COHD is now using Translator SRI services to map from OMOP to Biolink model.
678+
Also, the OxO API has been producing internal server errors in some circumstances for several months. This
679+
endpoint is currently still available but may not function correctly.
680+
676681
Attempts to map a concept from an external ontology to an OMOP standard concept ID using the EMBL-EBI Ontology Xref Service (OxO): https://www.ebi.ac.uk/spot/oxo/index. This method attempts to use OxO to map from the original ontology to an intermediate ontology that is included in OMOP (ICD9CM, ICD10CM, SNOMEDCT, and MeSH), then uses the OMOP mappings to the standard concepts. Multiple mappings may be returned. Results are sorted by total_distance (OxO distance + OMOP distance) in ascending order.
677682
parameters:
678683
- name: curie
@@ -754,10 +759,15 @@ paths:
754759
example: 2
755760
/omop/xrefFromOMOP:
756761
get:
762+
deprecated: true
757763
tags:
758764
- OMOP
759765
summary: Cross-reference from an ontology to OMOP standard concepts using the Ontology Xref Service
760766
description: >-
767+
This endpoint has been deprecated. COHD is now using Translator SRI services to map from OMOP to Biolink model.
768+
Also, the OxO API has been producing internal server errors in some circumstances for several months. This
769+
endpoint is currently still available but may not function correctly.
770+
761771
Attempts to map a concept from an external ontology to an OMOP standard concept ID using the EMBL-EBI Ontology Xref Service (OxO): https://www.ebi.ac.uk/spot/oxo/index. This method maps from the OMOP standard concept to an intermediate vocabulary included is OxO (ICD9CM, ICD10CM, SNOMEDCT, and MeSH), then uses the OxO API to map to other ontologies. Multiple mappings may be returned. Results are sorted by total_distance (OxO distance + OMOP distance) in ascending order.
762772
parameters:
763773
- name: concept_id

cohd/test_unit_tests.py

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -272,84 +272,84 @@ def test_omop_vocab_to_oxo_prefix():
272272
omop_xref.omop_vocab_to_oxo_prefix('MeSH') == 'MeSH'
273273

274274

275-
def test_oxo_search():
276-
""" Tests omop_xref.oxo_search
277-
Uses oxo_search to make multiple requests to OxO and checks that the results have the expected formats, expected
278-
number of search results (i.e., one search result for each CURIE queried), and checks how the number of mappings
279-
compare across different calls with different parameter settings (i.e., more mappings when larger distances are
280-
used).
281-
282-
Returns
283-
-------
284-
No return value. Asserts will be triggered upon failure.
285-
"""
286-
oxo_response_keys = ['_links', '_embedded', 'page']
287-
288-
# Check oxo_search with a known CURIE that should produce matches
289-
json = omop_xref.oxo_search(['DOID:8398'], distance=2)
290-
# Check the general response format
291-
assert json is not None and isinstance(json, dict) and all(k in json for k in oxo_response_keys)
292-
# Searched for 1 CURIE, expect searchResults with length 1
293-
assert len(json['_embedded']['searchResults']) == 1
294-
# Check that the query produced a response, but don't verify the mappings themselves
295-
assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) >= 0
296-
# Keep track of the number of results for comparison against following queries
297-
comparison_length = len(json['_embedded']['searchResults'][0]['mappingResponseList'])
298-
299-
# Sleep for 2 seconds so we don't overload OxO
300-
sleep(2)
301-
302-
# Check oxo_search with a known CURIE with a shorter distance and check that there are fewer results
303-
json = omop_xref.oxo_search(['DOID:8398'], distance=1)
304-
# Check the general response format
305-
assert json is not None and isinstance(json, dict) and all(k in json for k in oxo_response_keys)
306-
# Searched for 1 CURIE, expect searchResults with length 1
307-
assert len(json['_embedded']['searchResults']) == 1
308-
# Check that the query produced a response, but don't verify the mappings themselves
309-
assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) >= 0
310-
# Keep track of the number of results for comparison against following queries
311-
assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) <= comparison_length
312-
313-
# Sleep for 2 seconds so we don't overload OxO
314-
sleep(2)
315-
316-
# Check oxo_search with a known CURIE with a longer distance and check that there are fewer results
317-
json = omop_xref.oxo_search(['DOID:8398'], distance=3)
318-
# Check the general response format
319-
assert json is not None and isinstance(json, dict) and all(k in json for k in oxo_response_keys)
320-
# Searched for 1 CURIE, expect searchResults with length 1
321-
assert len(json['_embedded']['searchResults']) == 1
322-
# Check that the query produced a response, but don't verify the mappings themselves
323-
assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) >= 0
324-
# Keep track of the number of results for comparison against following queries
325-
assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) >= comparison_length
326-
327-
# Sleep for 2 seconds so we don't overload OxO
328-
sleep(2)
329-
330-
# Check oxo_search with a known CURIE with a restricted mapping targets and check that there are fewer results
331-
json = omop_xref.oxo_search(['DOID:8398'], mapping_targets=['ICD10CM'], distance=2)
332-
# Check the general response format
333-
assert json is not None and isinstance(json, dict) and all(k in json for k in oxo_response_keys)
334-
# Searched for 1 CURIE, expect searchResults with length 1
335-
assert len(json['_embedded']['searchResults']) == 1
336-
# Check that the query produced a response, but don't verify the mappings themselves
337-
assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) >= 0
338-
# Keep track of the number of results for comparison against following queries
339-
assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) <= comparison_length
340-
341-
# Sleep for 2 seconds so we don't overload OxO
342-
sleep(2)
343-
344-
# Check oxo_search with one valid CURIE and one fake CURIE
345-
json = omop_xref.oxo_search(['DOID:8398', 'DOID:83980000'], distance=1)
346-
# Check the general response format
347-
assert json is not None and isinstance(json, dict) and all(k in json for k in oxo_response_keys)
348-
# Searched for 2 CURIEs, expect searchResults with length 2
349-
assert len(json['_embedded']['searchResults']) == 2
350-
# Check that the first query produced mappings and the second query produced no mappings
351-
assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) > 0 and \
352-
len(json['_embedded']['searchResults'][1]['mappingResponseList']) == 0
275+
# def test_oxo_search():
276+
# """ Tests omop_xref.oxo_search
277+
# Uses oxo_search to make multiple requests to OxO and checks that the results have the expected formats, expected
278+
# number of search results (i.e., one search result for each CURIE queried), and checks how the number of mappings
279+
# compare across different calls with different parameter settings (i.e., more mappings when larger distances are
280+
# used).
281+
#
282+
# Returns
283+
# -------
284+
# No return value. Asserts will be triggered upon failure.
285+
# """
286+
# oxo_response_keys = ['_links', '_embedded', 'page']
287+
#
288+
# # Check oxo_search with a known CURIE that should produce matches
289+
# json = omop_xref.oxo_search(['DOID:8398'], distance=2)
290+
# # Check the general response format
291+
# assert json is not None and isinstance(json, dict) and all(k in json for k in oxo_response_keys)
292+
# # Searched for 1 CURIE, expect searchResults with length 1
293+
# assert len(json['_embedded']['searchResults']) == 1
294+
# # Check that the query produced a response, but don't verify the mappings themselves
295+
# assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) >= 0
296+
# # Keep track of the number of results for comparison against following queries
297+
# comparison_length = len(json['_embedded']['searchResults'][0]['mappingResponseList'])
298+
#
299+
# # Sleep for 2 seconds so we don't overload OxO
300+
# sleep(2)
301+
#
302+
# # Check oxo_search with a known CURIE with a shorter distance and check that there are fewer results
303+
# json = omop_xref.oxo_search(['DOID:8398'], distance=1)
304+
# # Check the general response format
305+
# assert json is not None and isinstance(json, dict) and all(k in json for k in oxo_response_keys)
306+
# # Searched for 1 CURIE, expect searchResults with length 1
307+
# assert len(json['_embedded']['searchResults']) == 1
308+
# # Check that the query produced a response, but don't verify the mappings themselves
309+
# assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) >= 0
310+
# # Keep track of the number of results for comparison against following queries
311+
# assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) <= comparison_length
312+
#
313+
# # Sleep for 2 seconds so we don't overload OxO
314+
# sleep(2)
315+
#
316+
# # Check oxo_search with a known CURIE with a longer distance and check that there are fewer results
317+
# json = omop_xref.oxo_search(['DOID:8398'], distance=3)
318+
# # Check the general response format
319+
# assert json is not None and isinstance(json, dict) and all(k in json for k in oxo_response_keys)
320+
# # Searched for 1 CURIE, expect searchResults with length 1
321+
# assert len(json['_embedded']['searchResults']) == 1
322+
# # Check that the query produced a response, but don't verify the mappings themselves
323+
# assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) >= 0
324+
# # Keep track of the number of results for comparison against following queries
325+
# assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) >= comparison_length
326+
#
327+
# # Sleep for 2 seconds so we don't overload OxO
328+
# sleep(2)
329+
#
330+
# # Check oxo_search with a known CURIE with a restricted mapping targets and check that there are fewer results
331+
# json = omop_xref.oxo_search(['DOID:8398'], mapping_targets=['ICD10CM'], distance=2)
332+
# # Check the general response format
333+
# assert json is not None and isinstance(json, dict) and all(k in json for k in oxo_response_keys)
334+
# # Searched for 1 CURIE, expect searchResults with length 1
335+
# assert len(json['_embedded']['searchResults']) == 1
336+
# # Check that the query produced a response, but don't verify the mappings themselves
337+
# assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) >= 0
338+
# # Keep track of the number of results for comparison against following queries
339+
# assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) <= comparison_length
340+
#
341+
# # Sleep for 2 seconds so we don't overload OxO
342+
# sleep(2)
343+
#
344+
# # Check oxo_search with one valid CURIE and one fake CURIE
345+
# json = omop_xref.oxo_search(['DOID:8398', 'DOID:83980000'], distance=1)
346+
# # Check the general response format
347+
# assert json is not None and isinstance(json, dict) and all(k in json for k in oxo_response_keys)
348+
# # Searched for 2 CURIEs, expect searchResults with length 2
349+
# assert len(json['_embedded']['searchResults']) == 2
350+
# # Check that the first query produced mappings and the second query produced no mappings
351+
# assert len(json['_embedded']['searchResults'][0]['mappingResponseList']) > 0 and \
352+
# len(json['_embedded']['searchResults'][1]['mappingResponseList']) == 0
353353

354354

355355
def test_xref_best_from():

0 commit comments

Comments
 (0)