Comments (4)
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.
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.
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.
Great, thank you!
Adding the key to the annotation_list let's me importing the subgraph with pybel.
from pybel.
Related Issues (20)
- pybel.tokens.parse_result_to_dsl doesn't capture 'concept' information
- UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 8815866: character maps to <undefined> HOT 11
- Switch from Travis-CI to GitHub Actions
- Add postgres and mysql container tests to GitHub Actions
- pybel.to_indra_statements() fails on KEGG COVID pathway BEL script HOT 2
- Variable name typo
- collapse_nodes does not apply to members of ListAbundance HOT 3
- Update EMMAA downloader
- Named reactions
- Convert .Molecule or OBMol to SMILES HOT 1
- How to convert files in SMILES or MOL format to MOL2 3D structure HOT 1
- Add HTML summary for better jupyter notebook output
- Challenge writing INDRA statements to nodelink and reading it back in to pybel HOT 2
- Problem getting a BEL graph from the Fraunhofer OrientDB HOT 2
- Cannot write the graph in any extension
- Unorganized data to_sif and No attribute 'to_triples_file
- attribute error for pybel HOT 1
- Getting problems with examples (pybel) HOT 1
- hetionet does not work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pybel.