Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visualization of EMMO based ontology #412

Closed
mdforti opened this issue May 11, 2022 · 3 comments · Fixed by #414
Closed

visualization of EMMO based ontology #412

mdforti opened this issue May 11, 2022 · 3 comments · Fixed by #414

Comments

@mdforti
Copy link

mdforti commented May 11, 2022

I am trying to follow the examples, but the first cytoscape example at

https://github.com/emmo-repo/EMMO-python/blob/master/examples/jupyter-visualization/emmographs.ipynb

fails with this message:

File /scratch/AnacondaEnvironments/Ontologies/lib/python3.9/site-packages/ontopy/graph.py:1073, in cytoscapegraph(graph, onto, infobox)
1070 data = cytoscape_data(pydot_graph)["elements"]
1071 for datum in data["edges"]:
1072 datum["data"]["label"] = (
-> 1073 datum["data"]["label"].rsplit(" ", 1)[0].lstrip('"')
1074 )
1075 lab = datum["data"]["label"].replace("Inverse(", "").rstrip(")")
1076 try:

KeyError: 'label'

I would appreciate any guidance on this.

@francescalb
Copy link
Collaborator

Thank you for pointing this out to us.

I see that the reason for this i a change in the default values for the original graph generation.

If you add edgelabels=True, it should work i.e.

replacing the line:
graph = OntoGraph(onto, onto.Perspective, leafs=leafs, parents=1

with
graph = OntoGraph(onto, onto.Perspective, leafs=leafs, parents=1, edgelabels=True)

@mdforti
Copy link
Author

mdforti commented May 23, 2022

First of all, thank you for the fix based on this issue! I also needed to update networkx to conda-forge version to make it work, finally. It would also be helpfull if you can provide some references on how to tweak the cytograph plots, i.e. labels on relations, orientation and forcing position of some nodes.

@francescalb
Copy link
Collaborator

Hi, we have not gone into details on how to tweak the graphs as of yet. We are using the ipycytoscapegraph package which is documented here https://ipycytoscape.readthedocs.io/en/master/index.html .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants