Skip to content

Import 33 MONDO terms for Open Targets Safety 2.0 (refs #2818) - #2820

Closed
ar-ibrahim wants to merge 14 commits into
masterfrom
issue-2818
Closed

ar-ibrahim wants to merge 14 commits into
masterfrom
issue-2818

Conversation

@ar-ibrahim

Copy link
Copy Markdown
Collaborator

Summary

Imports 33 of the 34 MONDO disease terms requested in #2818 for the Open Targets Safety 2.0 project's data annotation work.

This is an imports-only change — no new EFO terms, so efo-edit.owl is untouched and there are no temporary EFO_099xxxx IDs in this PR.

One term was deliberately omitted: MONDO:0003634 proteinuria. See Notes below.

Changes

File Change
src/ontology/iri_dependencies/mondo_terms.txt +33 MONDO IRIs
src/ontology/imports/mondo_terms.txt +34 (derived seed list, regenerated)

imports/mondo_import.owl was rebuilt locally to validate the change but is gitignored, so it is not part of this diff — CI rebuilds it.

The 33 imported terms
MONDO ID Label
MONDO:0000466 first-degree atrioventricular block
MONDO:0000467 second-degree atrioventricular block
MONDO:0000598 aphasia
MONDO:0000705 Clostridium difficile colitis
MONDO:0000755 ectopic pregnancy
MONDO:0001217 pseudomembranous conjunctivitis
MONDO:0001261 Mobitz type II atrioventricular block
MONDO:0001276 expressive language disorder
MONDO:0001339 portal vein thrombosis
MONDO:0001533 pes anserinus tendinitis or bursitis
MONDO:0001882 bacteriuria
MONDO:0001953 pyuria
MONDO:0010096 tardive dyskinesia
MONDO:0011885 tubulointerstitial nephritis and uveitis syndrome
MONDO:0015340 drug rash with eosinophilia and systemic symptoms
MONDO:0015584 febrile infection-related epilepsy syndrome
MONDO:0016010 vitamin K-antagonist embryofetopathy
MONDO:0016098 immune-mediated necrotizing myopathy
MONDO:0017943 autoerythrocyte sensitization syndrome
MONDO:0018824 pyoderma gangrenosum
MONDO:0018835 nodular regenerative hyperplasia of the liver
MONDO:0019204 respiratory bronchiolitis-interstitial lung disease syndrome
MONDO:0019509 cutaneous leukocytoclastic angiitis
MONDO:0019960 VIPoma
MONDO:0024507 aniridia 1
MONDO:0040753 latent tuberculosis infection
MONDO:0040871 psychogenic polydipsia
MONDO:0043726 multiple organ dysfunction syndrome
MONDO:0043789 serum sickness
MONDO:0100549 focal nodular hyperplasia
MONDO:1010185 transplant rejection
MONDO:1030007 hypertensive urgency
MONDO:1040017 intestinal fistula

Checks

  • All 34 requested IDs verified against OLS — bidirectional ID→label and label→ID match, labels match the ticket exactly
  • No requested term is obsolete or deprecated
  • All 33 imported terms have an asserted subClassOf path to MONDO:0000001 disease in the generated import — the parent requested in the ticket
  • No dangling terms, so no src/templates/subclasses.csv entry required
  • Import regenerated with om make imports/mondo_import.owl --rebuild mirrors,imports — exit 0, no errors
  • Import done via the importer workflow; nothing under imports/ hand-edited
  • om make normalize_src / om reason — not run, and not applicable: efo-edit.owl has no changes in this PR

Notes / open questions

MONDO:0003634 proteinuria was not imported

MONDO_0003634 is listed in src/ontology/iri_dependencies/mondo_exclude.txt (line 3888). The remove-terms step in owlmake.yaml strips it from the built import, so adding it to the seed list has no effect — confirmed empirically (grep -c MONDO_0003634 imports/mondo_import.owl → 0).

This exclusion is deliberate and, as far as I can tell, still correct:

  • mondo_exclude.txt descends from a file originally named mondo_duplicates.txt. The commit that added this entry is 74f8884 (2019-04-12), titled "Updated to work with new MONDO release and fixed duplicate label issue".
  • EFO already carries proteinuria as HP:0000093 "Proteinuria", imported via hp_terms.txt and present in hp_import.owl ("Increased levels of protein in the urine.").
  • MONDO's own class carries an editorial rdfs:comment recommending the HPO term instead.

Recommendation: keep the exclusion and use HP:0000093 for proteinuria annotation in Open Targets Safety 2.0. Removing it would reintroduce the duplicate-label problem it was created to fix. Reviewers who disagree should say so — the alternative is dropping MONDO_0003634 from mondo_exclude.txt and rebuilding.

Incidental line in the derived seed list

imports/mondo_terms.txt gains one line unrelated to this ticket: MONDO_0100100. It was added to the source list by 064b6e5 (refs #2815) without the derived file being regenerated at the time; this rebuild catches it up. Harmless, but flagging it so it isn't a surprise in review.


Refs #2818 — intentionally left open, as the proteinuria part of the request is answered by an existing term rather than by this import.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AWNpNSoJahy3ZtBcMaUstK

jamesamcl and others added 12 commits August 26, 2026 16:04
Plan (owlmake.yaml):
- Add fetch rules for mirror/hpoa.owl and mirror/mondo-owl.owl (the two
  non-import fetches from get_mirrors.sh that had no producer in the plan)
  and register them in the mirrors refresh group, so the d2p components
  build on a fresh clone.
- Delete the two inert rules referencing SPARQL files that do not exist
  (build/fbbt-self-xref.txt, remove-fbbt-self-xref).
- Encode the merged-ontology-removal pipeline for its five instantiable
  ontologies (chebi, cl, fbbt, hp, obi): filtered-X-mirror.owl,
  efo-edit-without-X.owl, remaining-X.ofn, preserve-axioms-X.{ttl,owl}
  and phony dump_X, translated from the deleted Makefile lines 112-141.
- Fix the HGNC auto-exclude echo to read the terms file by its
  root-relative path, so the reported count is no longer empty.

Docs: make .claude/agents/efo-importer.md and
docs/Import_terms_from_another_ontology.md describe the same two-step
import refresh as the .github variants (refresh the mirror explicitly,
then rebuild the import): mirrors are kept by default, so -B on the
import target reuses the on-disk mirror rather than re-fetching it.
Rewrite docs/odk-workflows/components.md for the owlmake build.

Workflows: spell the ID-allocation step om make allocate-definitive-ids;
pin the copilot-setup owlmake download to v0.2.2 instead of latest; drop
qc.yml's stale ODK header and unused DEFAULT_BRANCH.

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1
…s,imports

Validating the previous commit's two-step procedure against om 0.2.2 showed
it does not work: mirrors AND imports are refresh groups the plan keeps by
default, and a kept target is reused even when named explicitly with -B
(om make mirror/hancestro.owl -B and om make imports/hancestro_import.owl -B
both no-op with "pinned (MIR=false)" / "pinned (IMP=false)"). The .github
docs' two-step spelling had the same defect, so all five documents now
describe the one verified command:

    om make imports/<ontology>_import.owl --rebuild mirrors,imports

which re-downloads the plan-named mirror and regenerates the import, touching
only the requested target's closure (verified: re-fetches hancestro.owl and
rewrites hancestro_import.owl byte-identically on an unchanged seed list).
The full-set spelling becomes om make all_imports --rebuild mirrors,imports.

Files: CLAUDE.md, .claude/agents/efo-importer.md,
.github/agents/EFO-importer.md, .github/copilot-instructions.md,
docs/Import_terms_from_another_ontology.md.

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1
EFO and owlmake are developed together, so no environment pins an exact
owlmake release and no two environments follow different lines: the QC and
ID-allocation containers move from the 0.2-python image tag to latest-python,
and the copilot-setup binary download returns to releases/latest, matching
the README's editor install. owlmake.yaml's min_owlmake_version stays as the
floor that fails a build outright if an environment lags it.

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1
The disease-to-phenotype component's hpoa half was built from Monarch's
dipper RDF (data.monarchinitiative.org/ttl/hpoa.ttl), which no longer
exists — the URL 404s and no current Monarch product publishes the OBAN
association model the d2p-hpoa.ru query consumed. Rebuild that half from
the maintained upstream instead: the plan fetches
purl.obolibrary.org/obo/hp/hpoa/phenotype.hpoa (already the IRI the
component stamps as dc:source) into the mirrors group, and a new
stdlib-only repo script, src/scripts/hpoa_to_d2p.py, converts it to the
same Turtle shape the MONDO half produces: disease skos:related
phenotype with a reified axiom per pair. ORPHA ids map to ORDO IRIs
(the form EFO's disease branch carries, matching the 77k Orphanet
axioms in the committed component); OMIM and DECIPHER map to their
entry URLs; NOT-qualified rows are excluded; all aspects are kept,
matching the inheritance terms present in the committed component.
d2p-hpoa.ru is deleted with the OBAN model it queried, and
get_mirrors.sh goes too — every fetch it performed is now a plan rule,
and its hpoa line was the dead URL.

Verified with om 0.2.2: om make components/d2p_hpoa.ttl fetches
phenotype.hpoa (35 MB) and writes 284,267 distinct disease-phenotype
pairs (128 MB Turtle), which om convert parses and maps to axioms
cleanly in 26s.

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1
The previous fix rewrote the wc path inside the HGNC auto-exclude echo to
src/ontology/imports/mondo_import.owl.hgnc.txt on the reasoning that every
other plan path is repo-root-relative. Shell steps in the import pipeline
run from src/ontology, and text inside a command substitution is passed to
the shell verbatim, so the rewrite broke the very count it meant to fix.

Measured with om 0.2.2 on om make imports/mondo_import.owl: the rewritten
path prints "sh: cannot open src/ontology/imports/mondo_import.owl.hgnc.txt:
No such file" and an empty count (also observed in CI run 32986716429);
restored to imports/mondo_import.owl.hgnc.txt it prints "Auto-excluding
3606 HGNC terms from mondo import".

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1
Port Arwa's two white matter rarefaction terms from efo-4 to master
…2815)

