biocypher / metalinks

GNU General Public License v3.0
3 stars 2 forks source link

Error in create_knowedge_graph.py #10

Open emyyue opened 2 months ago

emyyue commented 2 months ago

Hi! Installation runs with conda. Poetry install only manages to install bioregistry when python version was set to python = "~3.11"

Now I am trying to create the KG with python create_knowledge_graph.py This is the error I stumble in. Any idea how to fix it?

INFO -- This is BioCypher v0.5.43.
INFO -- Logging into `biocypher-log/biocypher-20240618-174557.log`.
Traceback (most recent call last):
  File "/Users/huy169/Documents/github/biocypher_verse/metalinks/create_knowledge_graph.py", line 17, in <module>
    from metalinks.adapters.stitch_adapter import (
  File "/Users/huy169/Documents/github/biocypher_verse/metalinks/metalinks/adapters/stitch_adapter.py", line 10, in <module>
    from pypath.utils import mapping
  File "/Users/huy169/Library/Caches/pypoetry/virtualenvs/metalinks-y7QBJz4L-py3.11/lib/python3.11/site-packages/pypath/utils/mapping.py", line 64, in <module>
    import pypath.internals.maps as maps
  File "/Users/huy169/Library/Caches/pypoetry/virtualenvs/metalinks-y7QBJz4L-py3.11/lib/python3.11/site-packages/pypath/internals/maps.py", line 23, in <module>
    import pypath.internals.input_formats as input_formats
  File "/Users/huy169/Library/Caches/pypoetry/virtualenvs/metalinks-y7QBJz4L-py3.11/lib/python3.11/site-packages/pypath/internals/input_formats.py", line 651, in <module>
    class UnichemMapping(MappingInput):
  File "/Users/huy169/Library/Caches/pypoetry/virtualenvs/metalinks-y7QBJz4L-py3.11/lib/python3.11/site-packages/pypath/internals/input_formats.py", line 655, in UnichemMapping
    for id_type in unichem_input.unichem_sources().values()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/huy169/Library/Caches/pypoetry/virtualenvs/metalinks-y7QBJz4L-py3.11/lib/python3.11/site-packages/pypath/inputs/unichem.py", line 98, in unichem_sources
    for s in unichem_info()
             ^^^^^^^^^^^^^^
  File "/Users/huy169/Library/Caches/pypoetry/virtualenvs/metalinks-y7QBJz4L-py3.11/lib/python3.11/site-packages/pypath/inputs/unichem.py", line 59, in unichem_info
    soup = bs4.BeautifulSoup(c.result, 'html.parser')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/huy169/Library/Caches/pypoetry/virtualenvs/metalinks-y7QBJz4L-py3.11/lib/python3.11/site-packages/bs4/__init__.py", line 315, in __init__
    elif len(markup) <= 256 and (
         ^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()

Best

dbdimitrov commented 1 month ago

Hi @emyyue,

Apologize for the delayed response.

I believe this issue is related to pypath. Installing pypath from this fork: https://github.com/dbdimitrov/pypath/tree/metalinks should resolve the issue.

Please let us know if we can provide anything else.

Daniel

dbdimitrov commented 1 month ago

PS. a neo4j dump if you share an email can be downloaded from here: https://zenodo.org/records/11066196, and any auxiliary files are downloadable from here: https://github.com/saezlab/MetalinksDB/tree/main/metalinksDB