Skip to content

Commit

Permalink
Merge pull request #117 from monarch-initiative/move_included_syns
Browse files Browse the repository at this point in the history
Annotate included synonyms using a different property
  • Loading branch information
twhetzel authored Jul 23, 2024
2 parents 89d2517 + 54e4426 commit 1623707
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions omim2obo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
# Vars
OUTPATH = os.path.join(ROOT_DIR / 'omim.ttl')
ISSUES_OUTPATH = os.path.join(ROOT_DIR, 'omimIssues.json')
INCLUDED_URI = 'http://purl.obolibrary.org/obo/mondo#omim_included'


# Logging
Expand Down Expand Up @@ -139,6 +140,7 @@ def omim2obo(use_cache: bool = False):
# - Non-OMIM triples
graph.add((URIRef('http://purl.obolibrary.org/obo/mondo/omim.owl'), RDF.type, OWL.Ontology))
graph.add((URIRef('http://www.geneontology.org/formats/oboInOwl#hasSynonymType'), RDF.type, OWL.AnnotationProperty))
graph.add((URIRef('http://purl.obolibrary.org/obo/mondo#omim_included'), RDF.type, OWL.AnnotationProperty))
graph.add((BIOLINK['has_evidence'], RDF.type, OWL.AnnotationProperty))
graph.add((TAX_URI, RDF.type, OWL.Class))
graph.add((TAX_URI, RDFS.label, Literal(TAX_LABEL)))
Expand All @@ -165,13 +167,15 @@ def omim2obo(use_cache: bool = False):
omim_type, pref_label, alt_labels, inc_labels = omim_type_and_titles[omim_id]
label = pref_label
other_labels = []
label_endswith_included_alt, label_endswith_included_inc = False, False
cleaned_inc_labels = []
label_endswith_included_alt = False
label_endswith_included_inc = False
if alt_labels:
cleaned_alt_labels, label_endswith_included_alt = get_alt_labels(alt_labels)
other_labels += cleaned_alt_labels
if inc_labels:
cleaned_inc_labels, label_endswith_included_inc = get_alt_labels(inc_labels)
other_labels += cleaned_inc_labels
# other_labels += cleaned_inc_labels # deactivated 7/2024 in favor of alternative for tagging 'included'

included_detected_comment = "This term has one or more labels that end with ', INCLUDED'."
if label_endswith_included_alt or label_endswith_included_inc:
Expand Down Expand Up @@ -207,6 +211,8 @@ def omim2obo(use_cache: bool = False):
graph.add((omim_uri, oboInOwl.hasExactSynonym, Literal(label_cleaner.clean(exact_label, abbrev))))
for label in other_labels:
graph.add((omim_uri, oboInOwl.hasExactSynonym, Literal(label_cleaner.clean(label, abbrev))))
for included_label in cleaned_inc_labels:
graph.add((omim_uri, URIRef(INCLUDED_URI), Literal(label_cleaner.clean(included_label, abbrev))))

# Gene ID
# Why is 'skos:exactMatch' appropriate for disease::gene relationships? - joeflack4 2022/06/06
Expand Down

0 comments on commit 1623707

Please sign in to comment.