Code Monkey home page Code Monkey logo

Comments (4)

cthoyt avatar cthoyt commented on June 10, 2024

I was pretty careful to make sure old files could be loaded. However, there are many flavors of JSON (nodelink JSON, SBEL JSON, GraphDati JSON) so you have to make sure to use the file extension bel.nodelink.json if you're using pybel.load. If you don't want to worry about automatic inference of the data type, you can try pybel.from_nodelink_file

from pybel.

leon-k-martin avatar leon-k-martin commented on June 10, 2024

Thank you for the quick reply!

I tried the import with the pybel.from_nodelink_file but get a new error unfortunately:

  File "/opt/anaconda3/lib/python3.8/site-packages/pybel/struct/graph.py", line 932, in <dictcomp>
    key: sorted(self._clean_value(key, values), key=lambda e: (e.namespace, e.identifier, e.name))

  File "/opt/anaconda3/lib/python3.8/site-packages/pybel/struct/graph.py", line 969, in _clean_value
    raise NotImplementedError(f'where is key {key}?')

NotImplementedError: where is key NeuroMMSig-Disease?

Am I doing sth wrong or are the json-files I am trying to load exported incorrectly?

from pybel.

cthoyt avatar cthoyt commented on June 10, 2024

This is happening because there is an underlying semantic error in the BEL document -there is no annotation definition for "NeuroMMSig-Disease".

I agree that this isn't a very informative message, and it should probably give a warning instead of crashing the whole program. I might have to take care of this one with an update to the underlying code since I don't think there's an option to disable this check.

You could add an annotation definition in the JSON file (in the "annotations" key) before processing with PyBEL and that should be a quick fix. Let me know if you run into any issues doing that. Are you getting these files from the NeuroMMSig service? Or did daniel send you a dump?

from pybel.

leon-k-martin avatar leon-k-martin commented on June 10, 2024

Great, thank you!
Adding the key to the annotation_list let's me importing the subgraph with pybel.

from pybel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.