#!/usr/bin/env python
# coding: utf-8
# # Intermine-Python: Tutorial 14 - Visualisation in Intermine
# With the great need for data visualisation in the present world, we have introduced a few visual features to Intermine as well. We have tried to cover the most common needs of visualisation and have explained their use in this tutorial.
# NOTE: This feature of Python Client is supported only on Python Versions>= 3.6 because of the dependencies.
# In[ ]:
from intermine import bar_chart as b
b.save_mine_and_token("humanmine","")
# 'saves the given mine and token'
# `plot_go_vs_p(list name)` can be used to print GO Terms vs p-value, as the name suggests. Also each bar in the bar-chart is labelled by the gene count corresponding to the particular GO Term.
# In[ ]:
b.plot_go_vs_p("PL_obesityMonogen_ORahilly09")
# ![title](images/Figure_1.png)
# Similarly, `plot_go_vs_count(list name)` can be used to print GO Terms vs gene count. Again, each bar in the bar-chart is labelled by the annotation corresponding to the particular GO Term.
# In[ ]:
b.plot_go_vs_count("PL_obesityMonogen_ORahilly09")
# ![title](images/Figure_2.png)
# `query_to_barchart_log(xml)` is used to plot the query given as an argument in xml format.
# Its important to note that the query should be in a format such that the first row contains the gene, the second row has content for x-axis and the third row consists if y-axis values.
# Also, only if the second argument is 'true', the y axis values are converted to their corresponding loge values. Its really useful if the values have a diverse range. If not needed, the second argument can be any string but 't
# In[ ]:
b.query_to_barchart_log('','true')
# ![title](images/Figure_3.png)
# We will soon be coming out with more plots. If you have any ideas feel free to open an issue in the Python Client repository.