.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_kegg_relations.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_kegg_relations.py: KEGG module example ==================== Histogram of KEGG pathways relations .. GENERATED FROM PYTHON SOURCE LINES 9-28 .. image-sg:: /auto_examples/images/sphx_glr_plot_kegg_relations_001.png :alt: number of relations per pathways :srcset: /auto_examples/images/sphx_glr_plot_kegg_relations_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none 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 | .. code-block:: Python 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) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 20.619 seconds) .. _sphx_glr_download_auto_examples_plot_kegg_relations.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_kegg_relations.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_kegg_relations.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_kegg_relations.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_