Skip to content

import: 22 HP terms for Open Targets Safety 2.0 (#2817) - #2821

Closed
ar-ibrahim wants to merge 12 commits into
masterfrom
issue-2817
Closed

ar-ibrahim wants to merge 12 commits into
masterfrom
issue-2817

Conversation

@ar-ibrahim

Copy link
Copy Markdown
Collaborator

Summary

Imports the 22 HP terms requested in #2817 for the Open Targets Safety 2.0 project. The IRIs were added to src/ontology/iri_dependencies/hp_terms.txt and the HP import was regenerated. No changes to efo-edit.owl — all terms sit under the existing HP hierarchy, which already places them beneath EFO:0000651 phenotype as requested in the ticket, so no subclasses.csv entry was needed.

No new EFO terms are created by this PR, so there are no temporary EFO_099xxxx IDs.

Changes

Action Term ID Parent Source ontology
Imported Nocturia HP:0000017 inherited from HP HP
Imported Renal agenesis HP:0000104 inherited from HP HP
Imported Retinopathy HP:0000488 inherited from HP HP
Imported Blepharospasm HP:0000643 inherited from HP HP
Imported Oligohydramnios HP:0001562 inherited from HP HP
Imported Torsade de pointes HP:0001664 inherited from HP HP
Imported Renal tubular acidosis HP:0001947 inherited from HP HP
Imported Gastroesophageal reflux HP:0002020 inherited from HP HP
Imported Hyperglycinemia HP:0002154 inherited from HP HP
Imported Intracranial hemorrhage HP:0002170 inherited from HP HP
Imported Myoglobinuria HP:0002913 inherited from HP HP
Imported Prolonged partial thromboplastin time HP:0003645 inherited from HP HP
Imported Abnormality of coordination HP:0011443 inherited from HP HP
Imported Acute infectious pneumonia HP:0011949 inherited from HP HP
Imported Sinoatrial block HP:0012723 inherited from HP HP
Imported Invasive fungal infection HP:0020101 inherited from HP HP
Imported Folliculitis HP:0025084 inherited from HP HP
Imported Decreased serum zinc HP:0031831 inherited from HP HP
Imported Hypoesthesia HP:0033748 inherited from HP HP
Imported Enteroviral encephalitis HP:0034285 inherited from HP HP
Imported Scaling skin HP:0040189 inherited from HP HP
Imported Hypercoagulability HP:0100724 inherited from HP HP

Files touched:

  • src/ontology/iri_dependencies/hp_terms.txt — 22 IRIs added (hand-edited source list)
  • src/ontology/imports/hp_terms.txt, src/ontology/imports/hp_import.owl — regenerated, not hand-edited

Class count in the import: 2526 → 2548.

⚠️ Reviewer note: this diff is larger than 22 terms

The regeneration also refreshed the HP mirror, so hp_import.owl picks up upstream HP changes unrelated to this request. See the dedicated comment below for the breakdown — the headline is ~4600 removed UMLS:/SNOMEDCT_US: hasDbXref annotations. Please read that comment before judging the diff size.

Checks

  • Import done via the iri_dependencies → om make route; no hand-edited files under imports/
  • All 22 IDs verified present in the regenerated import with the labels listed in the ticket
  • efo-edit.owl untouched — no reasoning or normalization impact
  • Upstream xref removal (see comment) needs a maintainer decision

Closes #2817

🤖 Generated with Claude Code

https://claude.ai/code/session_01UXj5XoTCgsSuiUVwZZB5tV

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 the 22 requested HP IRIs to iri_dependencies/hp_terms.txt and
regenerates the HP import.

The regeneration also refreshed the HP mirror, so the import picks up
upstream HP changes beyond the 22 new terms - most visibly the removal
of ~4600 UMLS/SNOMEDCT_US hasDbXref annotations that are no longer
distributed upstream.

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

Copy link
Copy Markdown
Collaborator Author

⚠️ Heads-up: bulk removal of UMLS / SNOMEDCT_US xrefs from hp_import.owl

This PR's stated purpose is the 22 HP terms from #2817, but imports/hp_import.owl shows 746 added / 5161 removed lines. Almost none of that is the new terms. Flagging it explicitly so the diff size isn't mistaken for an error.

Cause. The import was regenerated with --rebuild mirrors,imports, which also refreshed the local HP mirror to the 2026-09-01 HP release (http://purl.obolibrary.org/obo/hp/releases/2026-09-01/hp.owl). The import therefore carries every upstream HP change since the mirror was last refreshed, not just the requested terms.

Removed annotations (all upstream, none hand-edited):

Annotation Count removed
oboInOwl:hasDbXref → UMLS: 2909
oboInOwl:hasDbXref → SNOMEDCT_US: 1697
oboInOwl:hasDbXref → HPO_CONTRIBUTOR: 3
oboInOwl:inSubset 371
oboInOwl:hasExactSynonym 40
rdfs:subClassOf 30
reified owl:Axiom blocks 14
rdfs:label 3

Example — HP:0000011 Neurogenic bladder loses three xrefs:

-        <oboInOwl:hasDbXref>SNOMEDCT_US:397732007</oboInOwl:hasDbXref>
-        <oboInOwl:hasDbXref>SNOMEDCT_US:398064005</oboInOwl:hasDbXref>
-        <oboInOwl:hasDbXref>UMLS:C0005697</oboInOwl:hasDbXref>

PMID (709), MEDDRA (44), NCIT (17), ICD (15), MP (10) and other xref prefixes are unaffected — the removal is confined to UMLS: and SNOMEDCT_US:, which is consistent with upstream HP dropping the UMLS-derived mappings rather than with anything this PR did.

Additions beyond the 22 terms (also upstream): 99 exact synonyms, 51 subClassOf, 47 owl:Axiom, 27 hasSynonymType, 12 rdfs:comment. Net class count 2526 → 2548, i.e. exactly the 22 requested terms.

What needs a decision. If any downstream EFO consumer relies on UMLS or SNOMEDCT_US xrefs reaching them through hp_import.owl, merging this drops ~4600 of those mappings in one go. Options:

  1. Merge as-is — accept the upstream HP 2026-09-01 state; the xrefs are gone upstream and EFO should track that.
  2. Split — land the 22 terms against the previous mirror, and handle the HP version bump in its own PR so the xref loss is reviewed on its own merits.

I've left it as option 1 since the mirror refresh is the documented way to regenerate an import (om make imports/hp_import.owl --rebuild mirrors,imports) and pinning the old mirror would be a deliberate deviation. Happy to redo it as option 2 if the mapping loss is a problem for Open Targets or any other consumer.

🤖 Generated with Claude Code

@jamesamcl

Copy link
Copy Markdown
Member

Superseded by #2822. 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. #2822 carries the identical import commit cherry-picked onto the reset master — hp_import.owl rebuilds byte-identically under the EFO 3 Makefile pipeline — and the xref-removal breakdown comment has been carried over there.

@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.

[Import] Request to import HP terms for Open Targets Safety 2.0 project

3 participants