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

Mermaid diagrams Pt 1 #20

Open
matentzn opened this issue Jun 24, 2022 · 3 comments
Open

Mermaid diagrams Pt 1 #20

matentzn opened this issue Jun 24, 2022 · 3 comments

Comments

@matentzn
Copy link

Seems @manulera came up with https://github.com/manulera/ontology_viewer which looks like its doing a subset of obographviz, outputting pretty github embeddable mermaid graphics:

pombase/fypo#4166 (comment)

@manulera obographviz is the tool we generally use for making the graphic of the kind you made on the issue above. @cmungall @manulera is the new PomBase curator!

@cmungall
Copy link
Collaborator

sorry just saw this! Nice to meet you @manulera!

This is a really nice viewer! I think it's really important to show other relationship types to use this for ontologies like GO, CL, Uberon, ..

My understanding of the architecture is:

Some recommendations, take or leave!

  • Use obo graph as the standard json form for communicating graphs
  • use kgviz as a standard for communicating a stylesheet
    • this may seem like massive overkill here as there is not a lot of styling available in mermaid compared to e.g. graphviz
    • it's still useful as a standard for configuring some things:

It's quite likely we will add mermaid generation to OAK. I am not sure yet if this will be implemented in javascript in this repo, or in Python in OAK -- or both

I like the simple Dockerized web app you have here - we are currently exploring a simple FastAPI and UI layer on top of OAK for supporting OAK commands like tree and graph visualization

I also note you have arrows going in the reverse direction than is standard for ontology views

@manulera
Copy link

Hi @cmungall and @matentzn thanks for checking it out, and sorry again for the super late reply.

I think a javascript-only website would be best for this, reading the json files instead of the obo. I just didn't have much time for it, and I could not find a simple js library that would load the json network and had easy functions to access all children of a term, like the function term.subclasses() and term.superclasses() in pronto. It was just easier like that.

If you point me to a javascript library like that, even within this repo, I could use that. Also, because so far it only shows asserted relationships, and only is_a relationships.

@manulera
Copy link

Sometimes it's easier done that said! I think I made it, using the library bbop graph from the obographviz repo.

This is the repo: https://github.com/manulera/ontology_map_maker
And hosted in netlify: https://ontologynetwork.netlify.app/

You have to wait a bit for it to load the ontologies. As is, you can't request multiple terms, just one, even if you enter a list it will only return the first one. I will add that at some point, but for now it does what it should. It also puts the name of the relationship in the arrow.

It works with GO locally, but the problem is that I could not find an https link to the go ontology in json (☺️ oops!) so netlify complains about safety, so I commented it out. It reuses most of the code from the other repo, but does this instead of the python API call (much simpler).

https://github.com/manulera/ontology_map_maker/blob/61d35660fb6dd2790c011d9f59f095b7c8df45dc/src/index.js#L33-L55

@matentzn matentzn changed the title Consider looping in PomBase people on obographviz Mermaid diagrams Pt 1 Apr 28, 2023
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

No branches or pull requests

3 participants