MONDO 2026-09-01 obsoleted MONDO_0019398 (desmin-related myopathy with
Mallory body-like inclusions) with replacement MONDO_0100100 (congenital
myopathy 3 with rigid spine). check_mondo_obsoletes failed on master
because the replacement was not in mondo_terms.txt. Import it, repoint
the IAO_0100001 / reason_for_obsolescence on obsolete Orphanet_84132 to
the live term, and refresh the obsolete-check report.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Import MONDO_0100100, replacement for obsoleted MONDO_0019398 (fixes check_mondo_obsoletes on master)
Adds 33 of the 34 requested MONDO disease terms to the import seed list
and regenerates the derived seed file. All terms were verified against
OLS (bidirectional ID/label match), none are obsolete, and all resolve
to MONDO:0000001 'disease' via MONDO's own hierarchy in the generated
import - so no subclasses.csv entry or efo-edit.owl change is needed.

MONDO:0003634 'proteinuria' is deliberately omitted. It is listed in
mondo_exclude.txt as a duplicate label: EFO already carries proteinuria
as HP:0000093, imported via hp_terms.txt. MONDO's own class also carries
an editorial comment recommending the HPO term instead. Requesters
should use HP:0000093 for proteinuria annotation.

The derived imports/mondo_terms.txt additionally picks up MONDO_0100100,
added to the source list by 064b6e5 (refs #2815) without the derived
file being regenerated at the time.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01AWNpNSoJahy3ZtBcMaUstK
ar-ibrahim and others added 2 commits September 13, 2026 21:43
…2818)

