pronto icon indicating copy to clipboard operation
pronto copied to clipboard

Unable to create Pronto object since 2.5.6 (synonyms change)

Open Zethson opened this issue 1 year ago • 2 comments

Since the 2.5.6 release and the changes to how synonyms are handled (https://github.com/althonos/pronto/issues/218), I run into

Traceback (most recent call last):
  File "/home/zeth/PycharmProjects/bionty-base/test.py", line 8, in <module>
    Ontology("efo.owl")
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/ontology.py", line 283, in __init__
    cls(self).parse_from(_handle)  # type: ignore
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/parsers/rdfxml.py", line 119, in parse_from
    self._process_axiom(axiom, curies)
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/parsers/rdfxml.py", line 819, in _process_axiom
    for s in entity.synonyms
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/entity/__init__.py", line 465, in synonyms
    return frozenset(Synonym(ontology, s) for s in termdata.synonyms)
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/entity/__init__.py", line 465, in <genexpr>
    return frozenset(Synonym(ontology, s) for s in termdata.synonyms)
  File "/home/zeth/miniconda3/envs/bionty/lib/python3.10/site-packages/pronto/synonym.py", line 133, in __init__
    raise ValueError(f"undeclared synonym type: {syndata.type}")
ValueError: undeclared synonym type: OMO:0003000

when trying to read the https://www.ebi.ac.uk/efo/ ontology.

Works with 2.5.5, does NOT work with 2.5.6 anymore.

from pronto import Ontology

Ontology("efo.owl")

Zethson avatar Mar 13 '24 13:03 Zethson

*(for those who may find this thread later)

Today pronto v2.5.5 works with v3.66.0 efo.owl version , but doesn't work with newer efo version, so you don't only need to downgrade pronto but to download older efo as well.

igumnov-daniel avatar Oct 09 '24 11:10 igumnov-daniel

That's because the newer EFO version is broken. See: https://github.com/EBISPOT/efo/issues/2264 (also for a solution). I can read EFO 3.70+ by fixing the owl file as outlined in the thread.

Nevertheless, this issue is still open and relevant.

Zethson avatar Oct 09 '24 11:10 Zethson