.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_pipeline_stats.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_pipeline_stats.py: Pipeline statistics ===================================== .. GENERATED FROM PYTHON SOURCE LINES 8-9 First, let us get the data .. GENERATED FROM PYTHON SOURCE LINES 9-13 .. code-block:: Python from sequana_pipetools.snaketools import get_pipeline_statistics stats = get_pipeline_statistics() .. rst-class:: sphx-glr-script-out .. code-block:: none {'coverage': 3, 'demultiplex': 11, 'denovo': 26, 'fastqc': 8, 'mapper': 19, 'quality_control': 9, 'rnaseq': 33, 'variant_calling': 33} .. GENERATED FROM PYTHON SOURCE LINES 14-17 Plot number of rules per pipeline Note that pacbio_qc is self-content .. GENERATED FROM PYTHON SOURCE LINES 17-25 .. code-block:: Python from pylab import tight_layout, title stats[0].sum().plot(kind="barh") title("Number of rules per pipeline") tight_layout() from collections import Counter .. image-sg:: /auto_examples/images/sphx_glr_plot_pipeline_stats_001.png :alt: Number of rules per pipeline :srcset: /auto_examples/images/sphx_glr_plot_pipeline_stats_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 26-35 Proportions of rules re-used Amongst the rules, about a third of the rules are not used at all in the pipelines. There are two reasons: either they were part of previous pipeline versions and were discarded in favour of new tools, or there were used for testing and kept in case of. Then, we can see that a third of the rules are used only once. And finally, about a third used more than once. .. GENERATED FROM PYTHON SOURCE LINES 35-42 .. code-block:: Python from pylab import clf, pie count = Counter(stats[0].sum(axis=1)) values = list(count.values()) times = list(count.keys()) clf() pie(list(count.values()), labels=["{} used {} times".format(x, y) for x, y in zip(values, times)]) .. image-sg:: /auto_examples/images/sphx_glr_plot_pipeline_stats_002.png :alt: plot pipeline stats :srcset: /auto_examples/images/sphx_glr_plot_pipeline_stats_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none ([, ], [Text(-0.6858389529157668, 0.8600144944496021, '5 used 1 times'), Text(0.6858390281006222, -0.8600144344916508, '2 used 2 times')]) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.179 seconds) .. _sphx_glr_download_auto_examples_plot_pipeline_stats.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_pipeline_stats.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_pipeline_stats.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_pipeline_stats.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_