Closed cmungall closed 3 years ago
Are you saying that obographs will parse nucleus.json.txt but ontol.py will not? As far as I'm aware, there's no coordination between ontol.py and obographs. I ran this in ontobio, and it doesn't crash like you have above, but it makes a graph with 0 nodes, so clearly something is going wrong.
Hey @cmungall, What command did you use to load the file?
I did this, and I think it worked for me:
$ python3 -m venv env
$ source env/bin/activate
$ python
>>> from ontobio.ontol_factory import OntologyFactory
>>> ont = OntologyFactory().create(open("nucleus.json.txt"))
>>> ont.graph.size()
14
I think the problem is in the implementation of synonyms()
on Ontology
. On Line 782 we attempt to make a Synonym
object by de-structuring the obj
(like **obj
) and passing in the key-value pairs from the synonyms
key. So using your above example, it's passing in "synonymType"="http://purl.obolibrary.org/obo/go-test#systematic_synonym"
but there isn't a synonymType
key in the Synonym.__init__()
.
@cmungall to answer "this release is incorporated in robot, are we not using this?" in a public space for others, the GO pipeline isolates robot and obograph use to a single docker image, the the versions are already locked there. Without an update to those images, the current product from that stage does not seem to exhibit any issues with the versions of ontobio we have baked into our requirements.txt.
@dougli1sqrd on the right track. But the error isn't revealed until a synonym object is created, it's lazy so created on demand
>>>ont = OntologyFactory().create("nucleus.json")
>>> ont.synonyms("http://purl.obolibrary.org/obo/GO_0005634")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/cjm/repos/ontobio/ontobio/ontol.py", line 778, in synonyms
if 'meta' in n:
TypeError: argument of type 'NoneType' is not iterable
>>> ont.synonyms("http://purl.obolibrary.org/obo/GO_0005634")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/cjm/repos/ontobio/ontobio/ontol.py", line 778, in synonyms
if 'meta' in n:
TypeError: argument of type 'NoneType' is not iterable
+1 running into the same issues now.
Is anyone working on this issue?
>>>
>>> ont.synonyms("GO:0005634")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/dougli1sqrd/lbl/biolink/ontobio/ontobio/ontol.py", line 782, in synonyms
syns.append(Synonym(nid, **obj))
TypeError: __init__() got an unexpected keyword argument 'synonymType'
https://github.com/geneontology/obographs/releases/tag/v0.2.1 release in Feb
I'm surprised that ontobio ontol.py doesn't work with this? this release is incorporated in robot, are we not using this?
When I try and parse the json I get
Seems to be caused by
see the attached file for an example of the nucleus example in this repo translated
nucleus.json.txt