7.1. KEGG module example

Histogram of KEGG pathways relations

../_images/sphx_glr_plot_kegg_relations_001.png

Out:

Creating directory /home/docs/.config/bioservices
Creating directory /home/docs/.cache/bioservices
Welcome to Bioservices
======================
It looks like you do not have a configuration file.
We are creating one with default values in /home/docs/.config/bioservices/bioservices.cfg .
Done

from pylab import *


# extract all relations from all pathways
from bioservices.kegg import KEGG
s = KEGG()
s.organism = "hsa"

# retrieve more than 260 pathways so it takes time
max_pathways = 10
results = [s.parse_kgml_pathway(x) for x in s.pathwayIds[0:max_pathways]]
relations = [x['relations'] for x in results]

# plot
hist([len(this) for this in relations], 20)
xlabel('number of relations')
ylabel('#')
title("number of relations per pathways")
grid(True)

Total running time of the script: ( 0 minutes 12.202 seconds)

Generated by Sphinx-Gallery