Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Alternative symbol" synonyms & "Formerly" - props rename #168

Open
wants to merge 2 commits into
base: abbrevs-alt-n-included
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions omim2obo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,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(oboInOwl.hasSynonymType), RDF.type, OWL.AnnotationProperty))
graph.add((URIRef(MONDONS.omim_included), RDF.type, OWL.AnnotationProperty))
graph.add((URIRef(MONDONS.includedEntryInOMIM), RDF.type, OWL.AnnotationProperty)) # like an rdfs:label subClass
graph.add((URIRef(OMO['0003000']), RDF.type, OWL.AnnotationProperty))
graph.add((BIOLINK['has_evidence'], RDF.type, OWL.AnnotationProperty))
graph.add((TAX_URI, RDF.type, OWL.Class))
Expand Down Expand Up @@ -245,14 +245,14 @@ def omim2obo(use_cache: bool = False):
for title in former_alt_titles:
clean_title = label_cleaner.clean(title, pref_abbrev)
add_triple_and_optional_annotations(graph, omim_uri, oboInOwl.hasExactSynonym, clean_title)
add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.omim_formerly), clean_title)
add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.omimFormerly), clean_title)
# - related, deprecated 'former' synonyms: abbreviations
for symbol in former_alt_symbols:
add_triple_and_optional_annotations(graph, omim_uri, oboInOwl.hasExactSynonym, symbol,
[(oboInOwl.hasSynonymType, OMO['0003000'])])
# Though these are abbreviations, MONDONS.omim_formerly is not (yet) a synonym
# Though these are abbreviations, MONDONS.omimFormerly is not (yet) a synonym
# type, so can't add axiom: (oboInOwl.hasSynonymType, OMO['0003000'])
add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.omim_formerly), symbol)
add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.omimFormerly), symbol)

# Add 'included' entries
# - comment
Expand All @@ -261,24 +261,23 @@ def omim2obo(use_cache: bool = False):
graph.add((omim_uri, RDFS['comment'], Literal(included_comment)))
# - titles
for title in included_titles:
graph.add((omim_uri, URIRef(MONDONS.omim_included), Literal(label_cleaner.clean(title, pref_abbrev))))
graph.add((omim_uri, URIRef(MONDONS.includedEntryInOMIM), Literal(label_cleaner.clean(title, pref_abbrev))))
# - symbols
for symbol in included_symbols:
add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.omim_included), symbol, [
# Though these are abbreviations, MONDONS.omim_included is not a synonym type, so can't add axiom:
add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.includedEntryInOMIM), symbol, [
# Though these are abbreviations, MONDONS.includedEntryInOMIM is not a synonym type, so can't add axiom:
# (oboInOwl.hasSynonymType, OMO['0003000'])
])
# - deprecated, 'former'
for title in former_included_titles:
clean_title = label_cleaner.clean(title, pref_abbrev)
add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.omim_included), clean_title)
add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.omim_formerly), clean_title)
add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.includedEntryInOMIM), clean_title)
add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.omimFormerly), clean_title)
for symbol in former_included_symbols:
# Though these are abbreviations, MONDONS.omim_included and MONDONS.omim_formerly is not (yet) a synonym
# Though these are abbreviations, MONDONS.includedEntryInOMIM & MONDONS.omimFormerly is not (yet) a synonym
# type, so can't add axiom: (oboInOwl.hasSynonymType, OMO['0003000'])
add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.omim_included), symbol)
add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.omim_formerly), symbol)

add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.includedEntryInOMIM), symbol)
add_triple_and_optional_annotations(graph, omim_uri, URIRef(MONDONS.omimFormerly), symbol)

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