tanghaibao / goatools

Python library to handle Gene Ontology (GO) terms
BSD 2-Clause "Simplified" License
749 stars 212 forks source link

Question: DAGs like how AgriGO or topGO do #212

Open harish0201 opened 3 years ago

harish0201 commented 3 years ago

Hi,

This is a really naive question and one of the few times that I've ventured out from using topGO. I really like using GOAtools and I wanted to check if there is a way that a DAG like this can be rendered?

image

While I'm fairly certain that I'm missing some crucial step from the cookbook, is there a way to pick the top "n" significant terms from find_enrichment and generate a DAG based on it?

tanghaibao commented 3 years ago

@harish0201

Currently, our DAG plotting style is different but we may be able to create a custom style like TopGO. If you compare it with:

https://github.com/tanghaibao/goatools/tree/main/notebooks/images

I'm not super familiar with TopGO, but I saw:

For your second question, you can get the GO ids from find_enrichment and then plot them with scripts/plot_go_term.py, or use GoSubDag similar to the following notebook:

https://github.com/tanghaibao/goatools/blob/main/notebooks/parent_go_terms.ipynb

harish0201 commented 3 years ago

Hi,

Thank you for getting back so soon. I apologize for not being so clear in the original question.

Regarding the question from the above plot, I hope that I've understood topGO well enough to draft the response!

Reg Arrows: Black arrows indicate "is-a" relationships and red arrows "part-of" relationships. IIRC we can flip the arrow direction as well to represent the arrows going to the parents rather than the children which is how topGO represents it.

Reg Box Colors: Box color represents the relative significance, ranging from dark red (most significant) to light yellow (least significant). 

Reg Box shapes: Similarly Box shapes are also representative of the significance, i.e squares/rectangle => more significant and ovals less significant, but this is fine (I mean colors should easily convey their meaning).

For the second question, I'll check the notebook and let you know if that solves the purpose? Would that be fine with you?