1.1. KEGG module exampleΒΆ

Histogram of KEGG pathways relations



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 .

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')
title("number of relations per pathways")

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

Generated by Sphinx-Gallery