Skip to content

Add UPheno human-mouse phenotype homology ingest#421

Merged
EvanDietzMorris merged 8 commits into
masterfrom
codex/mousekop
Jul 23, 2026
Merged

Add UPheno human-mouse phenotype homology ingest#421
EvanDietzMorris merged 8 commits into
masterfrom
codex/mousekop

Conversation

@cbizon

@cbizon cbizon commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a UPheno OBO-based ingest that infers HP-to-MP biolink:homologous_to edges from shared species-independent UPheno parents.
  • Register the source and include it in RoboMouseKG.
  • Keep the RoboMouse source lenient for now because strict Node Normalizer handling drops almost all MP-backed edges.

Hold

  • Draft PR: hold off on merging until MP is built into Node Normalizer.
  • The completed ingest produces 2,169 source edges, but strict normalization leaves only 13 normalized edges because MP identifiers mostly do not normalize today.

Verification

  • uv run pytest tests/test_upheno_loader.py tests/test_graph_spec.py tests/test_source_metadata.py
  • uv run pytest
  • Full source ingest completed: UPhenoHumanMousePhenotypeHomology release 1315ce70e57e81f9

- Add UPheno OBO-based loader for HP/MP homology inference

- Register the source and add it to RoboMouseKG with lenient normalization

- Add loader and graphspec regression tests
@github-actions github-actions Bot added the Biological Context QC Require validation of biological context to ensure accuracy and consistency label Jul 6, 2026
@cbizon
cbizon marked this pull request as ready for review July 7, 2026 15:09
@cbizon
cbizon requested a review from eKathleenCarter July 7, 2026 15:09
Resolves conflicts from master's graph-spec/build-pipeline refactor
(graph_specs reorganized into optional/, source_id -> id, subgraphs
folded into sources, build_manager.py -> graph_pipeline.py/graph_registry.py).

Ports this branch's UPheno human-mouse phenotype homology addition onto
the new graph_specs/robokop-graph-spec.yaml (master had independently
already added RoboMouseKG with MouseGOA/GenomeAllianceOrthologs) and
updates the corresponding test_graph_spec.py assertions to master's
new GraphBuilder API.
@eKathleenCarter

Copy link
Copy Markdown
Contributor

Merged master into this branch, resolved conflicts. will do a more formal review now that the branch is up to date.

@EvanDietzMorris worth checking that I got the new
robokop-graph-spec.yaml
data_sources.py

correct.

@eKathleenCarter

Copy link
Copy Markdown
Contributor

NCATSTranslator/Babel#886

was merged into main. Gaurav is currently running the Babel pipeline and will then update NN. I will keep this PR up to date on progress.

@eKathleenCarter

Copy link
Copy Markdown
Contributor

I ran the parser end-to-end (orion-build UPhenoHumanMousePhenotypeHomology, then a small custom graph spec mirroring RoboMouseKG's settings) and checked it against the real upheno.obo release (108MB, 193,295 terms).

Two things I found:

  1. Obsolete OBO terms were included in homology inference

parse_obo_term/parse_data never checked for is_obsolete: true. Downloading the real upheno.obo and cross-referencing obsolete HP/MP terms against their is_a lines showed 11 obsolete terms (e.g. HP:0003063, replaced by HP:0031095) still carry a live is_a: to their old UPHENO parent.

Those terms were being pulled into species_a_by_parent/species_b_by_parent and asserted as biolink:homologous_to, which introduced edges anchored to deprecated, non-canonical identifiers into the graph.

I changed parse_obo_term to record is_obsolete, and parse_data now skips obsolete terms before inference. All 11 obsolete HP/MP terms with a stale is_a are now excluded; in this particular release only one of them (HP:0007543, sharing a parent with MP:0001242) had actually produced a spurious edge, so the fixed output has exactly 1 fewer node and 1 fewer edge, but the other 10 are also no longer silently exposed to becoming spurious edges the next time UPheno adds a sibling term under their parent. Also, I added a test in tests/test_upheno_loader.py.

  1. The "skip already-asserted homology" dedup was never used.

DEFAULT_EXISTING_HOMOLOGY_PREDICATES (biolink:homologous_to, RO:HOM0000007, homologous_to) was meant to skip inferring a pair the ontology already asserts homologous via an explicit relationship: line.

Grepping all 51,215 relationship: lines in the real file, and separately checking for any relationship: line connecting an HP term directly to an MP term under any predicate, found zero matches. UPheno doesn't assert cross-species homology that way.

The dedup path was dead code and only exercised by the synthetic unit-test fixture. In production, it would always report 0 "skipped" edges, implying that pre-asserted homology was being deduplicated when the mechanism was never reachable.

I removed the dead code and updated tests/test_upheno_loader.py accordingly.

@eKathleenCarter

Copy link
Copy Markdown
Contributor

@cbizon and @EvanDietzMorris take a look at the changes I made, but if this all sounds good, then this parser is GTG. We should probably wait until Babel and NN finish the update to merge, though.

@eKathleenCarter eKathleenCarter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see comment for requested changes.

@eKathleenCarter
eKathleenCarter self-requested a review July 21, 2026 15:19
@EvanDietzMorris

Copy link
Copy Markdown
Contributor

Looks good and all MP terms normalize successfully as of Babel 2026jul22.

I made a few small changes:

  • added names to the nodes so they would be there for nodes that did not normalize, but that's kind of obsolete now.
  • removed this from the RESOURCE_HOGS list, which is only for sources that require lots of memory
  • removed the supporting data source edge property which was always set to the same infores as the primary knowledge source

@EvanDietzMorris
EvanDietzMorris merged commit 225a9d0 into master Jul 23, 2026
2 checks passed
@EvanDietzMorris
EvanDietzMorris deleted the codex/mousekop branch July 23, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Biological Context QC Require validation of biological context to ensure accuracy and consistency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants