biolink / ontobio

python library for working with ontologies and ontology associations
https://ontobio.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
118 stars 30 forks source link

Handle GPI label merge for geneontology/go-releases#50 #648

Closed dustine32 closed 9 months ago

dustine32 commented 9 months ago

For geneontology/go-releases#50.

This fleshes out the collections.BioEntities.merge() function to better handle labels when some are blank. The entity label should only be overwritten if the new label is non-blank.

In our actual use case here:

  1. The GAF-derived GPI is parsed into BioEntities first.
  2. The upstream, canonical MOD GPI is parsed and its own BioEntities object.
  3. The upstream, canonical MOD GPI BioEntities are merged into the existing GAF-derived GPI BioEntities ensuring that, if the canonical GPI has a blank symbol, it does not clobber the existing non-blank symbol.
kltm commented 9 months ago

@dustine32 By my read, this is a specific label merge override, but could be easily expanded later, correct?

kltm commented 9 months ago

If https://github.com/biolink/ontobio/pull/648#issuecomment-1747554581, feel free to merge on your schedule.

dustine32 commented 9 months ago

@kltm Yup, that block is there for any future field-merge logic with label being the only current use.