From 951dbd8043d89290086df78deaf6202c98ebe4be Mon Sep 17 00:00:00 2001 From: Ben Gyori Date: Wed, 7 Jul 2021 15:47:57 -0400 Subject: [PATCH 1/4] Flip child/parent rel to match convention --- indra/databases/owl_client.py | 10 +- indra/ontology/bio/ontology.py | 2 +- indra/resources/ido.json | 1539 +++++++++++++++++++++++++------- 3 files changed, 1198 insertions(+), 353 deletions(-) diff --git a/indra/databases/owl_client.py b/indra/databases/owl_client.py index 267f3205b5..22cedf671c 100644 --- a/indra/databases/owl_client.py +++ b/indra/databases/owl_client.py @@ -35,12 +35,12 @@ def entry_from_term( continue else: xrefs.append(dict(namespace=xref_db, id=xref_id)) - for child in term.subclasses(distance=1, with_self=False): - child_db, child_id = child.id.split(':', maxsplit=1) - if remove_prefix and child_db.lower() == prefix.lower(): - rels_dict["is_a"].append(child_id) + for parent in term.superclasses(distance=1, with_self=False): + parent_db, parent_id = parent.id.split(':', maxsplit=1) + if remove_prefix and parent_db.lower() == prefix.lower(): + rels_dict["is_a"].append(parent_id) else: - rels_dict["is_a"].append(child.id) + rels_dict["is_a"].append(parent.id) term_ns, term_id = term.id.split(':', maxsplit=1) term_ns = term_ns.lower() diff --git a/indra/ontology/bio/ontology.py b/indra/ontology/bio/ontology.py index 891a7683ed..5b6b13017a 100644 --- a/indra/ontology/bio/ontology.py +++ b/indra/ontology/bio/ontology.py @@ -19,7 +19,7 @@ class BioOntology(IndraOntology): # should be incremented to "force" rebuilding the ontology to be consistent # with the underlying resource files. name = 'bio' - version = '1.13' + version = '1.14' def __init__(self): super().__init__() diff --git a/indra/resources/ido.json b/indra/resources/ido.json index cea8f645d5..dc950371bb 100644 --- a/indra/resources/ido.json +++ b/indra/resources/ido.json @@ -5,31 +5,49 @@ "namespace": "ido", "relations": { "is_a": [ - "0000401", - "0000402", - "0000403" + "BFO:0000023" ] } }, { "id": "0000401", "name": "mutualist role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000400" + ] + } }, { "id": "0000402", "name": "commensal role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000400" + ] + } }, { "id": "0000403", "name": "parasite role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000400" + ] + } }, { "id": "0000404", "name": "infectious agent role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000405" + ] + } }, { "id": "0000405", @@ -37,19 +55,29 @@ "namespace": "ido", "relations": { "is_a": [ - "0000404" + "BFO:0000023" ] } }, { "id": "0000406", "name": "opportunistic infectious disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000452" + ] + } }, { "id": "0000407", "name": "primary infectious disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000452" + ] + } }, { "id": "0000408", @@ -57,38 +85,59 @@ "namespace": "ido", "relations": { "is_a": [ - "0000409", - "0000410", - "0000411", - "0000412", - "0000413" + "0000629" ] } }, { "id": "0000409", "name": "definitive host role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000408" + ] + } }, { "id": "0000410", "name": "intermediate host role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000408" + ] + } }, { "id": "0000411", "name": "paratenic host role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000408" + ] + } }, { "id": "0000412", "name": "dead-end host role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000408" + ] + } }, { "id": "0000413", "name": "parasite host role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000408" + ] + } }, { "id": "0000414", @@ -96,7 +145,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000416" + "0000415" ] } }, @@ -106,14 +155,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0000414" + "0000629" ] } }, { "id": "0000416", "name": "infectious agent carrier role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000414" + ] + } }, { "id": "0000417", @@ -121,8 +175,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000418", - "0000421" + "BFO:0000023" ] } }, @@ -132,20 +185,29 @@ "namespace": "ido", "relations": { "is_a": [ - "0000419", - "0000420" + "0000417" ] } }, { "id": "0000419", "name": "mechanical vector of infectious agent role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000418" + ] + } }, { "id": "0000420", "name": "biological vector of infectious agent role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000418" + ] + } }, { "id": "0000421", @@ -153,30 +215,49 @@ "namespace": "ido", "relations": { "is_a": [ - "0000422", - "0000423" + "0000417" ] } }, { "id": "0000422", "name": "biological vehicle of infectious agent role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000421" + ] + } }, { "id": "0000423", "name": "fomite role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000421" + ] + } }, { "id": "0000424", "name": "reservoir of infectious agent role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000023" + ] + } }, { "id": "0000425", "name": "virulence factor disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000426", @@ -184,8 +265,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000427", - "0000429" + "BFO:0000016" ] } }, @@ -195,39 +275,69 @@ "namespace": "ido", "relations": { "is_a": [ - "0000428" + "0000426" ] } }, { "id": "0000430", "name": "infectious agent portal of entry role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000023" + ] + } }, { "id": "0000431", "name": "infectious agent portal of exit role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000023" + ] + } }, { "id": "0000432", "name": "disinfectant role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000023" + ] + } }, { "id": "0000433", "name": "antiseptic role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000023" + ] + } }, { "id": "0000434", "name": "primary infection role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000023" + ] + } }, { "id": "0000435", "name": "secondary infection role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000023" + ] + } }, { "id": "0000436", @@ -235,45 +345,79 @@ "namespace": "ido", "relations": { "is_a": [ - "0000568", - "0000653" + "OGMS:0000031" ] } }, { "id": "0000437", "name": "adhesion disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000438", "name": "invasion disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000439", "name": "antimicrobial disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000440", "name": "antiviral disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000441", "name": "antifungal disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000442", "name": "antibacterial disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000443", "name": "antiparasitic disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000444", @@ -281,8 +425,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000445", - "0000446" + "BFO:0000016" ] } }, @@ -292,7 +435,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000581" + "0000444" ] } }, @@ -302,15 +445,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0000448", - "0000587" + "0000444" ] } }, { "id": "0000447", "name": "herd immunity to infectious organism", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000588" + ] + } }, { "id": "0000448", @@ -318,19 +465,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0000449", - "0000576", - "0000578", - "0000579", - "0000580", - "0000621" + "0000446" ] } }, { "id": "0000449", "name": "sterilizing immunity to infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000448" + ] + } }, { "id": "0000450", @@ -338,15 +485,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0000452", - "0000666" + "BFO:0000016" ] } }, { "id": "0000451", "name": "invasive disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000452", @@ -354,23 +505,29 @@ "namespace": "ido", "relations": { "is_a": [ - "0000406", - "0000407", - "0000453", - "0000454", - "0000623" + "0000450" ] } }, { "id": "0000453", "name": "zoonotic disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000452" + ] + } }, { "id": "0000454", "name": "reverse zoonotic disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000452" + ] + } }, { "id": "0000455", @@ -378,8 +535,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000585", - "0000588" + "BFO:0000016" ] } }, @@ -389,24 +545,39 @@ "namespace": "ido", "relations": { "is_a": [ - "0001005" + "OBI:0100026" ] } }, { "id": "0000457", "name": "immunocompetent organism", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "OBI:0100026" + ] + } }, { "id": "0000458", "name": "contagiousness", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000459", "name": "colonized host", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "OBI:0100026" + ] + } }, { "id": "0000460", @@ -414,29 +585,49 @@ "namespace": "ido", "relations": { "is_a": [ - "0000461" + "OBI:0100026" ] } }, { "id": "0000461", "name": "co-infected organism", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000460" + ] + } }, { "id": "0000463", "name": "infectious agent transmissibility", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000019" + ] + } }, { "id": "0000464", "name": "infectivity", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000019" + ] + } }, { "id": "0000466", "name": "virulence", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000019" + ] + } }, { "id": "0000467", @@ -444,15 +635,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0000468", - "0000469" + "BFO:0000019" ] } }, { "id": "0000468", "name": "susceptibility to infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000467" + ] + } }, { "id": "0000469", @@ -460,19 +655,29 @@ "namespace": "ido", "relations": { "is_a": [ - "0000470" + "0000467" ] } }, { "id": "0000470", "name": "drug susceptibility of infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000469" + ] + } }, { "id": "0000471", "name": "complex infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000472", @@ -480,20 +685,29 @@ "namespace": "ido", "relations": { "is_a": [ - "0000505", - "0000506" + "0000586" ] } }, { "id": "0000473", "name": "intracellular infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000474", "name": "systemic infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000475", @@ -501,39 +715,69 @@ "namespace": "ido", "relations": { "is_a": [ - "0000476" + "0000586" ] } }, { "id": "0000476", "name": "focal infection", - "namespace": "ido" - }, - { - "id": "0000477", + "namespace": "ido", + "relations": { + "is_a": [ + "0000475" + ] + } + }, + { + "id": "0000477", "name": "acute infectious disease course", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000495" + ] + } }, { "id": "0000479", "name": "infectious disease incidence", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000019" + ] + } }, { "id": "0000480", "name": "infection incidence", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000019" + ] + } }, { "id": "0000481", "name": "infectious disease incidence proportion", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000019" + ] + } }, { "id": "0000482", "name": "infection incidence proportion", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000019" + ] + } }, { "id": "0000483", @@ -541,14 +785,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0000492" + "BFO:0000019" ] } }, { "id": "0000484", "name": "infection incidence rate", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000019" + ] + } }, { "id": "0000485", @@ -556,29 +805,49 @@ "namespace": "ido", "relations": { "is_a": [ - "0000491" + "BFO:0000019" ] } }, { "id": "0000486", "name": "infection prevalence", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000019" + ] + } }, { "id": "0000487", "name": "infectious disease lifetime prevalence", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000019" + ] + } }, { "id": "0000488", "name": "infectious agent seroprevalence", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000019" + ] + } }, { "id": "0000489", "name": "infectious disease mortality rate", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000019" + ] + } }, { "id": "0000490", @@ -586,29 +855,49 @@ "namespace": "ido", "relations": { "is_a": [ - "0000493" + "BFO:0000019" ] } }, { "id": "0000491", "name": "infectious disease endemic level", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000485" + ] + } }, { "id": "0000492", "name": "infectious disease endemic rate", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000483" + ] + } }, { "id": "0000493", "name": "infectious disease hyper-endemicity", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000490" + ] + } }, { "id": "0000494", "name": "infectious disease sporadicity", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000019" + ] + } }, { "id": "0000495", @@ -616,15 +905,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0000477", - "0000590" + "OGMS:0000063" ] } }, { "id": "0000496", "name": "long-term non-progressing infectious disease course", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000590" + ] + } }, { "id": "0000497", @@ -632,8 +925,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000498", - "0000501" + "BFO:0000015" ] } }, @@ -643,35 +935,59 @@ "namespace": "ido", "relations": { "is_a": [ - "0000499", - "0000500" + "0000497" ] } }, { "id": "0000499", "name": "vaccination against infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000498" + ] + } }, { "id": "0000500", "name": "variolation", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000498" + ] + } }, { "id": "0000501", "name": "passive immunization against infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000497" + ] + } }, { "id": "0000502", "name": "infectious disease epidemic", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000015" + ] + } }, { "id": "0000503", "name": "infectious disease pandemic", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000015" + ] + } }, { "id": "0000504", @@ -679,26 +995,40 @@ "namespace": "ido", "relations": { "is_a": [ - "0000566", - "0000567", - "0000627" + "0000586", + "OGMS:0000045" ] } }, { "id": "0000505", "name": "viremia", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000472" + ] + } }, { "id": "0000506", "name": "bacteremia", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000472" + ] + } }, { "id": "0000508", "name": "virion", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "NCBITaxon:10239" + ] + } }, { "id": "0000509", @@ -706,50 +1036,79 @@ "namespace": "ido", "relations": { "is_a": [ - "0000511", - "0000512", - "0000513", - "0000514", - "0000515", - "0000592", - "0000615" + "BFO:0000027" ] } }, { "id": "0000511", "name": "infected population", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000509" + ] + } }, { "id": "0000512", "name": "diseased population", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000509" + ] + } }, { "id": "0000513", "name": "infectious agent population", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000509" + ] + } }, { "id": "0000514", "name": "susceptible population", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000509" + ] + } }, { "id": "0000515", "name": "normal resident microbiota population", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000509" + ] + } }, { "id": "0000519", "name": "incubation period", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000038" + ] + } }, { "id": "0000520", "name": "communicability period", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000038" + ] + } }, { "id": "0000522", @@ -757,32 +1116,49 @@ "namespace": "ido", "relations": { "is_a": [ - "0000523", - "0000524", - "0000525", - "0000526" + "OBI:0100026" ] } }, { "id": "0000523", "name": "obligatory symbiont", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000522" + ] + } }, { "id": "0000524", "name": "mutualist", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000522" + ] + } }, { "id": "0000525", "name": "commensal", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000522" + ] + } }, { "id": "0000526", "name": "parasite", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000522" + ] + } }, { "id": "0000528", @@ -790,14 +1166,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0000596" + "BFO:0000040" ] } }, { "id": "0000530", "name": "primary pathogen", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000596" + ] + } }, { "id": "0000531", @@ -805,39 +1186,59 @@ "namespace": "ido", "relations": { "is_a": [ - "0000532", - "0000533", - "0000534", - "0000535", - "0000536", - "0000538" + "OBI:0100026" ] } }, { "id": "0000532", "name": "definitive host", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000531" + ] + } }, { "id": "0000533", "name": "intermediate host", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000531" + ] + } }, { "id": "0000534", "name": "paratenic host", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000531" + ] + } }, { "id": "0000535", "name": "dead-end host", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000531" + ] + } }, { "id": "0000536", "name": "parasite host", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000531" + ] + } }, { "id": "0000537", @@ -845,9 +1246,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000539", - "0000569", - "0000573" + "0000538" ] } }, @@ -857,7 +1256,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000537" + "0000531" ] } }, @@ -867,7 +1266,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000572" + "0000537" ] } }, @@ -877,20 +1276,29 @@ "namespace": "ido", "relations": { "is_a": [ - "0000541", - "0000542" + "OBI:0100026" ] } }, { "id": "0000541", "name": "mechanical vector of infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000540" + ] + } }, { "id": "0000542", "name": "biological vector of infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000540" + ] + } }, { "id": "0000543", @@ -898,29 +1306,49 @@ "namespace": "ido", "relations": { "is_a": [ - "0000544" + "BFO:0000040" ] } }, { "id": "0000544", "name": "fomite", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000543" + ] + } }, { "id": "0000545", "name": "infectious agent reservoir", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000040" + ] + } }, { "id": "0000547", "name": "virulence factor", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "CHEBI:23367" + ] + } }, { "id": "0000548", "name": "invasion factor", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "CHEBI:23367" + ] + } }, { "id": "0000549", @@ -928,10 +1356,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000550", - "0000552", - "0000584", - "0000632" + "CHEBI:23367" ] } }, @@ -941,44 +1366,79 @@ "namespace": "ido", "relations": { "is_a": [ - "0000551" + "0000549" ] } }, { "id": "0000551", "name": "enterotoxin", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000550" + ] + } }, { "id": "0000552", "name": "endotoxin", - "namespace": "ido" - }, - { - "id": "0000553", - "name": "infectious agent portal of entry", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000549" + ] + } + }, + { + "id": "0000553", + "name": "infectious agent portal of entry", + "namespace": "ido", + "relations": { + "is_a": [ + "CARO:0000000" + ] + } }, { "id": "0000554", "name": "infectious agent portal of exit", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "CARO:0000000" + ] + } }, { "id": "0000555", "name": "disinfectant", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000040" + ] + } }, { "id": "0000556", "name": "antiseptic", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000040" + ] + } }, { "id": "0000557", "name": "adhesion factor", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "CHEBI:23367" + ] + } }, { "id": "0000558", @@ -986,8 +1446,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000563", - "0000565" + "BFO:0000040" ] } }, @@ -997,124 +1456,239 @@ "namespace": "ido", "relations": { "is_a": [ - "0000564" + "BFO:0000040" ] } }, { "id": "0000560", "name": "antifungal", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000040" + ] + } }, { "id": "0000561", "name": "antiparasitic", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000040" + ] + } }, { "id": "0000562", "name": "antibacterial", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000040" + ] + } }, { "id": "0000563", "name": "microbicide", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000558" + ] + } }, { "id": "0000564", "name": "viricide", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000559" + ] + } }, { "id": "0000565", "name": "microbistatic", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000558" + ] + } }, { "id": "0000566", "name": "primary infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000504" + ] + } }, { "id": "0000567", "name": "secondary infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000504" + ] + } }, { "id": "0000568", "name": "zoonosis", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000436" + ] + } }, { "id": "0000569", "name": "asymptomatic host of infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000537" + ] + } }, { "id": "0000570", "name": "subclinical infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000571", "name": "resistant entity", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000040" + ] + } }, { "id": "0000572", "name": "chronic carrier of infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000539" + ] + } }, { "id": "0000573", "name": "symptomatic host of infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000537" + ] + } }, { "id": "0000576", "name": "innate immunity to infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000448" + ] + } }, { "id": "0000578", "name": "humoral immunity to infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000448" + ] + } }, { "id": "0000579", "name": "leukocyte-mediated immunity to infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000448" + ] + } }, { "id": "0000580", "name": "passive immunity to infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000448" + ] + } }, { "id": "0000581", "name": "antibiotic resistance", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000445" + ] + } }, { "id": "0000582", "name": "long-term non-progressor", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "OBI:0100026" + ] + } }, { "id": "0000583", "name": "emerging pathogen", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000596" + ] + } }, { "id": "0000584", "name": "cytotoxin", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000549" + ] + } }, { "id": "0000585", "name": "collective pathogenic disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000455" + ] + } }, { "id": "0000586", @@ -1122,31 +1696,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0000471", - "0000472", - "0000473", - "0000474", - "0000475", - "0000504", - "0000570", - "0000628", - "0000630", - "0000631", - "0000633", - "0000638", - "0000642", - "0000645", - "0000646", - "0000647", - "0000648", - "0000649" + "BFO:0000040" ] } }, { "id": "0000587", "name": "genetic resistance to infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000446" + ] + } }, { "id": "0000588", @@ -1154,14 +1716,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0000447" + "0000455" ] } }, { "id": "0000589", "name": "immunodeficient organism", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "OBI:0100026" + ] + } }, { "id": "0000590", @@ -1169,29 +1736,49 @@ "namespace": "ido", "relations": { "is_a": [ - "0000496" + "0000495" ] } }, { "id": "0000592", "name": "immune population", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000509" + ] + } }, { "id": "0000593", "name": "transmission period", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000038" + ] + } }, { "id": "0000594", "name": "direct host exposure to infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000658" + ] + } }, { "id": "0000595", "name": "potential host of infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "OBI:0100026" + ] + } }, { "id": "0000596", @@ -1199,11 +1786,8 @@ "namespace": "ido", "relations": { "is_a": [ - "0000530", - "0000583", - "0000639", - "0000643", - "0000654" + "0000528", + "OBI:0100026" ] } }, @@ -1213,43 +1797,69 @@ "namespace": "ido", "relations": { "is_a": [ - "0000598", - "0000599", - "0000600", - "0000601", - "0000602" + "0000658" ] } }, { "id": "0000598", "name": "host living with infected household contact", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000597" + ] + } }, { "id": "0000599", "name": "host living in endemic area", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000597" + ] + } }, { "id": "0000600", "name": "release of infectious human pathogen in laboratory", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000597" + ] + } }, { "id": "0000601", "name": "host coming into contact with vector of infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000597" + ] + } }, { "id": "0000602", "name": "host exposure to substance that might have infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000597" + ] + } }, { "id": "0000603", "name": "process of establishing an infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000015" + ] + } }, { "id": "0000604", @@ -1257,15 +1867,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0000606", - "0000650" + "0000625" ] } }, { "id": "0000606", "name": "establishment of a clinically abnormal colony", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000604" + ] + } }, { "id": "0000607", @@ -1273,19 +1887,29 @@ "namespace": "ido", "relations": { "is_a": [ - "0000608" + "BFO:0000015" ] } }, { "id": "0000608", "name": "replication", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000607" + ] + } }, { "id": "0000609", "name": "colonization of human anterior nares", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000650" + ] + } }, { "id": "0000610", @@ -1293,16 +1917,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0000611", - "0000612", - "0000644" + "BFO:0000015" ] } }, { "id": "0000611", "name": "physiologic immunosuppression", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000610" + ] + } }, { "id": "0000612", @@ -1310,8 +1937,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0001003", - "0001009" + "0000610" ] } }, @@ -1321,14 +1947,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0000616" + "0000509" ] } }, { "id": "0000616", "name": "infectious agent colony", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000615" + ] + } }, { "id": "0000617", @@ -1336,35 +1967,59 @@ "namespace": "ido", "relations": { "is_a": [ - "0000640", - "0000651" + "OGMS:0000045" ] } }, { "id": "0000618", "name": "immunocompetence", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000619", "name": "immunosuppressive disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000621", "name": "acquired immunity to infectious agent", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000448" + ] + } }, { "id": "0000622", "name": "disposition to form a non-parasitic colony", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000623", "name": "communicability", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000452" + ] + } }, { "id": "0000625", @@ -1372,24 +2027,39 @@ "namespace": "ido", "relations": { "is_a": [ - "0000604" + "GO:0051234" ] } }, { "id": "0000626", "name": "appearance of disorder", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000015" + ] + } }, { "id": "0000627", "name": "acute infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000504" + ] + } }, { "id": "0000628", "name": "chronic infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000629", @@ -1397,35 +2067,59 @@ "namespace": "ido", "relations": { "is_a": [ - "0000408", - "0000415" + "BFO:0000023" ] } }, { "id": "0000630", "name": "hospital-acquired infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000631", "name": "community-acquired infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000632", "name": "neurotoxin", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000549" + ] + } }, { "id": "0000633", "name": "metatstatic infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000635", "name": "source of infection role", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000023" + ] + } }, { "id": "0000636", @@ -1433,69 +2127,129 @@ "namespace": "ido", "relations": { "is_a": [ - "0000637" + "BFO:0000015" ] } }, { "id": "0000637", "name": "severe sepsis", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000636" + ] + } }, { "id": "0000638", "name": "nursing-home acquired infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000639", "name": "infectious human pathogen", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000596" + ] + } }, { "id": "0000640", "name": "acquired immunodeficiency", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000617" + ] + } }, { "id": "0000642", "name": "simple infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000643", "name": "re-emerging pathogen", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000596" + ] + } }, { "id": "0000644", "name": "pregnancy-induced immunosuppression", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000610" + ] + } }, { "id": "0000645", "name": "candidiasis", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000646", "name": "trichomoniasis", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000647", "name": "leptospirosis", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000648", "name": "Shigellosis", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000649", "name": "amebiasis", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000586" + ] + } }, { "id": "0000650", @@ -1503,45 +2257,79 @@ "namespace": "ido", "relations": { "is_a": [ - "0000609", - "0000652" + "0000604" ] } }, { "id": "0000651", "name": "primary immunodeficiency", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000617" + ] + } }, { "id": "0000652", "name": "colonization of human perineum", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000650" + ] + } }, { "id": "0000653", "name": "reverse zoonosis", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000436" + ] + } }, { "id": "0000654", "name": "opportunistic pathogen", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000596" + ] + } }, { "id": "0000655", "name": "transmissibility disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0000656", "name": "horizontal pathogen transmission process", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "TRANS:0000000" + ] + } }, { "id": "0000657", "name": "process that results in death", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000015" + ] + } }, { "id": "0000658", @@ -1549,45 +2337,79 @@ "namespace": "ido", "relations": { "is_a": [ - "0000594", - "0000597" + "BFO:0000015" ] } }, { "id": "0000659", "name": "susceptible organism", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "OBI:0100026" + ] + } }, { "id": "0000662", "name": "life-sustaining process", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "GO:0008150" + ] + } }, { "id": "0000663", "name": "negative regulation of life-sustaining process", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "GO:0065007" + ] + } }, { "id": "0000665", "name": "source of infection", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000040" + ] + } }, { "id": "0000666", "name": "human pathogenicity disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0000450" + ] + } }, { "id": "0000667", "name": "parasitic disposition", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000016" + ] + } }, { "id": "0001002", "name": "transition to clinical abnormality", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "BFO:0000015" + ] + } }, { "id": "0001003", @@ -1595,14 +2417,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0001004" + "0000612" ] } }, { "id": "0001004", "name": "HIV-based immunosuppression", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0001003" + ] + } }, { "id": "0001005", @@ -1610,8 +2437,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0001006", - "0001011" + "0000456" ] } }, @@ -1621,7 +2447,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0001007" + "0001005" ] } }, @@ -1631,14 +2457,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0001008" + "0001006" ] } }, { "id": "0001008", "name": "immunosuppressed human experiencing HIV-based immunosuppression", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0001007" + ] + } }, { "id": "0001009", @@ -1646,14 +2477,19 @@ "namespace": "ido", "relations": { "is_a": [ - "0001010" + "0000612" ] } }, { "id": "0001010", "name": "chronic systemic steroid use-based immunosuppression", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0001009" + ] + } }, { "id": "0001011", @@ -1661,8 +2497,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0001012", - "0001014" + "0001005" ] } }, @@ -1672,18 +2507,28 @@ "namespace": "ido", "relations": { "is_a": [ - "0001013" + "0001011" ] } }, { "id": "0001013", "name": "immunosuppressed human experiencing chronic systemic steroid use-based immunosuppression", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0001012" + ] + } }, { "id": "0001014", "name": "immunosuppressed human experiencing drug-based immunosuppression due to organ transplant", - "namespace": "ido" + "namespace": "ido", + "relations": { + "is_a": [ + "0001011" + ] + } } ] \ No newline at end of file From efe17d99a332a679009efd0a24be99de4c129543 Mon Sep 17 00:00:00 2001 From: Ben Gyori Date: Wed, 7 Jul 2021 16:11:38 -0400 Subject: [PATCH 2/4] Generalize handling outside ns for isa edges --- indra/ontology/bio/ontology.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/indra/ontology/bio/ontology.py b/indra/ontology/bio/ontology.py index 5b6b13017a..d5750f179a 100644 --- a/indra/ontology/bio/ontology.py +++ b/indra/ontology/bio/ontology.py @@ -187,10 +187,11 @@ def add_obo_nodes(self): oc = obo_client.OntologyClient(prefix=ns) for db_id, entry in oc.entries.items(): label = self.label(ns.upper(), db_id) - # There may be more general ways of doing this but this - # handles the special case of BFO nodes in the EFO - # ontology. - if ns == 'efo' and db_id.startswith('BFO'): + # Here we handle and isa relationships that point + # to an entry outside this ontology. The logic for recognizing + # these here is: if there is a : in the ID but the prefix is + # not for this namespace then we assume it's another namespace + if ':' in db_id and not db_id.startswith(ns.upper()): label = db_id nodes.append((label, {'name': entry['name']})) @@ -227,13 +228,15 @@ def add_obo_hierarchies(self): mapped_rel = rel_mappings.get(rel) if not mapped_rel: continue - source_label = self.label(ns.upper(), db_id) - if ns == 'efo' and db_id.startswith('BFO'): + if ':' in db_id and not db_id.startswith(ns.upper()): source_label = db_id + else: + source_label = self.label(ns.upper(), db_id) for target in targets: - target_label = self.label(ns.upper(), target) - if ns == 'efo' and target.startswith('BFO'): + if ':' in target and not target.startswith(ns.upper()): target_label = target + else: + target_label = self.label(ns.upper(), target) if rel in reverse_rel: av = (target_label, source_label, From f2a2963c115fd7488c899aeb6c1860561c1a07d8 Mon Sep 17 00:00:00 2001 From: Ben Gyori Date: Wed, 7 Jul 2021 17:15:44 -0400 Subject: [PATCH 3/4] Implement allowed external ns for OWL client --- indra/databases/owl_client.py | 10 +- indra/resources/ido.json | 713 +++++----------------------------- 2 files changed, 112 insertions(+), 611 deletions(-) diff --git a/indra/databases/owl_client.py b/indra/databases/owl_client.py index 22cedf671c..84b3c5747f 100644 --- a/indra/databases/owl_client.py +++ b/indra/databases/owl_client.py @@ -5,7 +5,7 @@ import pickle from collections import defaultdict from operator import itemgetter -from typing import Any, Mapping, TYPE_CHECKING +from typing import Any, Collection, Mapping, TYPE_CHECKING from tqdm import tqdm @@ -24,6 +24,7 @@ def entry_from_term( term: "pronto.Term", prefix: str, remove_prefix: bool = False, + allowed_external_ns: Collection = None, ) -> Mapping[str, Any]: """Create a data dictionary from a Pronto term.""" rels_dict = defaultdict(list) @@ -37,6 +38,12 @@ def entry_from_term( xrefs.append(dict(namespace=xref_db, id=xref_id)) for parent in term.superclasses(distance=1, with_self=False): parent_db, parent_id = parent.id.split(':', maxsplit=1) + # If the parent here is not from this namespace and not one of the + # allowed external namespaces then we skip the parent + if parent_db.lower() != prefix.lower() and \ + (not allowed_external_ns or + parent_db not in allowed_external_ns): + continue if remove_prefix and parent_db.lower() == prefix.lower(): rels_dict["is_a"].append(parent_id) else: @@ -62,6 +69,7 @@ def entries_from_ontology( *, skip_obsolete: bool = True, remove_prefix: bool = False, + allowed_external_ns: Collection = None, ): prefix = prefix.upper() rv = [] diff --git a/indra/resources/ido.json b/indra/resources/ido.json index dc950371bb..9c64a633ea 100644 --- a/indra/resources/ido.json +++ b/indra/resources/ido.json @@ -2,12 +2,7 @@ { "id": "0000400", "name": "symbiont role", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000023" - ] - } + "namespace": "ido" }, { "id": "0000401", @@ -52,12 +47,7 @@ { "id": "0000405", "name": "pathogen role", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000023" - ] - } + "namespace": "ido" }, { "id": "0000406", @@ -172,12 +162,7 @@ { "id": "0000417", "name": "infectious agent transporter role", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000023" - ] - } + "namespace": "ido" }, { "id": "0000418", @@ -242,32 +227,17 @@ { "id": "0000424", "name": "reservoir of infectious agent role", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000023" - ] - } + "namespace": "ido" }, { "id": "0000425", "name": "virulence factor disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000426", "name": "toxin disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000427", @@ -282,152 +252,77 @@ { "id": "0000430", "name": "infectious agent portal of entry role", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000023" - ] - } + "namespace": "ido" }, { "id": "0000431", "name": "infectious agent portal of exit role", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000023" - ] - } + "namespace": "ido" }, { "id": "0000432", "name": "disinfectant role", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000023" - ] - } + "namespace": "ido" }, { "id": "0000433", "name": "antiseptic role", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000023" - ] - } + "namespace": "ido" }, { "id": "0000434", "name": "primary infection role", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000023" - ] - } + "namespace": "ido" }, { "id": "0000435", "name": "secondary infection role", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000023" - ] - } + "namespace": "ido" }, { "id": "0000436", "name": "infectious disease", - "namespace": "ido", - "relations": { - "is_a": [ - "OGMS:0000031" - ] - } + "namespace": "ido" }, { "id": "0000437", "name": "adhesion disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000438", "name": "invasion disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000439", "name": "antimicrobial disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000440", "name": "antiviral disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000441", "name": "antifungal disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000442", "name": "antibacterial disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000443", "name": "antiparasitic disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000444", "name": "protective resistance", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000445", @@ -482,22 +377,12 @@ { "id": "0000450", "name": "pathogenic disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000451", "name": "invasive disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000452", @@ -532,62 +417,32 @@ { "id": "0000455", "name": "collective disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000456", "name": "immunosuppressed organism", - "namespace": "ido", - "relations": { - "is_a": [ - "OBI:0100026" - ] - } + "namespace": "ido" }, { "id": "0000457", "name": "immunocompetent organism", - "namespace": "ido", - "relations": { - "is_a": [ - "OBI:0100026" - ] - } + "namespace": "ido" }, { "id": "0000458", "name": "contagiousness", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000459", "name": "colonized host", - "namespace": "ido", - "relations": { - "is_a": [ - "OBI:0100026" - ] - } + "namespace": "ido" }, { "id": "0000460", "name": "infected organism", - "namespace": "ido", - "relations": { - "is_a": [ - "OBI:0100026" - ] - } + "namespace": "ido" }, { "id": "0000461", @@ -602,42 +457,22 @@ { "id": "0000463", "name": "infectious agent transmissibility", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000464", "name": "infectivity", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000466", "name": "virulence", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000467", "name": "susceptibility", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000468", @@ -742,122 +577,62 @@ { "id": "0000479", "name": "infectious disease incidence", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000480", "name": "infection incidence", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000481", "name": "infectious disease incidence proportion", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000482", "name": "infection incidence proportion", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000483", "name": "infectious disease incidence rate", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000484", "name": "infection incidence rate", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000485", "name": "infectious disease prevalence", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000486", "name": "infection prevalence", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000487", "name": "infectious disease lifetime prevalence", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000488", "name": "infectious agent seroprevalence", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000489", "name": "infectious disease mortality rate", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000490", "name": "infectious disease endemicity", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000491", @@ -892,22 +667,12 @@ { "id": "0000494", "name": "infectious disease sporadicity", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000019" - ] - } + "namespace": "ido" }, { "id": "0000495", "name": "infectious disease course", - "namespace": "ido", - "relations": { - "is_a": [ - "OGMS:0000063" - ] - } + "namespace": "ido" }, { "id": "0000496", @@ -922,12 +687,7 @@ { "id": "0000497", "name": "immunization against infectious agent", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000015" - ] - } + "namespace": "ido" }, { "id": "0000498", @@ -972,22 +732,12 @@ { "id": "0000502", "name": "infectious disease epidemic", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000015" - ] - } + "namespace": "ido" }, { "id": "0000503", "name": "infectious disease pandemic", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000015" - ] - } + "namespace": "ido" }, { "id": "0000504", @@ -995,8 +745,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000586", - "OGMS:0000045" + "0000586" ] } }, @@ -1023,22 +772,12 @@ { "id": "0000508", "name": "virion", - "namespace": "ido", - "relations": { - "is_a": [ - "NCBITaxon:10239" - ] - } + "namespace": "ido" }, { "id": "0000509", "name": "organism population", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000027" - ] - } + "namespace": "ido" }, { "id": "0000511", @@ -1093,32 +832,17 @@ { "id": "0000519", "name": "incubation period", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000038" - ] - } + "namespace": "ido" }, { "id": "0000520", "name": "communicability period", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000038" - ] - } + "namespace": "ido" }, { "id": "0000522", "name": "symbiont", - "namespace": "ido", - "relations": { - "is_a": [ - "OBI:0100026" - ] - } + "namespace": "ido" }, { "id": "0000523", @@ -1163,12 +887,7 @@ { "id": "0000528", "name": "pathogen", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000040" - ] - } + "namespace": "ido" }, { "id": "0000530", @@ -1183,12 +902,7 @@ { "id": "0000531", "name": "host", - "namespace": "ido", - "relations": { - "is_a": [ - "OBI:0100026" - ] - } + "namespace": "ido" }, { "id": "0000532", @@ -1273,12 +987,7 @@ { "id": "0000540", "name": "infectious agent vector", - "namespace": "ido", - "relations": { - "is_a": [ - "OBI:0100026" - ] - } + "namespace": "ido" }, { "id": "0000541", @@ -1303,12 +1012,7 @@ { "id": "0000543", "name": "vehicle of infectious agent", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000040" - ] - } + "namespace": "ido" }, { "id": "0000544", @@ -1323,42 +1027,22 @@ { "id": "0000545", "name": "infectious agent reservoir", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000040" - ] - } + "namespace": "ido" }, { "id": "0000547", "name": "virulence factor", - "namespace": "ido", - "relations": { - "is_a": [ - "CHEBI:23367" - ] - } + "namespace": "ido" }, { "id": "0000548", "name": "invasion factor", - "namespace": "ido", - "relations": { - "is_a": [ - "CHEBI:23367" - ] - } + "namespace": "ido" }, { "id": "0000549", "name": "toxin", - "namespace": "ido", - "relations": { - "is_a": [ - "CHEBI:23367" - ] - } + "namespace": "ido" }, { "id": "0000550", @@ -1393,102 +1077,52 @@ { "id": "0000553", "name": "infectious agent portal of entry", - "namespace": "ido", - "relations": { - "is_a": [ - "CARO:0000000" - ] - } + "namespace": "ido" }, { "id": "0000554", "name": "infectious agent portal of exit", - "namespace": "ido", - "relations": { - "is_a": [ - "CARO:0000000" - ] - } + "namespace": "ido" }, { "id": "0000555", "name": "disinfectant", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000040" - ] - } + "namespace": "ido" }, { "id": "0000556", "name": "antiseptic", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000040" - ] - } + "namespace": "ido" }, { "id": "0000557", "name": "adhesion factor", - "namespace": "ido", - "relations": { - "is_a": [ - "CHEBI:23367" - ] - } + "namespace": "ido" }, { "id": "0000558", "name": "antimicrobial", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000040" - ] - } + "namespace": "ido" }, { "id": "0000559", "name": "antiviral", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000040" - ] - } + "namespace": "ido" }, { "id": "0000560", "name": "antifungal", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000040" - ] - } + "namespace": "ido" }, { "id": "0000561", "name": "antiparasitic", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000040" - ] - } + "namespace": "ido" }, { "id": "0000562", "name": "antibacterial", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000040" - ] - } + "namespace": "ido" }, { "id": "0000563", @@ -1573,12 +1207,7 @@ { "id": "0000571", "name": "resistant entity", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000040" - ] - } + "namespace": "ido" }, { "id": "0000572", @@ -1653,12 +1282,7 @@ { "id": "0000582", "name": "long-term non-progressor", - "namespace": "ido", - "relations": { - "is_a": [ - "OBI:0100026" - ] - } + "namespace": "ido" }, { "id": "0000583", @@ -1693,12 +1317,7 @@ { "id": "0000586", "name": "infection", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000040" - ] - } + "namespace": "ido" }, { "id": "0000587", @@ -1723,12 +1342,7 @@ { "id": "0000589", "name": "immunodeficient organism", - "namespace": "ido", - "relations": { - "is_a": [ - "OBI:0100026" - ] - } + "namespace": "ido" }, { "id": "0000590", @@ -1753,12 +1367,7 @@ { "id": "0000593", "name": "transmission period", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000038" - ] - } + "namespace": "ido" }, { "id": "0000594", @@ -1773,12 +1382,7 @@ { "id": "0000595", "name": "potential host of infectious agent", - "namespace": "ido", - "relations": { - "is_a": [ - "OBI:0100026" - ] - } + "namespace": "ido" }, { "id": "0000596", @@ -1786,8 +1390,7 @@ "namespace": "ido", "relations": { "is_a": [ - "0000528", - "OBI:0100026" + "0000528" ] } }, @@ -1854,12 +1457,7 @@ { "id": "0000603", "name": "process of establishing an infection", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000015" - ] - } + "namespace": "ido" }, { "id": "0000604", @@ -1884,12 +1482,7 @@ { "id": "0000607", "name": "production", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000015" - ] - } + "namespace": "ido" }, { "id": "0000608", @@ -1914,12 +1507,7 @@ { "id": "0000610", "name": "immunosuppression", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000015" - ] - } + "namespace": "ido" }, { "id": "0000611", @@ -1964,32 +1552,17 @@ { "id": "0000617", "name": "immunodeficiency", - "namespace": "ido", - "relations": { - "is_a": [ - "OGMS:0000045" - ] - } + "namespace": "ido" }, { "id": "0000618", "name": "immunocompetence", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000619", "name": "immunosuppressive disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000621", @@ -2004,12 +1577,7 @@ { "id": "0000622", "name": "disposition to form a non-parasitic colony", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000623", @@ -2024,22 +1592,12 @@ { "id": "0000625", "name": "establishment of localization in host", - "namespace": "ido", - "relations": { - "is_a": [ - "GO:0051234" - ] - } + "namespace": "ido" }, { "id": "0000626", "name": "appearance of disorder", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000015" - ] - } + "namespace": "ido" }, { "id": "0000627", @@ -2064,12 +1622,7 @@ { "id": "0000629", "name": "host role", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000023" - ] - } + "namespace": "ido" }, { "id": "0000630", @@ -2114,22 +1667,12 @@ { "id": "0000635", "name": "source of infection role", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000023" - ] - } + "namespace": "ido" }, { "id": "0000636", "name": "sepsis", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000015" - ] - } + "namespace": "ido" }, { "id": "0000637", @@ -2304,82 +1847,42 @@ { "id": "0000655", "name": "transmissibility disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0000656", "name": "horizontal pathogen transmission process", - "namespace": "ido", - "relations": { - "is_a": [ - "TRANS:0000000" - ] - } + "namespace": "ido" }, { "id": "0000657", "name": "process that results in death", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000015" - ] - } + "namespace": "ido" }, { "id": "0000658", "name": "host exposure to infectious agent", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000015" - ] - } + "namespace": "ido" }, { "id": "0000659", "name": "susceptible organism", - "namespace": "ido", - "relations": { - "is_a": [ - "OBI:0100026" - ] - } + "namespace": "ido" }, { "id": "0000662", "name": "life-sustaining process", - "namespace": "ido", - "relations": { - "is_a": [ - "GO:0008150" - ] - } + "namespace": "ido" }, { "id": "0000663", "name": "negative regulation of life-sustaining process", - "namespace": "ido", - "relations": { - "is_a": [ - "GO:0065007" - ] - } + "namespace": "ido" }, { "id": "0000665", "name": "source of infection", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000040" - ] - } + "namespace": "ido" }, { "id": "0000666", @@ -2394,22 +1897,12 @@ { "id": "0000667", "name": "parasitic disposition", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000016" - ] - } + "namespace": "ido" }, { "id": "0001002", "name": "transition to clinical abnormality", - "namespace": "ido", - "relations": { - "is_a": [ - "BFO:0000015" - ] - } + "namespace": "ido" }, { "id": "0001003", From a5fbf899ed009ed4b67191ab6d478f2631b48711 Mon Sep 17 00:00:00 2001 From: Ben Gyori Date: Wed, 7 Jul 2021 21:35:38 -0400 Subject: [PATCH 4/4] Add test for IDO parents --- indra/tests/make_mock_ontology.py | 2 +- indra/tests/test_ontology.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/tests/make_mock_ontology.py b/indra/tests/make_mock_ontology.py index 14d68b6e01..7baa3508d0 100644 --- a/indra/tests/make_mock_ontology.py +++ b/indra/tests/make_mock_ontology.py @@ -45,7 +45,7 @@ 'CHEBI:CHEBI:136692', 'EGID:1022', 'HGNC:1778', 'CHEMBL:CHEMBL296468', 'UP:P41180', 'MESH:D000077191', 'MESH:C475455', 'MESH:D015032', 'CHEBI:CHEBI:27363', 'CAS:7440-66-6', - 'EGID:673', 'EGID:5594', 'EGID:5595' + 'EGID:673', 'EGID:5594', 'EGID:5595', 'IDO:0000514' } always_include_ns = {'FPLX', 'INDRA_ACTIVITIES', 'INDRA_MODS'} diff --git a/indra/tests/test_ontology.py b/indra/tests/test_ontology.py index cbea671471..986490df5c 100644 --- a/indra/tests/test_ontology.py +++ b/indra/tests/test_ontology.py @@ -331,3 +331,8 @@ def test_standardize_hgnc_fplx_mesh_bug(): assert refs['MESH'] == 'D044169' assert refs['HGNC_GROUP'] == '279' assert 'HGNC' not in refs + + +def test_ido_parents(): + parents = bio_ontology.get_parents('IDO', '0000514') + assert ('IDO', '0000509') in parents \ No newline at end of file