Chromatogram ms_matplotlib#

This example shows a chromatogram colored by mass trace. Since all fragment ion spectra coelute this provides strong evidence that the peptide is present.

Chromatogram
/home/runner/work/pyopenms_viz/pyopenms_viz/pyopenms_viz/_core.py:587: UserWarning:

Duplicate data detected, data will not be aggregated which may lead to unexpected plots. To enable aggregation set `aggregate_duplicates=True`.


<Axes: title={'center': 'Chromatogram'}, xlabel='Retention Time', ylabel='Intensity'>

import pandas as pd
from pyopenms_viz.util import download_file

pd.options.plotting.backend = "ms_matplotlib"

# GitHub raw URL (primary) with Zenodo as backup
url = "https://raw.githubusercontent.com/OpenMS/pyopenms_viz/main/test/test_data/ionMobilityTestChromatogramDf.tsv"
backup_url = "https://zenodo.org/records/17904352/files/ionMobilityTestChromatogramDf.tsv?download=1"
local_path = "ionMobilityTestChromatogramDf.tsv"
download_file(url, local_path, backup_url=backup_url)
df = pd.read_csv(local_path, sep="\t")

df.plot(
    kind="chromatogram",
    x="rt",
    y="int",
    by="Annotation",
    legend_config=dict(bbox_to_anchor=(1, 0.7)),
)

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

Gallery generated by Sphinx-Gallery