Skip to content

Commit

Permalink
Merge pull request #672 from alliance-genome/mim_updates
Browse files Browse the repository at this point in the history
OMIM to MIM updates.
  • Loading branch information
christabone authored Jul 16, 2024
2 parents a303176 + b0ea9e1 commit 2c3dcf0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[![Build Status](https://travis-ci.org/alliance-genome/agr_loader.svg?branch=develop)](https://travis-ci.org/alliance-genome/agr_loader)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5259a0e847c04c72a4a9c4f34fabfed5)](https://www.codacy.com/project/christabone/agr_loader/dashboard?utm_source=github.com&utm_medium=referral&utm_content=alliance-genome/agr_loader&utm_campaign=Badge_Grade_Dashboard)

# Alliance of Genome Resources Loader
Expand Down Expand Up @@ -74,3 +73,4 @@ _Reminder_: authentification needs to be renewed every time you get an error lik
```
Error response from daemon: pull access denied for 100225593120.dkr.ecr.us-east-1.amazonaws.com/agr_neo4j_env, repository does not exist or may require 'docker login': denied: Your authorization token has expired. Reauthenticate and try again.
```

2 changes: 1 addition & 1 deletion src/etl/disease_etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def process_pages(self, dp, xrefs, pages):
for page in pages:
if (self.data_provider == 'RGD' or self.data_provider == 'HUMAN') and prefix == 'DOID':
display_name = 'RGD'
elif (self.data_provider == 'RGD' or self.data_provider == 'HUMAN') and prefix == 'OMIM':
elif (self.data_provider == 'RGD' or self.data_provider == 'HUMAN') and (prefix == 'OMIM' or prefix == 'MIM'):
display_name = 'OMIM'
else:
display_name = cross_ref_id.split(":")[0]
Expand Down
2 changes: 1 addition & 1 deletion src/etl/helpers/etl_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def get_xref_dict(local_id, prefix, cross_ref_type, page,
def get_complete_url_ont(self, local_id, global_id, key=None):
"""Get Complete 'ont'."""
page = None
if 'OMIM:PS' in global_id:
if 'OMIM:PS' in global_id or 'MIM:PS' in global_id:
page = 'ont'

if not key: # split not done before hand
Expand Down
8 changes: 7 additions & 1 deletion src/etl/helpers/resource_descriptor_helper_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,13 @@ def return_url(self, identifier, page):
def return_url_from_identifier(self, identifier, page=None):
"""Return URL for an identifier."""
db_prefix, identifier_stripped, separator = self.split_identifier(identifier)


# Normalize the identifier
# Special case for EFO.
if db_prefix and db_prefix.upper() == "EFO":
if not identifier_stripped.startswith("EFO_"):
identifier_stripped = "EFO_" + identifier_stripped

key = self.get_key(db_prefix, identifier)
if not key:
return None
Expand Down
2 changes: 1 addition & 1 deletion src/test/specific_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ def test_human_dej_has_omim_full_url_cross_reference():
"""Test Human DEJ has OMIM Full URL Cross Reference"""

query = """MATCH (g:Gene)--(dej:DiseaseEntityJoin)--(cr:CrossReference)
WHERE cr.crossRefCompleteUrl = 'https://www.omim.org/entry/605242'
WHERE cr.crossRefCompleteUrl = 'https://www.omim.org/MIM:605242'
RETURN count(cr) AS counter"""
with Neo4jHelper.run_single_query(query) as result:
for record in result:
Expand Down
2 changes: 1 addition & 1 deletion src/test/unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_url_lookup(self):
'result': 'https://ncit.nci.nih.gov/ncitbrowser/ConceptReport.jsp?dictionary=NCI_Thesaurus&code=C5604'},
{'local_id': 'badregexdoesnotmatch', 'global_id': 'MESH:badregexdoesnotmatch',
'result': 'https://www.ncbi.nlm.nih.gov/mesh/badregexdoesnotmatch'},
{'local_id': 'Cdiff', 'global_id': 'MIM:1111', 'result': 'https://www.omim.org/entry/1111'}]
{'local_id': 'Cdiff', 'global_id': 'MIM:1111', 'result': 'https://www.omim.org/MIM:1111'}]

for item in lookups:
url = self.etlh.get_complete_url_ont(item['local_id'], item['global_id'])
Expand Down

0 comments on commit 2c3dcf0

Please sign in to comment.