From 5ff90f7319d66dfd2e4acd4ba35d3464d2e58e04 Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Mon, 22 Jul 2024 18:51:05 +0300 Subject: [PATCH 1/3] Annotate included synonyms using a different property --- omim2obo/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/omim2obo/main.py b/omim2obo/main.py index 644a338..bc3cc2f 100644 --- a/omim2obo/main.py +++ b/omim2obo/main.py @@ -171,7 +171,7 @@ def omim2obo(use_cache: bool = False): 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 included_detected_comment = "This term has one or more labels that end with ', INCLUDED'." if label_endswith_included_alt or label_endswith_included_inc: @@ -207,6 +207,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('http://purl.obolibrary.org/obo/mondo#omim_included'), Literal(label_cleaner.clean(included_label, abbrev)))) # Gene ID # Why is 'skos:exactMatch' appropriate for disease::gene relationships? - joeflack4 2022/06/06 From 0f7c99c228f6769187eef8b2afc6e4806766c839 Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Mon, 22 Jul 2024 19:12:17 +0300 Subject: [PATCH 2/3] Adding omim_included annotation property --- omim2obo/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/omim2obo/main.py b/omim2obo/main.py index bc3cc2f..551ccd6 100644 --- a/omim2obo/main.py +++ b/omim2obo/main.py @@ -139,6 +139,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))) From 54e4426bcfc33b077db4c9e7ef6ef5a1f3c1e38a Mon Sep 17 00:00:00 2001 From: Joe Flack Date: Tue, 23 Jul 2024 17:04:11 -0400 Subject: [PATCH 3/3] omim_included - Bugfix: Var referenced before assignment - Minor codestyle updates and comments --- omim2obo/main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/omim2obo/main.py b/omim2obo/main.py index 551ccd6..0b0064b 100644 --- a/omim2obo/main.py +++ b/omim2obo/main.py @@ -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 @@ -166,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: @@ -209,7 +212,7 @@ def omim2obo(use_cache: bool = False): 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('http://purl.obolibrary.org/obo/mondo#omim_included'), Literal(label_cleaner.clean(included_label, abbrev)))) + 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