Add UPheno human-mouse phenotype homology ingest#421
Conversation
- 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
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.
|
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 correct. |
|
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. |
|
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:
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.
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. |
|
@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
left a comment
There was a problem hiding this comment.
Please see comment for requested changes.
|
Looks good and all MP terms normalize successfully as of Babel 2026jul22. I made a few small changes:
|
Summary
Hold
Verification