.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/ms_bokeh/plot_spectrum_ms_bokeh.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 or to run this example in your browser via Binder. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_ms_bokeh_plot_spectrum_ms_bokeh.py: Spectrum ms_bokeh ======================================= This example shows a spectrum. We can add the ion_annotation and sequence annotation by specifying these columns. .. GENERATED FROM PYTHON SOURCE LINES 8-27 .. bokeh-plot:: :source-position: none from bokeh.plotting import show import pandas as pd from pyopenms_viz.util import download_file pd.options.plotting.backend = "ms_bokeh" url = "https://zenodo.org/records/17904352/files/TestSpectrumDf.tsv?download=1" local_path = "TestSpectrumDf.tsv" download_file(url, local_path) df = pd.read_csv(local_path, sep="\t") # mirror a reference spectrum with ion and sequence annoations df.plot( x="mz", y="intensity", kind="spectrum", ion_annotation="ion_annotation", sequence_annotation="sequence", ) .. rst-class:: sphx-glr-script-out .. code-block:: none Annotation color: None .. raw:: html
figure(
id = 'p1597', …)


| .. code-block:: Python import pandas as pd from pyopenms_viz.util import download_file pd.options.plotting.backend = "ms_bokeh" url = "https://zenodo.org/records/17904352/files/TestSpectrumDf.tsv?download=1" local_path = "TestSpectrumDf.tsv" download_file(url, local_path) df = pd.read_csv(local_path, sep="\t") # mirror a reference spectrum with ion and sequence annoations df.plot( x="mz", y="intensity", kind="spectrum", ion_annotation="ion_annotation", sequence_annotation="sequence", ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.728 seconds) .. _sphx_glr_download_gallery_ms_bokeh_plot_spectrum_ms_bokeh.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://notebooks.gesis.org/binder/v2/gh/OpenMS/pyopenms_viz/gh_pages?filepath=notebooks/gallery/ms_bokeh/plot_spectrum_ms_bokeh.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_spectrum_ms_bokeh.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_spectrum_ms_bokeh.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_spectrum_ms_bokeh.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_