Fixes a nolabels-violation QC failure introduced by the MONDO import in
7546782. MONDO:0001339 "portal vein thrombosis" asserts
RO_0004026 (disease has location) some UBERON:0002017, but the portal
vein was not on EFO's UBERON seed list, so the merged ontology carried a
bare class declaration with no rdfs:label.

UBERON:0002017 was verified bidirectionally against OLS (label "portal
vein", not obsolete) and added to the UBERON seed list; the import was
regenerated with om make imports/uberon_import.owl --rebuild
mirrors,imports.

The regenerated import also reparents UBERON:0001639 "hepatic portal
vein" from UBERON:0001638 (vein) to UBERON:0002017 (portal vein). That
is BOT extraction no longer having to lift it to the nearest available
ancestor, and matches UBERON's asserted hierarchy.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01AWNpNSoJahy3ZtBcMaUstK
… (refs #2818)

Fixes a duplicate-label QC failure introduced by the MONDO import in
7546782. The native EFO term and the newly imported MONDO:0018824 both
carried the label "pyoderma gangrenosum".

Resolved by obsoleting the EFO term in favour of the Mondo one:
  - label prefixed with obsolete_
  - owl:deprecated true
  - obsoleted_in_version 3.94.0 (next minor after the current 3.93.0)
  - reason_for_obsolescence and IAO_0100001 pointing at MONDO:0018824
  - all logical axioms removed (both subClassOf parents and the
    RO_0002314 some UBERON_0000014 restriction)

The definition, original IAO_0000117 author annotation and all seven
xrefs are retained, matching the convention of the existing obsolete
terms in this file. No axiom elsewhere in efo-edit.owl referenced
EFO_0006835, and it does not appear in subclasses.csv, so nothing needed
rewiring.

Note: EFO_0006835 is flagged gwas_trait "true" in the generated
components/gwas_import.owl, which is driven by iri_dependencies/
gwas_terms.tsv and is not updated by obsoletion. 990 previously
obsoleted EFO terms are in the same state, so this follows existing
practice rather than introducing a new gap.

Verified with om make qc: all four checks pass (sparql_test with 11/11
rules clean, all_reports, label_synonym_dup_check, check_mondo_obsoletes),
plus om make normalize_src and om reason -r ELK.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01AWNpNSoJahy3ZtBcMaUstK
@ar-ibrahim

Copy link
Copy Markdown
Collaborator Author

Two CI failures fixed — 2 new commits

The ontology_qc failure on the first commit reported 3 violations across 2 rules. Both are now fixed. Note the PR description above is out of date — it predates these commits and still describes CI as red.

Commit Fix
294b8390 nolabels-violation — imports UBERON:0002017 portal vein
4ce89341 duplicate-label-violation — obsoletes EFO_0006835 in favour of MONDO:0018824

Both failures were introduced by this PR; master was green before it.

1. UBERON:0002017 portal vein (294b8390)

MONDO:0001339 "portal vein thrombosis", one of the 33 imported terms, asserts RO_0004026 (disease has location) some UBERON:0002017. The portal vein was not on EFO's UBERON seed list, so the merged ontology carried a bare class declaration with no rdfs:label, which nolabels-violation.sparql rejects.

Verified bidirectionally against OLS (label "portal vein", not obsolete), added to iri_dependencies/uberon_terms.txt, import regenerated.

The regenerated import also reparents UBERON:0001639 "hepatic portal vein" from UBERON:0001638 (vein) to UBERON:0002017 (portal vein). That is BOT extraction no longer having to lift it to the nearest available ancestor — it matches UBERON's asserted hierarchy, so it is a correction rather than a regression.

2. pyoderma gangrenosum duplicate label (4ce89341)

Native EFO_0006835 and the newly imported MONDO:0018824 both carried the label "pyoderma gangrenosum". Resolved by obsoleting the EFO term in favour of the Mondo one:

  • label prefixed obsolete_, owl:deprecated true
  • obsoleted_in_version 3.94.0 (next minor after the current 3.93.0)
  • reason_for_obsolescence + IAO_0100001 → MONDO:0018824
  • all logical axioms removed (both subClassOf parents and the RO_0002314 some UBERON_0000014 restriction)
  • definition, original IAO_0000117 author annotation and all 7 xrefs retained, per the convention of the 9,116 existing obsolete terms here

No axiom elsewhere in efo-edit.owl referenced EFO_0006835, and it is not in subclasses.csv, so nothing needed rewiring.

Reviewer note: EFO_0006835 is flagged gwas_trait "true" in the generated components/gwas_import.owl. That file is driven by iri_dependencies/gwas_terms.tsv and is not updated by obsoletion — 990 previously obsoleted EFO terms are already in the same state (938 of them from the 3.88.0 Mondo migration), so this follows existing practice rather than introducing a new gap. Worth flagging to the GWAS team, but out of scope here.

Verification

om make qc run locally on the exact pushed content — all four checks pass, exit 0:

Check Result
sparql_test PASS — 11/11 rules, 0 violations each
all_reports PASS
label_synonym_dup_check PASS (warning: 5018 collisions, down from 5019)
check_mondo_obsoletes PASS (warning: 473 deprecated without replacement — unchanged, pre-existing)

Also clean: om make normalize_src, and om reason -i src/ontology/efo-edit.owl -r ELK (exit 0, no unsatisfiable classes).

Both previously-failing rules now report 0, and no previously-passing rule regressed — no-dangling-violation and deprecated-violation in particular, which were the plausible casualties of stripping the term's parents and adding a deprecated class.

Still open

MONDO:0003634 proteinuria remains unimported, as described in the PR description — EFO already carries the concept as HP:0000093. That part of #2818 is answered by an existing term, which is why the issue is intentionally left open.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AWNpNSoJahy3ZtBcMaUstK

@jamesamcl

Copy link
Copy Markdown
Member

Superseded by #2823. This branch was based on the pre-reset master, so merging it would have reintroduced the owlmake build-system migration (now kept on efo-4 only) into the EFO 3 line. #2823 carries the same three commits cherry-picked onto the reset master (uberon_import.owl rebuilds byte-identically under the EFO 3 Makefile pipeline), with the PR description updated for the EFO 3 build — including that imports/mondo_import.owl is committed there and left for the next regeneration, per the #2684 precedent.

@jamesamcl jamesamcl closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants